getprocs() does not give the process information correctly
AIXThis forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
getprocs() does not give the process information correctly
Hi all,
In Aix i'm using getprocs() to get the detailed information about the process.
what does pi_size, a member of struct procsinfo represent? In
/usr/include/procinfo.h, it is mentioned as "long long pi_size;
/* size of image (pages) */"
what is meaning of image (is it a process image size or heap size of the process). If it is not representing the heap memory, how do i get the actual heap size of a process.
Note:I've also seen noticed that pi_tsize is representing size of text.
Can anybody explain me, what is the meaning of fields in the above mentioned structure & way to get the heap size.
/*
* Warning: the procinfo, userinfo, and uicredinfo structures represent
* obsolete interfaces. These would not compile correctly in 64-bit mode.
*/
#ifndef __64BIT__
struct procinfo
{
/* identification/authentication */
unsigned long pi_pid; /* process ID */
unsigned long pi_ppid; /* parent process ID */
unsigned long pi_sid; /* session identifier */
unsigned long pi_pgrp; /* process group */
unsigned long pi_uid; /* real user ID */
unsigned long pi_suid; /* saved user ID */
/* scheduler information */
unsigned long pi_pri; /* priority, 0 high, 31 low */
unsigned long pi_nice; /* nice for priority, 0 to 39 */
unsigned long pi_cpu; /* processor usage, 0 to 80 */
/* process states are defined in <sys/proc.h>: */
unsigned long pi_stat; /* process state */
/* process flags are defined in <sys/proc.h>: */
unsigned long pi_flag;
/* dispatcher fields */
char *pi_wchan; /* wait channel */
unsigned long pi_wtype; /* the wait type */
/* miscellaneous */
unsigned long pi_adspace; /* process address space */
unsigned long pi_majflt; /* i/o page faults */
unsigned long pi_minflt; /* non i/o page faults */
/* valid when the process is a zombie only */
unsigned long pi_utime; /* this process user time */
unsigned long pi_stime; /* this process system time */
/* process statistics */
unsigned long pi_size; /* size of image (pages) */
};
Page Size in AIX is 4096 bytes. So my best guess atm, is that your image size in bytes is this number * 4096.
Compare this number with output from svmon (which also reports in 'page sizes' and with ps. Note that ps reports in units of 1K.
And then you can determine whther it is heap, text, data, etc.
I expect it is ALL segments totaled. Again, this is easy to compare with output from svmon.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.