Skip to content

Commit

Permalink
man: document tracepoint provider
Browse files Browse the repository at this point in the history
  • Loading branch information
wkz committed Nov 1, 2018
1 parent 80ebc43 commit 2bdb36b
Showing 1 changed file with 65 additions and 2 deletions.
67 changes: 65 additions & 2 deletions man/ply.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ Data can be stored in a map by assigning a value to a given key:

mapname[exprs] = expr

If a map key is assigned the special value _nil_, the key is deleted
and will return its zero value if referenced again.
The _delete_ keyword can be used to remove an association from a map:

delete mapname[exprs]


### Aggregations
Expand Down Expand Up @@ -262,6 +263,68 @@ _kretprobe_ specific function:
Return value of the probed function.


### tracepoint

The tracepoint provider can instrument all stable tracepoints in the
kernel. They are identified by their relative path from the
`/sys/kernel/debug/tracing/events` directory, where each leaf
directory corresponds to a tracepoint.

Examples:

* _tracepoint:sched/sched_wakeup_: Trace every time a process is
awoken.
* _tracepoint:irq/irq_handler_entry_: Trace every time an interrupt
is handled.

Variables:

* `struct <X> *data`:

A struct is dynamically generated for each tracepoint by parsing
its `format` file. I.e. if the contents of the format file looks
like the following:

```
name: tcp_send_reset
ID: 1304
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;
field:const void * skbaddr; offset:8; size:8; signed:0;
field:const void * skaddr; offset:16; size:8; signed:0;
field:__u16 sport; offset:24; size:2; signed:0;
field:__u16 dport; offset:26; size:2; signed:0;
field:__u8 saddr[4]; offset:28; size:4; signed:0;
field:__u8 daddr[4]; offset:32; size:4; signed:0;
field:__u8 saddr_v6[16]; offset:36; size:16; signed:0;
field:__u8 daddr_v6[16]; offset:52; size:16; signed:0;
```

Then `data` would point to a struct of the following type:

```
struct data {
unsigned short common_type;
unsigned char common_flags;
unsigned char common_preempt_count;
int common_pid;
const void * skbaddr;
const void * skaddr;
__u16 sport;
__u16 dport;
__u8 saddr[4];
__u8 daddr[4];
__u8 saddr_v6[16];
__u8 daddr_v6[16];
};
```

## EXAMPLE

### Extracting data
Expand Down

0 comments on commit 2bdb36b

Please sign in to comment.