brendangregg / bpf-perf-tools-book

Official repository for the BPF Performance Tools book
1.61k stars 284 forks source link

ttysnoop.bt does not run properly #12

Open gtataranni opened 4 years ago

gtataranni commented 4 years ago

When run as bpftrace ttysnoop.bt pts2 it returns

$1 used numerically, but given "pts2". Try using str($1).

I have tried to look into str($1 + 3) with printf("arg+3 is %s\n", str($1 + 3)); with an exit right after. I wasn't able unfortunately to get my argument string as expected, or the argument from the 3rd char on, I would only get arg+3 is. Interestingly, the BCC counterpart works