/dev/kmem & processinformation HELP NEEDED

/dev/kmem & processinformation HELP NEEDED

Post by volume regelin » Sat, 17 Feb 2001 03:54:14


I am making a piece of software which gets some process/thread information.
It is written in C++ on AIX

I have managed to get the proc structure out of the kernel through the use
nlist, "/dev/kmem" and readx.

The problem is the following :

I want the pid, cpu usage, time the process has started and processname
retrieved from the kernel.
The proc structure which I know use doesnt have the (right) cpu field,the
"time the process started" field, and the processname.

The CPU usage which I got from the structure doesnt by far look like the
"ps aux" gives me. I understand I have to do some calculations with some
fields and the cpu fields but I havent gotten to that part yet.

For the processname field I could use getprocs() but that wont compile with
C++ , so thats not an option. Ofcourse just "ps" with awk of sed is no

If you know how to retrieve the "time the process started", the right CPU
usage or the processname from the proc structure or through the use of
calls please reply.



1. : Reading kmem addr in UnixWare (/dev/kmem)

Hi Netters,

Can anyone please tell me how to read/write a kernel virtual address in
UnixWare using /dev/kmem  ?

The only ioctls defined in kmem(7) are to read and write for a symbol. What
if I want to read a memory location ?

There is no kvm_ functions in Unixware or USL. I used kvm_ in Solaris, but
these are not available under USL.

Thanks in advance


2. UMoria works...almost

3. Need help on /dev/kmem

4. e2fsck 0.4 11/93 -- What's the deal with all these Inode messages?

5. Problems in istalling SCO Word Perfect under iBCS

6. kvm_open && dev/kmem <-> top

7. pppd call

8. Permissions on /dev/kmem and /dev/mem for top?

9. /dev/mem and /dev/kmem with world access?

10. How can I read /dev/mem, /dev/kmem ....?

11. HELP: 2>&1 > /dev/null != 2>&- > /dev/null ???

12. Please help me read tcp statistics from /dev/kmem