Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken --filter-trace-tc and --filter-trace-xdp #424

Merged
merged 2 commits into from
Sep 26, 2024

Commits on Sep 25, 2024

  1. Fix broken --filter-trace-tc

    It fails to run with --filter-trace-tc:
    
    ```bash
    2024/09/24 12:59:02 Attaching tc-bpf progs...
    2024/09/24 12:59:02 failed to trace TC progs: failed to trace bpf progs: failed to find address for function entry2 of bpf prog SchedCLS(entry2)cilium#28
    ```
    
    Then, I fix it by matching prog ksym with prog tag.
    
    And avoid `addr - 1` for `--filter-trace-{tc,xdp}`.
    
    ```bash
    2024/09/25 13:57:00 Attaching tc-bpf progs...
    2024/09/25 13:57:00 Attaching kprobes (via kprobe-multi)...
    49 / 49 [--------------------------------------------------------------------------------------------------------------------------------------] 100.00% ? p/s
    2024/09/25 13:57:00 Attached (ignored 0)
    2024/09/25 13:57:00 Listening for events..
    SKB                CPU PROCESS          NETNS      MARK/x        IFACE       PROTO  MTU   LEN   TUPLE FUNC
    0xffff8e151d39be00 6   <empty>:0        4026531840 0            ens33:2      0x0800 1500  98    192.168.241.1:0->192.168.241.133:0(icmp) bpf_prog_e20a685998fd41c8_entry1[bpf](tc)
    0xffff8e151d39a500 6   <empty>:0        4026531840 0            ens33:2      0x0800 1500  98    192.168.241.1:0->192.168.241.133:0(icmp) bpf_prog_e20a685998fd41c8_entry1[bpf](tc)
    0xffff8e151d39bd00 6   <empty>:0        4026531840 0            ens33:2      0x0800 1500  98    192.168.241.1:0->192.168.241.133:0(icmp) bpf_prog_e20a685998fd41c8_entry1[bpf](tc)
    0xffff8e151d39a200 6   <empty>:0        4026531840 0            ens33:2      0x0800 1500  98    192.168.241.1:0->192.168.241.133:0(icmp) bpf_prog_e20a685998fd41c8_entry1[bpf](tc)
    0xffff8e151d39a800 6   <empty>:0        4026531840 0            ens33:2      0x0800 1500  98    192.168.241.1:0->192.168.241.133:0(icmp) bpf_prog_e20a685998fd41c8_entry1[bpf](tc)
    ^C2024/09/25 14:02:16 Received signal, exiting program..
    2024/09/25 14:02:16 Detaching kprobes...
    3 / 3 [---------------------------------------------------------------------------------------------------------------------------------------] 100.00% 50 p/s
    ```
    
    Signed-off-by: Leon Hwang <hffilwlqm@gmail.com>
    Asphaltt committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    140b800 View commit details
    Browse the repository at this point in the history
  2. Fix broken --filter-trace-xdp

    It fails to run with --filter-trace-xdp:
    
    ```bash
    2024/09/24 15:38:48 Attaching xdp progs...
    2024/09/24 15:38:48 failed to trace XDP progs: failed to trace bpf progs: failed to load objects:
    program fexit_xdp: attach Tracing/TraceFExit: fexit xdp not supported
    ```
    
    Signed-off-by: Leon Hwang <hffilwlqm@gmail.com>
    Asphaltt committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    4130fbe View commit details
    Browse the repository at this point in the history