Skip to content

Commit

Permalink
tools: Document use of -I <path> in trace, argdist
Browse files Browse the repository at this point in the history
  • Loading branch information
ShelbyFrances authored and ShelbyFrances committed Feb 13, 2017
1 parent f5dbbdb commit 69abacc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions tools/argdist_example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ optional arguments:
below)
-I header, --include header
additional header files to include in the BPF program
as either full path, or relative to '/usr/include'

Probe specifier syntax:
{p,r,t,u}:{[library],category}:function(signature)[:type[,type...]:expr[,expr...][:filter]][#label]
Expand Down
11 changes: 8 additions & 3 deletions tools/trace_example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Demonstrations of trace.


trace probes functions you specify and displays trace messages if a particular
condition is met. You can control the message format to display function
arguments and return values.
condition is met. You can control the message format to display function
arguments and return values.

For example, suppose you want to trace all commands being exec'd across the
system:
Expand Down Expand Up @@ -174,8 +174,12 @@ PID TID COMM FUNC -
777 785 automount SyS_nanosleep sleep for 500000000 ns
^C

Remember to use the -I argument include the appropriate header file. We didn't
need to do that here because `struct timespec` is used internally by the tool,
so it always includes this header file.

As a final example, let's trace open syscalls for a specific process. By

As a final example, let's trace open syscalls for a specific process. By
default, tracing is system-wide, but the -p switch overrides this:

# trace -p 2740 'do_sys_open "%s", arg2' -T
Expand Down Expand Up @@ -225,6 +229,7 @@ optional arguments:
-U, --user-stack output user stack trace
-I header, --include header
additional header files to include in the BPF program
as either full path, or relative to '/usr/include'

EXAMPLES:

Expand Down

0 comments on commit 69abacc

Please sign in to comment.