From: Josef Weidendorfer Date: Fri, 7 Aug 2009 20:20:41 +0000 (+0000) Subject: callgrind_control: sync manual/man page and script help output. X-Git-Tag: svn/VALGRIND_3_5_0~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa8515687225c52a5766ada9649c05839053b273;p=thirdparty%2Fvalgrind.git callgrind_control: sync manual/man page and script help output. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10750 --- diff --git a/callgrind/callgrind_control.in b/callgrind/callgrind_control.in index f32a75dfb8..02af9afb33 100644 --- a/callgrind/callgrind_control.in +++ b/callgrind/callgrind_control.in @@ -66,7 +66,6 @@ sub getCallgrindPids { sub printHeader { if ($headerPrinted) { return; } $headerPrinted = 1; - if ($beQuiet) { return; } print "Observe the status and control currently active callgrind runs.\n"; print "(C) 2003-2005, Josef Weidendorfer (Josef.Weidendorfer\@gmx.de)\n\n"; @@ -77,6 +76,11 @@ sub printVersion { exit; } +sub shortHelp { + print "See '$0 -h' for help.\n"; + exit; +} + sub printHelp { printHeader; @@ -84,18 +88,17 @@ sub printHelp { print "If no PIDs/Names are given, an action is applied to all currently\n"; print "active Callgrind runs. Default action is printing short information.\n\n"; print "Options:\n"; - print " -h Print this help text\n"; - print " -v Print version\n"; - print " -q Be quiet\n"; - print " -l Print more information\n"; - print " -s Print status information\n"; - print " -b Print backtrace information\n"; - print " -e [A,..] Print event counters for A,.. [default: all]\n"; - print " -d [str] Request a profile dump, include as trigger hint\n"; - print " -z Zero all cost counters\n"; - print " -k Kill\n"; - print " -i on/off Switch instrumentation state on/off\n"; - print " -w Manually specify the working directory of a callgrind run\n"; + print " -h --help Show this help text\n"; + print " -v --version Show version\n"; + print " -l --long Show more information\n"; + print " -s --stat Show statistics\n"; + print " -b --back Show stack/back trace\n"; + print " -e [A, ...] Show event counters for A, ... (default: all)\n"; + print " -d --dump [s] Request a profile dump using as description\n"; + print " -z --zero Zero all event counters\n"; + print " -k --kill Kill\n"; + print " -i [on|off] Switch instrumentation state on/off (default: on)\n"; + print " -w Specify the startup directory of an active callgrind run\n"; print "\n"; exit; } @@ -209,7 +212,6 @@ $requestEvents = 0; $requestDump = 0; $switchInstr = 0; $headerPrinted = 0; -$beQuiet = 0; $dumpHint = ""; $gotW = 0; $workingDir = ""; @@ -223,20 +225,18 @@ foreach $arg (@ARGV) { if ($arg =~ /^-?-h/) { printHelp; } if ($arg =~ /^-?-v/) { printVersion; } - if ($arg =~ /^-q/) { $beQuiet = 1; next; } - if ($arg =~ /^-l/) { $printLong = 1; next; } - if ($arg =~ /^-s/) { $printStatus = 1; next; } - if ($arg =~ /^-b/) { $printBacktrace = 1; next; } - if ($arg =~ /^-d/) { $requestDump = 1; next; } - if ($arg =~ /^-z/) { $requestZero = 1; next; } - if ($arg =~ /^-k/) { $requestKill = 1; next; } + if ($arg =~ /^-?-l/) { $printLong = 1; next; } + if ($arg =~ /^-?-s/) { $printStatus = 1; next; } + if ($arg =~ /^-?-b/) { $printBacktrace = 1; next; } if ($arg =~ /^-e/) { $requestEvents = 1; next; } - if ($arg =~ /^-i/) { $switchInstr = 1; next; } + if ($arg =~ /^-?-d/) { $requestDump = 1; next; } + if ($arg =~ /^-?-z/) { $requestZero = 1; next; } + if ($arg =~ /^-?-k/) { $requestKill = 1; next; } + if ($arg =~ /^-?-i/) { $switchInstr = 1; $switchInstrMode = "+"; next; } if ($arg =~ /^-w/) { $gotW = 1; next; } - printHeader; - print "Unknown option '$arg'.\n\n"; - printHelp; + print "Error: unknown command line option '$arg'.\n"; + shortHelp; } if ($arg =~ /^[A-Za-z_]/) { @@ -255,7 +255,6 @@ foreach $arg (@ARGV) { if ($switchInstr == 1) { $switchInstr = 2; - $switchInstrMode = "+"; if (($arg eq "off") || ($arg eq "no")) { $switchInstrMode = "-"; } @@ -268,7 +267,7 @@ foreach $arg (@ARGV) { $workingDir = $arg; if (!-d $workingDir) { print "Error: directory '$workingDir' does not exist.\n"; - printHelp; + shortHelp; } next; } @@ -283,9 +282,13 @@ foreach $arg (@ARGV) { } if ($nameFound) { next; } - printHeader; - print "Non-existent Callgrind task with PID/Name '$arg'.\n\n"; - printHelp; + print "Error: Callgrind task with PID/name '$arg' not detected.\n"; + shortHelp; +} + +if ($gotW == 1) { + print "Error: no directory specified after -w.\n"; + shortHelp; } if ($workingDir ne "") { diff --git a/callgrind/docs/cl-manual.xml b/callgrind/docs/cl-manual.xml index d4180b3878..a111a1ad7a 100644 --- a/callgrind/docs/cl-manual.xml +++ b/callgrind/docs/cl-manual.xml @@ -1206,69 +1206,116 @@ their arguments. -callgrind_control Options +Description and options of callgrind_control + +The command callgrind_control allows to control + programs being run by the Valgrind tool Callgrind. By default, it acts + on all programs detected to be run by the current user via Callgrind. + It is possible to limit the actions to specified Callgrind runs by + providing a list of pids or program names as argument. + The default action is to give some brief information about the applications + being run by Callgrind. - + - Show summary of options. + Show a short description, usage, and summary of options. - + Show version of callgrind_control. - + - Show statistics. + Show also the working directory, in addition to the brief + information given by default. + - + - Show stack trace. + Show statistics information about active Callgrind runs. - + - Only show figures for events A,B,C. + Show stack/back traces of each thread in active Callgrind runs. For + each active function in the stack trace, also the number of invocations + since program start (or last dump) is shown. This option can be + combined with -e to show inclusive cost of active functions. - + (default: all) - Zero cost counters. + Show the current per-thread, exclusive cost values of event + counters. If no explicit event names are given, figures for all event + types which are collected in the given Callgrind run are + shown. Otherwise, only figures for event types A, B, ... are shown. If + this option is combined with -b, inclusive cost for the functions of + each active stack frame is provided, too. + - + (default: empty description) Request the dumping of profile information. Optionally, a - string can be specified which is written into the dump as part of - the Trigger reason. This can be used to distinguish multiple dumps. + description can be specified which is written into the dump as part of + the information giving the reason which triggered the dump action. This + can be used to distinguish multiple dumps. - + - Kill. + Zero all event counters. + + + + Force a Callgrind run to be terminated. + + + + + (default: on) + + Switch instrumentation mode on or off. If a Callgrind run has + instrumentation disabled, no simulation is done and no events are + counted. This is useful to skip uninteresting program parts, as there + is much less slowdown (same as with the Valgrind tool "none"). See also + the Callgrind option . + + + + + + + Specify the startup directory of an active Callgrind run. On some + systems, active Callgrind runs can not be detected. To be able to + control these, the failed auto-detection can be worked around by + specifying the directory where a Callgrind run was started. + +