Rong Bao and Namhyung Kim
a355eefc36
perf annotate: Use jump__delete when freeing LoongArch jumps
...
Currently, the initialization of loongarch_jump_ops does not contain an
assignment to its .free field. This causes disasm_line__free() to fall
through to ins_ops__delete() for LoongArch jump instructions.
ins_ops__delete() will free ins_operands.source.raw and
ins_operands.source.name, and these fields overlaps with
ins_operands.jump.raw_comment and ins_operands.jump.raw_func_start.
Since in loongarch_jump__parse(), these two fields are populated by
strchr()-ing the same buffer, trying to free them will lead to undefined
behavior.
This invalid free usually leads to crashes:
Process 1712902 (perf) of user 1000 dumped core.
Stack trace of thread 1712902:
#0 0x00007fffef155c58 n/a (libc.so.6 + 0x95c58)
#1 0x00007fffef0f7a94 raise (libc.so.6 + 0x37a94)
#2 0x00007fffef0dd6a8 abort (libc.so.6 + 0x1d6a8)
#3 0x00007fffef145490 n/a (libc.so.6 + 0x85490)
#4 0x00007fffef1646f4 n/a (libc.so.6 + 0xa46f4)
#5 0x00007fffef164718 n/a (libc.so.6 + 0xa4718)
#6 0x00005555583a6764 __zfree (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x106764)
#7 0x000055555854fb70 disasm_line__free (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x2afb70)
#8 0x000055555853d618 annotated_source__purge (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x29d618)
#9 0x000055555852300c __hist_entry__tui_annotate (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x28300c)
#10 0x0000555558526718 do_annotate (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x286718)
#11 0x000055555852ed94 evsel__hists_browse (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x28ed94)
#12 0x000055555831fdd0 cmd_report (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x7fdd0)
#13 0x000055555839b644 handle_internal_command (/home/csmantle/dist/linux-arch/tools/perf/perf + 0xfb644)
#14 0x00005555582fe6ac main (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x5e6ac)
#15 0x00007fffef0ddd90 n/a (libc.so.6 + 0x1dd90)
#16 0x00007fffef0ddf0c __libc_start_main (libc.so.6 + 0x1df0c)
#17 0x00005555582fed10 _start (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x5ed10)
ELF object binary architecture: LoongArch
... and it can be confirmed with Valgrind:
==1721834== Invalid free() / delete / delete[] / realloc()
==1721834== at 0x4EA9014: free (in /usr/lib/valgrind/vgpreload_memcheck-loongarch64-linux.so)
==1721834== by 0x4106287: __zfree (zalloc.c:13)
==1721834== by 0x42ADC8F: disasm_line__free (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x429B737: annotated_source__purge (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x42811EB: __hist_entry__tui_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x42848D7: do_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x428CF33: evsel__hists_browse (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== Address 0x7d34303 is 35 bytes inside a block of size 62 alloc'd
==1721834== at 0x4EA59B8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-loongarch64-linux.so)
==1721834== by 0x6B80B6F: strdup (strdup.c:42)
==1721834== by 0x42AD917: disasm_line__new (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x42AE5A3: symbol__disassemble_objdump (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x42AF0A7: symbol__disassemble (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x429B3CF: symbol__annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x429C233: symbol__annotate2 (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x42804D3: __hist_entry__tui_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x42848D7: do_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
==1721834== by 0x428CF33: evsel__hists_browse (in /home/csmantle/dist/linux-arch/tools/perf/perf)
This patch adds the missing free() specialization in loongarch_jump_ops,
which prevents disasm_line__free() from invoking the default cleanup
function.
Fixes: fb7fd2a14a ("perf annotate: Move raw_comment and raw_func_start fields out of 'struct ins_operands'")
Cc: stable@vger.kernel.org
Cc: WANG Rui <wangrui@loongson.cn >
Cc: Huacai Chen <chenhuacai@kernel.org >
Cc: WANG Xuerui <kernel@xen0n.name >
Cc: loongarch@lists.linux.dev
Signed-off-by: Rong Bao <rong.bao@csmantle.top >
Tested-by: WANG Rui <wangrui@loongson.cn >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2026-04-13 23:41:11 -07:00
Arnaldo Carvalho de Melo and Namhyung Kim
fbfb858552
perf tools: Use calloc() where applicable
...
Instead of using zalloc(nr_entries * sizeof_entry) that is what calloc()
does.
In some places where linux/zalloc.h isn't needed, remove it, add when
needed and was getting it indirectly.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2026-04-08 19:21:05 -07:00
Namhyung Kim
54fcc7f6ec
Merge tag 'perf-tools-fixes-for-v7.0-2-2026-03-23' into perf-tools-next
...
To get the various fixes for v7.0.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2026-03-25 00:06:23 -07:00
Ian Rogers and Namhyung Kim
ad2f6258dd
perf disasm: Fix potential use-after-free on fileloc
...
The fileloc is a copy of a pointer to a string but in places like
symbol_disassemble__llvm this string appears to be freed setting up
potential use-after-frees:
llvm.c:
```
dl = disasm_line__new(args);
if (dl == NULL)
goto err;
annotation_line__add(&dl->al, ¬es->src->source);
free(args->fileloc);
```
disasm.c:
```
static void annotation_line__init(struct annotation_line *al,
struct annotate_args *args,
int nr)
{
al->offset = args->offset;
al->line = strdup(args->line);
al->line_nr = args->line_nr;
al->fileloc = args->fileloc;
al->data_nr = nr;
}
struct disasm_line *disasm_line__new(struct annotate_args *args)
{
struct disasm_line *dl = NULL;
struct annotation *notes = symbol__annotation(args->ms->sym);
int nr = notes->src->nr_events;
dl = zalloc(disasm_line_size(nr));
if (!dl)
return NULL;
annotation_line__init(&dl->al, args, nr);
```
Fix this by making the fileloc a copy of the underlying string in its
init/exit.
Signed-off-by: Ian Rogers <irogers@google.com >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2026-03-10 23:17:13 -07:00
Peter Collingbourne and Arnaldo Carvalho de Melo
b3ce769203
perf disasm: Fix off-by-one bug in outside check
...
If a branch target points to one past the end of a function, the branch
should be treated as a branch to another function.
This can happen e.g. with a tail call to a function that is laid out
immediately after the caller.
Fixes: 751b1783da ("perf annotate: Mark jumps to outher functions with the call arrow")
Reviewed-by: Ian Rogers <irogers@google.com >
Signed-off-by: Peter Collingbourne <pcc@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: https://linux-review.googlesource.com/id/Ide471112e82d68177e0faf08ca411d9fcf0a7bdf
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-03-05 16:51:09 -03:00
Arnaldo Carvalho de Melo
23262369e6
perf disasm: Constify variables storing the result of bsearch() on const tables
...
As newer glibcs will propagate the const attribute of the searched table
to its return.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-27 01:44:21 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
4e66527f88
perf thread: Add optional e_flags output argument to thread__e_machine
...
The e_flags are needed to accurately compute complete perf register
information for CSKY.
Add the ability to read and have this value associated with a thread.
This change doesn't wire up the use of the e_flags except in disasm
where use already exists but just wasn't set up yet.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Chun-Tse Shao <ctshao@google.com >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Cc: Swapnil Sapkal <swapnil.sapkal@amd.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-26 18:21:20 -03:00
Suchit Karunakaran and Arnaldo Carvalho de Melo
f0d98c78f8
perf annotate: Fix memcpy size in arch__grow_instructions()
...
The memcpy() in arch__grow_instructions() is copying the wrong number of
bytes when growing from a non-allocated table.
It should copy arch->nr_instructions * sizeof(struct ins) bytes, not
just arch->nr_instructions bytes.
This bug causes data corruption as only a partial copy of the
instruction table is made, leading to garbage data in most entries and
potential crashes
Fixes: 2a1ff812c4 ("perf annotate: Introduce alternative method of keeping instructions table")
Reviewed-by: Ian Rogers <irogers@google.com >
Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:39 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
0e26ba5a87
perf disasm: Refactor arch__find and initialization of arch structs
...
Switch arch__find to using an ELF machine number rather than a
string.
Rather than an array of fixed size arch structs turn the init functions
into new functions indexed by the ELF machine they correspond to.
This allows data to be stored with a struct arch with the container_of
trick, so the priv variable can be removed.
Switch to using the thread to find the arch rather than the evsel as the
evsel only has limited notions of the running thread upon which
disassembly is performed.
Factor out the e_machine and e_flags into their own struct to make them
easier to pass around.
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
[ Include elf.h for EM_CSKY and friends and also conditionally define EM_CSKY_ABIMASK for old distros ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:39 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
c4e3a00356
perf map_symbol: Switch from holding maps to holding thread
...
maps may belong to >1 thread. In contexts like symbolization
information from the thread may be useful, such as the ELF machine.
As the maps can be gained from the thread switch from holding maps in
struct map_symbol to holding the thread.
Holding the maps in addr_location is also redundant, switch this to
using thread__maps.
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:39 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
5301cc6988
perf disasm: Refactor ins__is_call/jump to avoid exposing arch ins_ops
...
Add booleans indicating whether and ins_ops are call or jump and
return it. This avoids exposing loongarch and s390 ins_ops for the
sake of matching.
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:38 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
07b972ff09
perf disasm: Don't include C files from the arch directory
...
Move the arch instructions.c files into appropriately named files in
annotate-arch in the util directory.
Don't #include to compile the code, switch to building the files and fix
up the #includes accordingly.
Move powerpc specific disasm code out of disasm.c and into
annotate-powerpc.c.
Declarations and static removed as appropriate for the code to compile
as separate compilation units.
The e_machine and e_flags set up is moved to the disasm.c architectures
array so that later patches can sort by them.
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:38 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
9273085273
perf disasm: Rework the string arch__is to use the ELF machine
...
Add new arch__is_x86 and arch__is_powerpc functions that avoid string
comparisons and use the ELF machine.
Remove arch__is() that is no longer used.
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:38 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
2a1ca20d0b
perf disasm: Constify use of 'struct ins'
...
The 'struct ins' holds variables that are read but not written, except
during some initialization.
Change most uses to be for a "const struct ins *" version to capture
this immutability.
So the x86__instructions can be const pre-sort it and make the sorted
variable true.
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:38 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
1e3b91d6c5
perf disasm: Constify use of 'struct ins_op'
...
The 'struct ins_op' holds variables to function pointers that are read
but not written. Change uses to be for a "const struct ins_op *"
version to capture this immutability.
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:38 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
57d26593a9
perf disasm: Constify use of 'struct arch'
...
The 'struct arch' holds variables that are read but not written, except
during some initialization.
Change most uses to be for a "const struct arch *" version to capture
this immutability.
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:38 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
00419892ba
perf annotate: Fix args leak of map_symbol
...
map_symbol__exit() needs calling on an annotate_args.ms, however, rather
than introduce proper reference count handling to symbol__annotate()
just switch to passing the map_symbol pointer parameter around, making
the puts the caller's responsibility.
Fix a number of cases to ensure the map in a map_symbol has a
reference count increment and add the then necessary map_symbol_exits.
Fixes: 56e144fe98 ("perf mem_info: Add and use map_symbol__exit and addr_map_symbol__exit")
Reviewed-by: James Clark <james.clark@linaro.org >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: linux-riscv@lists.infradead.org
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zecheng Li <zecheng@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-23 16:58:38 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
fa770f1a9d
perf disasm: Make ins__scnprintf() and ins__is_nop() static
...
Reduce the scope of ins__scnprintf() and ins__is_nop() that aren't used
outside of disasm.c.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alexghiti@rivosinc.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Charlie Jenkins <charlie@rivosinc.com >
Cc: Collin Funk <collin.funk1@gmail.com >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Eric Biggers <ebiggers@kernel.org >
Cc: Haibo Xu <haibo1.xu@intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Li Huafei <lihuafei1@huawei.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Song Liu <song@kernel.org >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-10-06 16:35:29 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
aa04707f50
perf dso: Support BPF programs in dso__read_symbol()
...
Set the buffer to the code in the BPF linear info. This enables BPF
JIT code disassembly by LLVM and capstone.
Move the common but minimal disassmble_bpf_image call to
disassemble_objdump so that it is only called after falling back to the
objdump option.
Similarly move the disassmble_bpf function to disassemble_objdump and
rename to disassmble_bpf_libbfd to make it clearer that this support
relies on libbfd.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alexghiti@rivosinc.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Charlie Jenkins <charlie@rivosinc.com >
Cc: Collin Funk <collin.funk1@gmail.com >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Eric Biggers <ebiggers@kernel.org >
Cc: Haibo Xu <haibo1.xu@intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Li Huafei <lihuafei1@huawei.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Song Liu <song@kernel.org >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-10-06 16:35:28 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
95931d9a59
perf libbfd: Move libbfd functionality to its own file
...
Move symbolization and srcline libbfd dependencies to a separate
libbfd.c. This mirrors moving llvm and capstone code. While this code
is deprecated as it is part of BUILD_NONDISTRO license incompatible
code, moving the code to its own file minimizes disruption in the main
files.
disasm_bpf.c is moved to libbfd.c also except for
symbol__disassemble_bpf_image which is currently more of a placeholder
function rather than something that provides disassembly support.
demangle-cxx.cpp code isn't migrated as it is very limited.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alexghiti@rivosinc.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Charlie Jenkins <charlie@rivosinc.com >
Cc: Collin Funk <collin.funk1@gmail.com >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Eric Biggers <ebiggers@kernel.org >
Cc: Haibo Xu <haibo1.xu@intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Li Huafei <lihuafei1@huawei.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Song Liu <song@kernel.org >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-10-02 15:39:44 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
d9007afca0
perf llvm: Move llvm functionality into its own file
...
LLVM disassembly support was in disasm.c and addr2line support in
srcline.c. Move support out of these files into llvm.[ch] and remove
LLVM includes from those files. As disassembly routines can fail, make
failure the only option without HAVE_LIBLLVM_SUPPORT. For simplicity's
sake, duplicate the read_symbol utility function.
The intent with moving LLVM support into a single file is that dynamic
support, using dlopen for libllvm, can be added in later patches. This
can potentially always succeed or fail, so relying on ifdefs isn't
sufficient. Using dlopen is a useful option to minimize the perf tools
dependencies and potentially size.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alexghiti@rivosinc.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Charlie Jenkins <charlie@rivosinc.com >
Cc: Collin Funk <collin.funk1@gmail.com >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Eric Biggers <ebiggers@kernel.org >
Cc: Haibo Xu <haibo1.xu@intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Li Huafei <lihuafei1@huawei.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Song Liu <song@kernel.org >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-10-02 15:38:23 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
bbb99668b5
perf capstone: Move capstone functionality into its own file
...
Capstone disassembly support was split between disasm.c and
print_insn.c. Move support out of these files into capstone.[ch] and
remove include capstone/capstone.h from those files. As disassembly
routines can fail, make failure the only option without
HAVE_LIBCAPSTONE_SUPPORT. For simplicity's sake, duplicate the
read_symbol utility function.
The intent with moving capstone support into a single file is that
dynamic support, using dlopen for libcapstone, can be added in later
patches. This can potentially always succeed or fail, so relying on
ifdefs isn't sufficient. Using dlopen is a useful option to minimize
the perf tools dependencies and potentially size.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alexghiti@rivosinc.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Charlie Jenkins <charlie@rivosinc.com >
Cc: Collin Funk <collin.funk1@gmail.com >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Eric Biggers <ebiggers@kernel.org >
Cc: Haibo Xu <haibo1.xu@intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Li Huafei <lihuafei1@huawei.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Song Liu <song@kernel.org >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-10-02 15:36:59 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
78d853512d
perf disasm: Avoid undefined behavior in incrementing NULL
...
Incrementing NULL is undefined behavior and triggers ubsan during the
perf annotate test.
Split a compound statement over two lines to avoid this.
Fixes: 98f69a573c ("perf annotate: Split out util/disasm.c")
Reviewed-by: Collin Funk <collin.funk1@gmail.com >
Reviewed-by: James Clark <james.clark@linaro.org >
Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com >
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Blake Jones <blakejones@google.com >
Cc: Chun-Tse Shao <ctshao@google.com >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jan Polensky <japo@linux.ibm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Li Huafei <lihuafei1@huawei.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Nam Cao <namcao@linutronix.de >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Steinar H. Gunderson <sesse@google.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Link: https://lore.kernel.org/r/20250821163820.1132977-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-09-03 12:34:54 -03:00
Ian Rogers and Namhyung Kim
fccaaf6fbb
perf build-id: Change sprintf functions to snprintf
...
Pass in a size argument rather than implying all build id strings must
be SBUILD_ID_SIZE.
Signed-off-by: Ian Rogers <irogers@google.com >
Link: https://lore.kernel.org/r/20250724163302.596743-4-irogers@google.com
[ fixed some build errors ]
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2025-07-25 10:37:13 -07:00
Namhyung Kim
e201757f7a
perf annotate: Fix source code annotate with objdump
...
Recently it uses llvm and capstone to speed up annotation or disassembly
of instructions. But they don't support source code view yet. Until it
fixed, we can force to use objdump for source code annotation.
To prevent performance loss, it's disabled by default and turned it on
when user requests it in TUI by pressing 's' key.
Acked-by: Ian Rogers <irogers@google.com >
Link: https://lore.kernel.org/r/20250625230339.702610-1-namhyung@kernel.org
Reported-by: Ingo Molnar <mingo@kernel.org >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2025-06-26 15:15:48 -07:00