Skip to content

perf tools: add support for reading object code

Adrian Hunter lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest13 patches 1 replyIn review
  2. v310 patches 2 repliesSuperseded
  3. v29 patches 11 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v19 patches11 repliesSuperseded

Changes in v4 from the cover letter

perf tools: make it possible to read object code from kernel modules
Fix symbol adjustment for kernel modules
Remove kallsyms' symbols when using a module's symbols
perf tools: add kcore to the object code reading test
Do not use static variables
perf tools: put dso name in symbol annotation title
New patch
perf tools: remove nop at end of annotation
New patch
perf tools: add annotation call target name if it is missing
New Patch

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13perf tools: add test for reading object codetools/perf/Makefile tools/perf/tests/builtin-test.c tools/perf/tests/code-reading.c +1 more+515 -00 replies
2/13perf tools: load kernel maps before usingtools/perf/builtin-inject.c tools/perf/builtin-script.c tools/perf/tests/code-reading.c +4 more+22 -120 replies
3/13perf tools: make it possible to read object code from vmlinuxtools/perf/util/dso.c tools/perf/util/dso.h tools/perf/util/machine.c +3 more+112 -610 replies
4/13perf tools: adjust the vmlinux symtab matches kallsyms testtools/perf/tests/vmlinux-kallsyms.c+21 -110 replies
5/13perf tools: avoid SyS kernel syscall aliasestools/perf/util/symbol.c+14 -30 replies
6/13perf tools: make it possible to read object code from kernel modulestools/perf/util/dso.c tools/perf/util/dso.h tools/perf/util/map.c +2 more+43 -90 replies
7/13perf tools: add support for reading from /proc/kcoretools/perf/util/dso.c tools/perf/util/dso.h tools/perf/util/machine.c +6 more+347 -32 replies
8/13perf tools: adjust the vmlinux symtab matches kallsyms test againtools/perf/tests/vmlinux-kallsyms.c+7 -50 replies
9/13perf tools: add kcore to the object code reading testtools/perf/tests/code-reading.c+82 -180 replies
10/13perf tools: allow annotation using /proc/kcoretools/perf/builtin-top.c tools/perf/util/annotate.c+11 -50 replies
11/13perf tools: put dso name in symbol annotation titletools/perf/ui/browsers/annotate.c+14 -20 replies
12/13perf tools: remove nop at end of annotationtools/perf/util/annotate.c+31 -00 replies
13/13perf tools: add annotation call target name if it is missingtools/perf/util/annotate.c+16 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH V4 00/13] perf tools: add support for reading object code

Hi

Here are some patches that add support for reading object code from vmlinux, kernel modules and /proc/kcore.

Changes in V4:
perf tools: make it possible to read object code from kernel modules
Fix symbol adjustment for kernel modules
Remove kallsyms' symbols when using a module's symbols
perf tools: add kcore to the object code reading test
Do not use static variables
perf tools: put dso name in symbol annotation title
New patch
perf tools: remove nop at end of annotation
New patch
perf tools: add annotation call target name if it is missing
New Patch

Changes in V3:
perf tools: adjust the vmlinux symtab matches kallsyms test again
New patch
perf tools: add test for reading object code
Fix error path by removing unnecessary perf_evlist__disable() Fix error path by setting evlist to NULL after deletion Fix sampling frequency by changing from 40000 to 4000 Increase the number of operations performed by the "workload" to compensate for the lower sampling frequency

Changes in V2:
Re-based on Arnaldo's tree's perf/core branch

perf tools: add test for reading object code
Use strchr in read_objdump_line()
Remove unused return value of read_objdump_line() Fix double space before "cycles:u"
Add missing perf_evlist__delete(evlist) in do_test_code_reading()
perf tools: load kernel maps before using
Correct spelling of "initialization" in commit message
perf tools: add support for reading from /proc/kcore
Do not test kallsyms filename for host buildid because /proc/kallsyms is always used if the dso buildid matches the host
perf tools: add kcore to the object code reading test
Remove redundant "else if (!have_kcore && try_kcore)" clause

Adrian Hunter (13):
perf tools: add test for reading object code
perf tools: load kernel maps before using
perf tools: make it possible to read object code from vmlinux perf tools: adjust the vmlinux symtab matches kallsyms test perf tools: avoid SyS kernel syscall aliases
perf tools: make it possible to read object code from kernel modules perf tools: add support for reading from /proc/kcore perf tools: adjust the vmlinux symtab matches kallsyms test again perf tools: add kcore to the object code reading test perf tools: allow annotation using /proc/kcore
perf tools: put dso name in symbol annotation title
perf tools: remove nop at end of annotation
perf tools: add annotation call target name if it is missing

 tools/perf/Makefile                 |   1 +
 tools/perf/builtin-inject.c         |   2 +-
 tools/perf/builtin-script.c         |   4 +-
 tools/perf/builtin-top.c            |   3 +-
 tools/perf/tests/builtin-test.c     |   4 +
 tools/perf/tests/code-reading.c     | 573 ++++++++++++++++++++++++++++++++++++
 tools/perf/tests/tests.h            |   1 +
 tools/perf/tests/vmlinux-kallsyms.c |  36 ++-
 tools/perf/ui/browsers/annotate.c   |  16 +-
 tools/perf/util/annotate.c          |  60 +++-
 tools/perf/util/build-id.c          |   2 +-
 tools/perf/util/dso.c               |  10 +-
 tools/perf/util/dso.h               |  17 ++
 tools/perf/util/event.c             |  18 +-
 tools/perf/util/machine.c           |  20 +-
 tools/perf/util/map.c               |  67 ++---
 tools/perf/util/map.h               |  13 +
 tools/perf/util/symbol-elf.c        | 174 ++++++++++-
 tools/perf/util/symbol-minimal.c    |   7 +
 tools/perf/util/symbol.c            | 273 +++++++++++++++--
 tools/perf/util/symbol.h            |   5 +
 tools/perf/util/thread.h            |   2 +-
 tools/perf/util/unwind.c            |   4 +-
 23 files changed, 1209 insertions(+), 103 deletions(-)
 create mode 100644 tools/perf/tests/code-reading.c

Regards
Adrian