The 'bpftool' sub-commands (prog list or prog show id) shows truncated BPF program name

Solution In Progress - Updated -

Issue

  • The 'bpftool' sub-commands (prog list or prog show id) shows truncated BPF program name
# bpftool prog list | tail -n 8
267: kprobe  name __blk_account_i  tag 1e982cb7ead83e56  gpl
                  ^^^^^^^^^^^^^^^
        loaded_at 2022-06-14T03:23:49-0400  uid 0
        xlated 712B  jited 439B  memlock 4096B  map_ids 95,96
        pids biolatency.bt(309908)
268: kprobe  name __blk_account_i  tag aa1489189b0a912d  gpl
                  ^^^^^^^^^^^^^^^  
      loaded_at 2022-06-14T03:23:49-0400  uid 0
        xlated 120B  jited 75B  memlock 4096B  map_ids 95
        pids biolatency.bt(309908)

# bpftool prog show id 267
267: kprobe  name __blk_account_i  tag 1e982cb7ead83e56  gpl
                  ^^^^^^^^^^^^^^^  
        loaded_at 2022-06-14T03:23:49-0400  uid 0
        xlated 712B  jited 439B  memlock 4096B  map_ids 95,96
        pids biolatency.bt(309908)

# bpftool prog show id 268
268: kprobe  name __blk_account_i  tag aa1489189b0a912d  gpl
                  ^^^^^^^^^^^^^^^
        loaded_at 2022-06-14T03:23:49-0400  uid 0
        xlated 120B  jited 75B  memlock 4096B  map_ids 95
        pids biolatency.bt(309908)
  • The size of 'bpf_prog_info.name[BPF_OBJ_NAME_LEN]' & 'bpf_prog_aux.name[BPF_OBJ_NAME_LEN]' are limited to 16 chars
    which leads to truncated names since many BPF program have a much longer name.

crash> struct bpf_prog_info.name -ox struct bpf_prog_info { [0x40] char name[16]; } crash> struct bpf_prog_aux.name -ox struct bpf_prog_aux { [0x210] char name[16]; }
  • The actual kprobe kernel functions are __blk_account_io_start and __blk_account_io_done in RHEL9 .

  • The actual kprobe kernel functions are "blk_account_io_start" and "blk_account_io_done" in RHEL 8.

crash> kprobe_table | grep 0xff | awk '{print "kprobe.symbol_name,pre_handler " $NF}' > kprobe

RHEL 9 :
crash> < kprobe | grep -v crash | paste - - | cat -n | column -t
1  symbol_name  =  0xffff8aa34409ff40  "__blk_account_io_start",  pre_handler  =  0xffffffff9c82b9e0  <kprobe_dispatcher>,
2  symbol_name  =  0xffff8aa34409fda0  "__blk_account_io_done",   pre_handler  =  0xffffffff9c82b9e0  <kprobe_dispatcher>,

RHEL 8 :

crash> < kprobe | grep -v crash | paste - - | cat -n | column -t
1  symbol_name  =  0xffff92f2173d41c0  "blk_account_io_done"   pre_handler  =  0xffffffff9001bec0
2  symbol_name  =  0xffff92f2173d44c0  "blk_account_io_start"  pre_handler  =  0xffffffff9001bec0

Environment

  • Red Hat Enterprise Linux release 8
  • Red Hat Enterprise Linux release 9
  • bpftool

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content