bpf-perf-tools-book icon indicating copy to clipboard operation
bpf-perf-tools-book copied to clipboard

tcpconnect-tp.bt doesn't work in Ubuntu 18.04 w/ 4.19 kernel

Open Obsecurus opened this issue 5 years ago • 1 comments

ubuntu@ip-172-31-18-109:~$ sudo bpftrace tcpconnect-tp.bt 
tcpconnect-tp.bt:30:38-69: ERROR: ntop() expects an integer or array argument, got ctx
        printf("%-15s %-15s %-5d\n", ntop(args->family, args->saddr),
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcpconnect-tp.bt:31:13-44: ERROR: ntop() expects an integer or array argument, got ctx
            ntop(args->family, args->daddr), args->dport)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

environment

ubuntu@ip-172-31-18-109:~$ uname -sr
Linux 4.19.0-041900-generic
ubuntu@ip-172-31-18-109:~$ bpftrace --version
bpftrace v0.9.4-97-gef39

Obsecurus avatar Mar 24 '20 16:03 Obsecurus

This should be fixed in master :). It still emits a warning we should fix but it can be silenced for now:

$ sudo bpftrace_master tcpconnect-tp.bt --no-warnings
Attaching 2 probes...
TIME     PID    COMM             IP  SADDR           DADDR           DPORT
12:54:28 10383  curl             4   10.0.2.15       216.58.208.110  80

fbs avatar Sep 26 '20 12:09 fbs