diff options
| author | Sandipan Das <sandipan@linux.vnet.ibm.com> | 2018-05-24 09:56:51 +0300 | 
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-05-24 10:20:49 +0300 | 
| commit | 4d56a76ead2fcd856e677cdc9445ad331a409b8c (patch) | |
| tree | 9b8b3e6d662723418d65bb23012bfdba33e3d7c7 /tools/perf/scripts/python/sctop.py | |
| parent | f84192ee00b7d8b3c38545d3a61d4191f80cc81a (diff) | |
| download | linux-4d56a76ead2fcd856e677cdc9445ad331a409b8c.tar.xz | |
bpf: fix multi-function JITed dump obtained via syscall
Currently, for multi-function programs, we cannot get the JITed
instructions using the bpf system call's BPF_OBJ_GET_INFO_BY_FD
command. Because of this, userspace tools such as bpftool fail
to identify a multi-function program as being JITed or not.
With the JIT enabled and the test program running, this can be
verified as follows:
  # cat /proc/sys/net/core/bpf_jit_enable
  1
Before applying this patch:
  # bpftool prog list
  1: kprobe  name foo  tag b811aab41a39ad3d  gpl
          loaded_at 2018-05-16T11:43:38+0530  uid 0
          xlated 216B  not jited  memlock 65536B
  ...
  # bpftool prog dump jited id 1
  no instructions returned
After applying this patch:
  # bpftool prog list
  1: kprobe  name foo  tag b811aab41a39ad3d  gpl
          loaded_at 2018-05-16T12:13:01+0530  uid 0
          xlated 216B  jited 308B  memlock 65536B
  ...
  # bpftool prog dump jited id 1
     0:   nop
     4:   nop
     8:   mflr    r0
     c:   std     r0,16(r1)
    10:   stdu    r1,-112(r1)
    14:   std     r31,104(r1)
    18:   addi    r31,r1,48
    1c:   li      r3,10
  ...
Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/perf/scripts/python/sctop.py')
0 files changed, 0 insertions, 0 deletions
