Skip to content

perf tools: More updates on data type profiling (v4)

Namhyung Kim linux-perf-users linux-toolchains linux-trace-devel lkml 1 version Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/9perf annotate-data: Parse 'lock' prefix from llvm-objdumptools/perf/util/annotate.c+13 -10 replies
2/9perf annotate-data: Handle macro fusion on x86tools/perf/util/annotate.c+16 -10 replies
3/9perf annotate-data: Handle array style accessestools/perf/util/annotate-data.c tools/perf/util/annotate-data.h tools/perf/util/annotate.c +1 more+61 -190 replies
4/9perf annotate-data: Add stack operation pseudo typetools/perf/util/annotate-data.h tools/perf/util/annotate.c+27 -00 replies
5/9perf annotate-data: Handle PC-relative addressingtools/perf/util/annotate-data.c+38 -180 replies
6/9perf annotate-data: Support global variablestools/perf/util/annotate-data.c tools/perf/util/annotate-data.h tools/perf/util/annotate.c +1 more+92 -130 replies
7/9perf dwarf-aux: Add die_get_cfa()tools/perf/util/dwarf-aux.c tools/perf/util/dwarf-aux.h+82 -10 replies
8/9perf annotate-data: Support stack variablestools/perf/util/annotate-data.c tools/perf/util/dwarf-aux.c tools/perf/util/dwarf-aux.h+93 -240 replies
9/9perf dwarf-aux: Check allowed DWARF Opstools/perf/util/dwarf-aux.c+40 -40 replies

Reviews trailers per patch

1 of 9 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMasami Hiramatsu (Google)Ian Rogers
SeriesR-b
1/9
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCHSET 0/9] perf tools: More updates on data type profiling (v4)

Hello,

This is a continuation of the data type profiling series. Now the basic part (v3) which uses pointer variables is merged to the perf-tools-next tree. And this part is for memory accesses without pointers as well as small updates to handle some corner cases. Still mores to come to complete the original series.

There's no change from the previous version. For background and usages, pleaes refer the posting of previous version [1] and a LWN article [2].

Basically most memory accesses happen with pointers, but there are cases don't use pointers - direct accesses to global and local variables.

Global variables are located in a static memory at a specific address. So the DWARF location expression for the global vairable would also have the static address. And it's common to access them using PC-relative addressing mode. Thus it needs a special handling for global variables.

On the other hand, local variables are located in the stack which varies as program executes. So the local variables are accessed either by the (stack) frame pointer or (current) stack pointer. But sometimes DWARF location expression uses a frame base address (CFA) to specify location of local variables. So it may need to convert or normalize the location extracted from the instruction to match DWARF expression.

Lastly, there are some cases DWARF location expressions end up having complex (or not straight-forward) location. In that case, it cannot simply match just the first expression with the instruction location. It'd be safer to reject them.

The code is available at 'perf/data-profile-update-v4' branch in the tree below. The full version of the code is in 'perf/data-profile-v4' branch.

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Cc Ben Woodard <[email protected]>
Cc Joe Mario <[email protected]>
CC Kees Cook <[email protected]>
Cc David Blaikie <[email protected]>
Cc Xu Liu <[email protected]>
Cc Kan Liang <[email protected]>
Cc Ravi Bangoria <[email protected]>
Cc Mark Wielaard <[email protected]>
Cc Jason Merrill <[email protected]>
Cc Jose E. Marchesi <[email protected]>
Cc William Huang <[email protected]>

[1] https://lore.kernel.org/linux-perf-users/[email protected]/
[2] https://lwn.net/Articles/955709/

Namhyung Kim (9):
perf annotate-data: Parse 'lock' prefix from llvm-objdump perf annotate-data: Handle macro fusion on x86 perf annotate-data: Handle array style accesses perf annotate-data: Add stack operation pseudo type perf annotate-data: Handle PC-relative addressing perf annotate-data: Support global variables perf dwarf-aux: Add die_get_cfa()
perf annotate-data: Support stack variables
perf dwarf-aux: Check allowed DWARF Ops

 tools/perf/util/annotate-data.c | 119 ++++++++++++++++----
 tools/perf/util/annotate-data.h |   8 +-
 tools/perf/util/annotate.c      | 153 ++++++++++++++++++++++++--
 tools/perf/util/annotate.h      |  12 +-
 tools/perf/util/dwarf-aux.c     | 187 ++++++++++++++++++++++++++++----
 tools/perf/util/dwarf-aux.h     |  18 +++
 6 files changed, 439 insertions(+), 58 deletions(-)

base-commit: d988c9f511af71a3445b6a4f3a2c67208ff8e480

Signature · 1 line
2.43.0.381.gb435a96ce8-goog