Skip to content

Commit

Permalink
free up -c for something else
Browse files Browse the repository at this point in the history
  • Loading branch information
brendangregg committed Aug 2, 2014
1 parent dc9d7c1 commit f1a0a88
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions examples/funcgraph_example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1620,10 +1620,10 @@ by completing a 19 second read (time between commands), then has a series of
The function times printed are inclusive of their children.


The -c option will print on-CPU times only, excluding sleeping or blocking
The -C option will print on-CPU times only, excluding sleeping or blocking
events from the function duration times. Eg:

# ./funcgraph -ctp 25285 vfs_read
# ./funcgraph -Ctp 25285 vfs_read
Tracing "vfs_read" for PID 25285... Ctrl-C to end.
7338520.591816 | 0) | finish_task_switch() {
7338520.591820 | 0) | xen_evtchn_do_upcall() {
Expand Down Expand Up @@ -2155,9 +2155,9 @@ performance investigation.
Use -h to print the USAGE message:

# ./funcgraph -h
USAGE: funcgraph [-acDhHPtT] [-m maxdepth] [-p PID] [-d secs] funcstring
USAGE: funcgraph [-aCDhHPtT] [-m maxdepth] [-p PID] [-d secs] funcstring
-a # all info (same as -HPt)
-c # measure on-CPU time only
-C # measure on-CPU time only
-d seconds # trace duration, and use buffers
-D # do not show function duration
-h # this usage message
Expand Down
6 changes: 3 additions & 3 deletions examples/funcslower_example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ earlier output, this tells me that the latency in this function is due to time
spent blocked off-CPU, and not on-CPU. This makes sense: this function is
ultimately being blocked on disk I/O.

Were the function duration times to be similar with and without -c, that would
Were the function duration times to be similar with and without -C, that would
tell us that the high latency is due to time spent on-CPU executing code.


Expand Down Expand Up @@ -94,9 +94,9 @@ switch on the given CPU.
Use -h to print the USAGE message:

# ./funcslower -h
USAGE: funcslower [-achHPt] [-p PID] [-d secs] funcstring latency_us
USAGE: funcslower [-aChHPt] [-p PID] [-d secs] funcstring latency_us
-a # all info (same as -HPt)
-c # measure on-CPU time only
-C # measure on-CPU time only
-d seconds # trace duration, and use buffers
-h # this usage message
-H # include column headers
Expand Down
12 changes: 6 additions & 6 deletions kernel/funcgraph
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# using other, lower overhead tools. This is a proof of concept using Linux
# ftrace capabilities on older kernels.
#
# USAGE: funcgraph [-acDhHPtT] [-m maxdepth] [-p PID] [-d secs] funcstring
# USAGE: funcgraph [-aCDhHPtT] [-m maxdepth] [-p PID] [-d secs] funcstring
#
# Run "funcgraph -h" for full usage.
#
Expand Down Expand Up @@ -75,9 +75,9 @@ trap ':' INT QUIT TERM PIPE HUP # sends execution to end tracing section

function usage {
cat <<-END >&2
USAGE: funcgraph [-acDhHPtT] [-m maxdepth] [-p PID] [-d secs] funcstring
USAGE: funcgraph [-aCDhHPtT] [-m maxdepth] [-p PID] [-d secs] funcstring
-a # all info (same as -HPt)
-c # measure on-CPU time only
-C # measure on-CPU time only
-d seconds # trace duration, and use buffers
-D # do not show function duration
-h # this usage message
Expand Down Expand Up @@ -140,11 +140,11 @@ function edie {
}

### process options
while getopts acd:DhHm:p:PtT opt
while getopts aCd:DhHm:p:PtT opt
do
case $opt in
a) opt_headers=1; opt_proc=1; opt_time=1 ;;
c) opt_cpu=1; ;;
C) opt_cpu=1; ;;
d) opt_duration=1; duration=$OPTARG ;;
D) opt_nodur=1; ;;
m) opt_max=1; max=$OPTARG ;;
Expand Down Expand Up @@ -202,7 +202,7 @@ if ! echo function_graph > current_tracer; then
fi
if (( opt_cpu )); then
if ! echo nosleep-time > trace_options; then
edie "ERROR: setting -c (nosleep-time). Exiting."
edie "ERROR: setting -C (nosleep-time). Exiting."
fi
fi
# the following must be done after setting current_tracer
Expand Down
12 changes: 6 additions & 6 deletions kernel/funcslower
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# and filter them based on a latency threshold. This is a proof of concept using
# Linux ftrace capabilities on older kernels.
#
# USAGE: funcslower [-achHPt] [-p PID] [-d secs] funcstring latency_us
# USAGE: funcslower [-aChHPt] [-p PID] [-d secs] funcstring latency_us
#
# Run "funcslower -h" for full usage.
#
Expand Down Expand Up @@ -59,9 +59,9 @@ trap ':' INT QUIT TERM PIPE HUP # sends execution to end tracing section

function usage {
cat <<-END >&2
USAGE: funcslower [-achHPt] [-p PID] [-d secs] funcstring latency_us
USAGE: funcslower [-aChHPt] [-p PID] [-d secs] funcstring latency_us
-a # all info (same as -HPt)
-c # measure on-CPU time only
-C # measure on-CPU time only
-d seconds # trace duration, and use buffers
-h # this usage message
-H # include column headers
Expand Down Expand Up @@ -116,11 +116,11 @@ function edie {
}

### process options
while getopts acd:hHp:Pt opt
while getopts aCd:hHp:Pt opt
do
case $opt in
a) opt_headers=1; opt_proc=1; opt_time=1 ;;
c) opt_cpu=1; ;;
C) opt_cpu=1; ;;
d) opt_duration=1; duration=$OPTARG ;;
p) opt_pid=1; pid=$OPTARG ;;
H) opt_headers=1; ;;
Expand Down Expand Up @@ -190,7 +190,7 @@ if ! echo function_graph > current_tracer; then
fi
if (( opt_cpu )); then
if ! echo nosleep-time > trace_options; then
edie "ERROR: setting -c (nosleep-time). Exiting."
edie "ERROR: setting -C (nosleep-time). Exiting."
fi
fi
# the following must be done after setting current_tracer
Expand Down
6 changes: 3 additions & 3 deletions man/man8/funcgraph.8
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
funcgraph \- trace kernel function graph, showing child function calls and times. Uses Linux ftrace.
.SH SYNOPSIS
.B funcgraph
[\-acDhHPtT] [\-m maxdepth] [\-p PID] [\-d secs] funcstring
[\-aCDhHPtT] [\-m maxdepth] [\-p PID] [\-d secs] funcstring
.SH DESCRIPTION
This is an exploratory tool that shows the graph of child function calls
for a given kernel function. This can cost moderate overhead to execute, and
Expand Down Expand Up @@ -38,7 +38,7 @@ kernels.
\-a
All info. Same as \-HPt. (But no -T, which isn't available in older kernels.)
.TP
\-c
\-C
Function durations measure on-CPU time only (exclude sleep time).
.TP
\-d seconds
Expand Down Expand Up @@ -120,7 +120,7 @@ TASK/PID
.TP
DURATION
Elapsed time during the function call, inclusive of children. This is also
inclusive of sleep time, unless -c is used. The time is either displayed on
inclusive of sleep time, unless -C is used. The time is either displayed on
the return of a function ("}"), or for a leaf function (no children), on the
same line.

Expand Down
6 changes: 3 additions & 3 deletions man/man8/funcslower.8
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
funcslower \- trace kernel functions slower than a threshold (microseconds). Uses Linux ftrace.
.SH SYNOPSIS
.B funcslower
[\-achHPt] [\-p PID] [\-d secs] funcstring latency_us
[\-aChHPt] [\-p PID] [\-d secs] funcstring latency_us
.SH DESCRIPTION
This uses the Linux ftrace function graph profiler to time kernel functions
and filter them based on a latency threshold. Latency outliers can be studied
Expand All @@ -28,7 +28,7 @@ recent kernels. And awk.
\-a
All info. Same as \-HPt.
.TP
\-c
\-C
Function durations measure on-CPU time only (exclude sleep time).
.TP
\-d seconds
Expand Down Expand Up @@ -95,7 +95,7 @@ TASK/PID
.TP
DURATION
Elapsed time during the function call, inclusive of children. This is also
inclusive of sleep time, unless -c is used.
inclusive of sleep time, unless -C is used.
.TP
FUNCTION CALLS
Kernel function returns.
Expand Down

0 comments on commit f1a0a88

Please sign in to comment.