Commit 5fe89aa4 authored by 4ast's avatar 4ast Committed by GitHub

Merge pull request #894 from brendangregg/master

add a few funccount examples
parents d4fc95d9 b6035b6b
...@@ -43,6 +43,7 @@ class Probe(object): ...@@ -43,6 +43,7 @@ class Probe(object):
func -- probe a kernel function func -- probe a kernel function
lib:func -- probe a user-space function in the library 'lib' lib:func -- probe a user-space function in the library 'lib'
/path:func -- probe a user-space function in binary '/path'
p::func -- same thing as 'func' p::func -- same thing as 'func'
p:lib:func -- same thing as 'lib:func' p:lib:func -- same thing as 'lib:func'
t:cat:event -- probe a kernel tracepoint t:cat:event -- probe a kernel tracepoint
...@@ -219,8 +220,11 @@ class Tool(object): ...@@ -219,8 +220,11 @@ class Tool(object):
./funccount -Ti 5 'vfs_*' # output every 5 seconds, with timestamps ./funccount -Ti 5 'vfs_*' # output every 5 seconds, with timestamps
./funccount -p 185 'vfs_*' # count vfs calls for PID 181 only ./funccount -p 185 'vfs_*' # count vfs calls for PID 181 only
./funccount t:sched:sched_fork # count calls to the sched_fork tracepoint ./funccount t:sched:sched_fork # count calls to the sched_fork tracepoint
./funccount -p 185 u:node:gc* # count all GC USDT probes in node ./funccount -p 185 u:node:gc* # count all GC USDT probes in node, PID 185
./funccount c:malloc # count all malloc() calls in libc ./funccount c:malloc # count all malloc() calls in libc
./funccount go:os.* # count all "os.*" calls in libgo
./funccount -p 185 go:os.* # count all "os.*" calls in libgo, PID 185
./funccount ./test:read* # count "read*" calls in the ./test binary
""" """
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="Count functions, tracepoints, and USDT probes", description="Count functions, tracepoints, and USDT probes",
......
...@@ -169,7 +169,7 @@ Ctrl-C has been hit. ...@@ -169,7 +169,7 @@ Ctrl-C has been hit.
User functions can be traced in executables or libraries, and per-process User functions can be traced in executables or libraries, and per-process
filtering is allowed: filtering is allowed:
# ./funccount -p 1442 contentions:* # ./funccount -p 1442 /home/ubuntu/contentions:*
Tracing 15 functions for "/home/ubuntu/contentions:*"... Hit Ctrl-C to end. Tracing 15 functions for "/home/ubuntu/contentions:*"... Hit Ctrl-C to end.
^C ^C
FUNC COUNT FUNC COUNT
...@@ -180,6 +180,10 @@ insert_result 87186 ...@@ -180,6 +180,10 @@ insert_result 87186
is_prime 1252772 is_prime 1252772
Detaching... Detaching...
If /home/ubuntu is in the $PATH, then the following command will also work:
# ./funccount -p 1442 contentions:*
Counting libc write and read calls using regular expression syntax (-r): Counting libc write and read calls using regular expression syntax (-r):
...@@ -314,6 +318,8 @@ examples: ...@@ -314,6 +318,8 @@ examples:
./funccount -Ti 5 'vfs_*' # output every 5 seconds, with timestamps ./funccount -Ti 5 'vfs_*' # output every 5 seconds, with timestamps
./funccount -p 185 'vfs_*' # count vfs calls for PID 181 only ./funccount -p 185 'vfs_*' # count vfs calls for PID 181 only
./funccount t:sched:sched_fork # count calls to the sched_fork tracepoint ./funccount t:sched:sched_fork # count calls to the sched_fork tracepoint
./funccount -p 185 u:node:gc* # count all GC USDT probes in node ./funccount -p 185 u:node:gc* # count all GC USDT probes in node, PID 185
./funccount c:malloc # count all malloc() calls in libc ./funccount c:malloc # count all malloc() calls in libc
./funccount go:os.* # count all "os.*" calls in libgo
./funccount -p 185 go:os.* # count all "os.*" calls in libgo, PID 185
./funccount ./test:read* # count "read*" calls in the ./test binary
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment