Re: BPF runtime for systemtap

From: Frank Ch. Eigler
Date: Tue Jun 14 2016 - 21:50:34 EST



brendan.d.gregg wrote:

> [...]
> Great! Is there a hello world example in there somewhere? I found this:
> [...]

Yup. Here is a smoke test. (A great many other things are not yet
working.)

% sudo ./stap -v --runtime=bpf -e 'global foo
probe kprobe.function("vfs_read"), kprobe.function("do_select") { foo++ }
probe begin { printf("systemtap starting probe\n") }
probe end { printf("systemtap ending probe\n"); printf("foo = %d\n", foo) }'

Pass 1: parsed user script and 35 library scripts using 198460virt/15804res/6416shr/9208data kb, in 0usr/0sys/71real ms.
Pass 2: analyzed script: 4 probes, 0 functions, 0 embeds, 1 global using 198460virt/15804res/6416shr/9208data kb, in 0usr/0sys/0real ms.
Pass 4: compiled BPF into "stap_32349.bo" in 0usr/0sys/0real ms.
Pass 5: starting run.
systemtap starting probe
^Csystemtap ending probe
foo = 108812
Pass 5: run completed in 0usr/10sys/2525real ms.