-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't get whole command line on AIX platform #1276
Comments
I'm not sure I understand the problem correctly, but there is a known issue in AIX (and Solaris) that causes very long arguments in the command line to be "skipped" from Process.cmdline. See, for example, bullet 2 in this comment: #605 (comment). If you run "ps", does it show the command line as you expect? |
Thank you for the answer. |
I have the same issue: the output from i can read the full command-line while running |
There are two problems with long command lines on AIX:
In this case the argument
The latter case can be fixed in void print_pid_args(int pid)
{
char buf[8192];
struct procsinfo procbuf;
char *p = buf;
procbuf.pi_pid = pid;
getargs(&procbuf, sizeof(struct procinfo), buf,sizeof(buf));
while (*p != '\0') {
printf("%s ", p);
p = strchr(p, '\0') + 1;
}
} |
It looks like Lines 151 to 158 in 7a3037e
From: |
Actually this is the correct documentation page for getargs: |
* origin/master: Fix giampaolo#1276: [AIX] use getargs to get process cmdline (giampaolo#1500) (patch by @wiggin15) Fix Process.ionice example using wrong keyword arg (giampaolo#1504) fix history syntax remove catching IOError; let the test fail and adjust it later Fix cpu freq (giampaolo#1496) pre release fix giampaolo#1493: [Linux] cpu_freq(): handle the case where /sys/devices/system/cpu/cpufreq/ exists but is empty. Revert "Fix cpu_freq (giampaolo#1493)" (giampaolo#1495) Fix cpu_freq (giampaolo#1493) Update cpu_freq to return 0 for max/min if not available (giampaolo#1487) give CREDITS to @agnewee for giampaolo#1491 SunOS / net_if_addrs(): free() ifap struct on error (giampaolo#1491) fix giampaolo#1486: add wraps() decorator around wrap_exceptions refactor/move some utilities into _common.py update doc update HISTORY Implement getloadavg on Windows. Fixes giampaolo#604 and giampaolo#1484 (giampaolo#1485) (patch by Ammar Askar) give credits to @amanusk for giampaolo#1472
It may have error on all aix system,I guess.I run was and want get was's commad line on AIX 6.1 system,but I only can get little infomation of the whole command line .You can test the program with code below,11534558 is the process's pid :
`import psutil
proc=psutil.Process(11534558)
pidDictionary = proc.as_dict(attrs=['cmdline'])
print pidDictionary
`
The text was updated successfully, but these errors were encountered: