Bug 190271
Summary: | process accounting sometimes does not work | ||
---|---|---|---|
Product: | Process Management | Reporter: | Martin Steigerwald (Martin) |
Component: | Other | Assignee: | process_other |
Status: | NEW --- | ||
Severity: | normal | CC: | martin.steigerwald, Martin, mh+kernel-bugzilla, rdimanos, wavexx |
Priority: | P1 | ||
Hardware: | x86-64 | ||
OS: | Linux | ||
Kernel Version: | 4.7 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | source code for atopacct test program |
Description
Martin Steigerwald
2016-12-13 15:05:09 UTC
I now reported the other bug as well: Bug 190711 - Process accounting: Using the NETLINK inface, the command TASKSTATS_CMD_GET returns -EINVAL Hello Martin It seems I reported the same problem with process accounting: Bug 180841 - Process accounting sometimes do not append records for terminated processes https://bugzilla.kernel.org/show_bug.cgi?id=180841 I think I found source of problem and patch, needed for correction this problem (described in my bugreport). About acctdemo.c: If in test acctdemo.c append delay between process accounting switch on with acct(ACCTFILE) and first process finishing for at least 1 jiffy (for example, sleep(1)), then problem will be reproduce almost always. So, need follow changes: ... if (acct(ACCTFILE) == -1) { perror("Switch on accounting"); exit(1); } sleep(1); /* for better reproduce problem */ if ( fork() == 0 ) // fork new process exit(0); // child process: finish ... |