OSDN Git Service

perf annotate: Allow objdump to be set in perfconfig
authorIan Rogers <irogers@google.com>
Tue, 28 Mar 2023 23:55:42 +0000 (16:55 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 4 Apr 2023 12:39:56 +0000 (09:39 -0300)
Allow the setting of the objdump command in the perfconfig. Update man
page for this new option.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Tom Rix <trix@redhat.com>
Cc: llvm@lists.linux.dev
Link: https://lore.kernel.org/r/20230328235543.1082207-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-config.txt
tools/perf/util/annotate.c

index 39c890e..697f7f9 100644 (file)
@@ -250,7 +250,10 @@ annotate.*::
        These are in control of addresses, jump function, source code
        in lines of assembly code from a specific program.
 
-       annotate.disassembler_style:
+       annotate.objdump::
+               objdump binary to use for disassembly and annotations.
+
+       annotate.disassembler_style::
                Use this to change the default disassembler style to some other value
                supported by binutils, such as "intel", see the '-M' option help in the
                'objdump' man page.
index 08e041a..317c987 100644 (file)
@@ -3211,6 +3211,12 @@ static int annotation__config(const char *var, const char *value, void *data)
                        pr_err("Not enough memory for annotate.disassembler_style\n");
                        return -1;
                }
+       } else if (!strcmp(var, "annotate.objdump")) {
+               opt->objdump_path = strdup(value);
+               if (!opt->objdump_path) {
+                       pr_err("Not enough memory for annotate.objdump\n");
+                       return -1;
+               }
        } else if (!strcmp(var, "annotate.demangle")) {
                symbol_conf.demangle = perf_config_bool("demangle", value);
        } else if (!strcmp(var, "annotate.demangle_kernel")) {