aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/accounting/getdelays.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-10-27delay-accounting: reimplement -c for getdelays.c to report information on a target commandMel Gorman1-2/+36
Task delay-accounting was identified as one means of determining how long a process spends in congestion_wait() without adding new statistics. For example, if the workload should not be doing IO, delay-accounting could reveal how long it was spending in unexpected IO or delays. Unfortunately, on closer examination it was clear that getdelays does not act as documented. Commit a3baf649 ("per-task-delay-accounting: documentation") added Documentation/accounting/getdelays.c with a -c switch that was documented to fork/exec a child and report statistics on it but for reasons that are unclear to me, commit 9e06d3f9 deleted support for this switch but did not update the documentation. It might be an oversight or it might be because the control flow of the program meant that accounting information would be printed once early in the lifetime of the program making it of limited use. This patch reimplements -c for getdelays.c to act as documented. Unlike the original version, it waits until the command completes before printing any information on it. An example of it being used looks like $ ./getdelays -d -c find /home/mel -name mel print delayacct stats ON /home/mel /home/mel/.notes-wine/drive_c/windows/profiles/mel /home/mel/.wine/drive_c/windows/profiles/mel /home/mel/git-configs/dot.kde/share/apps/konqueror/home/mel PID 5923 CPU count real total virtual total delay total 42779 5051232096 5164722692 564207988 IO count delay total 41727 97804147758 SWAP count delay total 0 0 RECLAIM count delay total 0 0 [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23Documentation/: fix warnings from -Wmissing-prototypes in HOSTCFLAGSLadinu Chandrasinghe1-6/+6
Fix up -Wmissing-prototypes in compileable userspace code, mainly under Documentation/. Signed-off-by: Ladinu Chandrasinghe <ladinu.pub@gmail.com> Signed-off-by: Trevor Keith <tsrk@tsrk.net> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-16Documentation/accounting/getdelays.c intialize the variable before using itJaswinder Singh Rajput1-1/+2
Fix compilation warning: Documentation/accounting/getdelays.c: In function `main': Documentation/accounting/getdelays.c:249: warning: `cmd_type' may be used uninitialized in this function This is in fact a false positive. Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Acked-by: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15Documentation/accounting/getdelays.c: fix endless loopMarcus Meissner1-0/+4
When no option is passed to getdelays it just hangs, waiting for a reply which will never come. This patch prints usage() when no output marker is specified. Signed-off-by: Marcus Meissner <meissner@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-12docsrc: fix getdelays printk formatsRandy Dunlap1-8/+17
Fix printf format type warnings (seen on alpha & ia64): Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 6 has type '__u64' Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 7 has type '__u64' Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 8 has type '__u64' Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 9 has type '__u64' Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 12 has type '__u64' Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 13 has type '__u64' Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 16 has type '__u64' Documentation/accounting/getdelays.c:206: warning: format '%15llu' expects type 'long long unsigned int', but argument 17 has type '__u64' Documentation/accounting/getdelays.c:214: warning: format '%15llu' expects type 'long long unsigned int', but argument 4 has type '__u64' Documentation/accounting/getdelays.c:214: warning: format '%15llu' expects type 'long long unsigned int', but argument 5 has type '__u64' Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 2 has type '__u64' Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type '__u64' Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 4 has type '__u64' Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 5 has type '__u64' Documentation/accounting/getdelays.c:221: warning: format '%llu' expects type 'long long unsigned int', but argument 6 has type '__u64' Documentation/accounting/getdelays.c:236: warning: 'cmd_type' may be used uninitialized in this function Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-25per-task-delay-accounting: update document and getdelays.c for memory reclaimKeika Kobayashi1-2/+6
Update document and make getdelays.c show delay accounting for memory reclaim. For making a distinction between "swapping in pages" and "memory reclaim" in getdelays.c, MEM is changed to SWAP. Signed-off-by: Keika Kobayashi <kobayashi.kk@ncos.nec.co.jp> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08getdelays: fix gcc warningsRandy Dunlap1-3/+3
Fix gcc warnings in getdelays.c: Documentation/accounting/getdelays.c: In function 'task_context_switch_counts': Documentation/accounting/getdelays.c:214: warning: format '%15lu' expects type 'long unsigned int', but argument 4 has type '__u64' Documentation/accounting/getdelays.c:214: warning: format '%15lu' expects type 'long unsigned int', but argument 5 has type '__u64' Documentation/accounting/getdelays.c: In function 'main': Documentation/accounting/getdelays.c:402: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' Documentation/accounting/getdelays.c: In function 'get_family_id': Documentation/accounting/getdelays.c:171: warning: 'id' may be used uninitialized in this function One warning is not a problem and can be dismissed: Documentation/accounting/getdelays.c: In function 'main': Documentation/accounting/getdelays.c:236: warning: 'cmd_type' may be used uninitialized in this function Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14make getdelays cgroupstats awareBalbir Singh1-1/+42
Update the getdelays utility to become cgroupstats aware. A new -C option has been added. It takes in a control group path and prints out a summary of the states of tasks in the control group Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-17Clean up duplicate includes in Documentation/Jesper Juhl1-1/+0
This patch cleans up duplicate includes in Documentation/ Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-22Documentation: fix getdelays.c printf bugMichael Neuling1-1/+1
Commit b663a79c191508f27cd885224b592a878c0ba0f6 ("taskstats: add context-switch counters") incorrectly removed a comma from a printf statement. This causes corruption in the output printing or a seg fault. Signed-off-by: Michael Neuling <mikey@neuling.org> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-16taskstats: add context-switch countersMaxim Uvarov1-2/+17
Make available to the user the following task and process performance statistics: * Involuntary Context Switches (task_struct->nivcsw) * Voluntary Context Switches (task_struct->nvcsw) Statistics information is available from: 1. taskstats interface (Documentation/accounting/) 2. /proc/PID/status (task only). This data is useful for detecting hyperactivity patterns between processes. [akpm@linux-foundation.org: cleanup] Signed-off-by: Maxim Uvarov <muvarov@ru.mvista.com> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Jay Lan <jlan@engr.sgi.com> Cc: Jonathan Lim <jlim@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08getdelays.c: fix overrunScott Wiersdorf1-4/+2
A patch for getdelays.c that fixes a buffer overrun when you set -w. Cc: <matt@bluehost.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08Taskstats: fix getdelays usage informationRandy Dunlap1-2/+12
Add usage to getdelays.c. This patch was originally posted by Randy Dunlap http://lkml.org/lkml/2007/3/19/168 Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2006-12-10[PATCH] io-accounting: add to getdelaysAndrew Morton1-3/+17
Wire up the IO accounting into getdelays.c. Usage: To display I/O stats for each exitting task: vmm:/home/akpm> ./getdelays -m0,1,2,3 -i -l cpumask 0 maskset 1 printing IO accounting listen forever rm: read=8192, write=0, cancelled_write=0 cvs: read=733184, write=4255744, cancelled_write=4096 make: read=217088, write=0, cancelled_write=0 cc1: read=4263936, write=12288, cancelled_write=0 as: read=811008, write=8192, cancelled_write=0 gcc: read=323584, write=0, cancelled_write=12288 cc1: read=0, write=8192, cancelled_write=0 as: read=4096, write=4096, cancelled_write=0 gcc: read=16384, write=0, cancelled_write=4096 as: read=4096, write=4096, cancelled_write=0 gcc: read=16384, write=0, cancelled_write=8192 ld: read=1011712, write=16384, cancelled_write=0 collect2: read=626688, write=0, cancelled_write=0 gcc: read=204800, write=0, cancelled_write=0 cc1: read=0, write=8192, cancelled_write=0 as: read=4096, write=4096, cancelled_write=0 gcc: read=16384, write=0, cancelled_write=8192 ld: read=8192, write=16384, cancelled_write=0 collect2: read=49152, write=0, cancelled_write=0 gcc: read=0, write=0, cancelled_write=0 cc1: read=0, write=4096, cancelled_write=0 ld: read=4096, write=12288, cancelled_write=0 collect2: read=49152, write=0, cancelled_write=0 gcc: read=0, write=0, cancelled_write=0 To display I/O stats for a particular presently-running task: vmm:/home/akpm> ./getdelays -i -p $(pidof crond) printing IO accounting crond: read=61440, write=0, cancelled_write=0 Cc: Jay Lan <jlan@sgi.com> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Chris Sturtivant <csturtiv@sgi.com> Cc: Tony Ernst <tee@sgi.com> Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net> Cc: David Wright <daw@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-10[PATCH] getdelays: various fixesAndrew Morton1-15/+29
- Various cleanups - Report errors to stderr, not stdout - A printf was missing a \n and was hiding from me. Cc: Jay Lan <jlan@sgi.com> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Chris Sturtivant <csturtiv@sgi.com> Cc: Tony Ernst <tee@sgi.com> Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net> Cc: David Wright <daw@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-03[PATCH] fix Documentation/accounting/getdelays.c buf sizeOleg Nesterov1-1/+1
getdelays reports a "fatal reply error, errno 258". We don't have enough room for multi-threaded exit (PID + TGID). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Jay Lan <jlan@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-01[PATCH] Fix getdelays.c - cpumask length and error reportingBalbir Singh1-3/+4
Fix the length passed while (un)registering cpumask. We were passing sizeof the array, make it strlen(). Error value printed in fatal errors should be derived from the message. The message contains an nlmsgerr embedded with an error value. We must report that value to the user. Signed-off-by: Balbir Singh <balbir@in.ibm.com> Cc: Jamal Hadi <hadi@cyberus.ca> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Thomas Graf <tgraf@suug.ch> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jay Lan <jlan@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-14[PATCH] per task delay accounting taskstats interface: documentation fixShailabh Nagar1-293/+313
Change documentation and example program to reflect the flow control issues being addressed by the cpumask changes. Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-14[PATCH] per-task-delay-accounting: documentationShailabh Nagar1-0/+376
Some documentation for delay accounting. Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com> Signed-off-by: Balbir Singh <balbir@in.ibm.com> Cc: Jes Sorensen <jes@sgi.com> Cc: Peter Chubb <peterc@gelato.unsw.edu.au> Cc: Erich Focht <efocht@ess.nec.de> Cc: Levent Serinol <lserinol@gmail.com> Cc: Jay Lan <jlan@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>