Skip to content

Commit b3a018f

Browse files
James-A-Clarkacmel
authored andcommitted
perf inject: Add vmlinux and ignore-vmlinux arguments
Other perf tools allow specifying the path to vmlinux. 'perf inject' didn't have this argument which made some auxtrace workflows difficult. Also add --ignore-vmlinux for consistency with other tools. Suggested-by: Denis Nikitin <[email protected]> Signed-off-by: James Clark <[email protected]> Tested-by: Denis Nikitin <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Added the perf-inject man page entries for these options, as noted by Denis ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 7cc7255 commit b3a018f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tools/perf/Documentation/perf-inject.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ OPTIONS
4545
tasks slept. sched_switch contains a callchain where a task slept and
4646
sched_stat contains a timeslice how long a task slept.
4747

48+
-k::
49+
--vmlinux=<file>::
50+
vmlinux pathname
51+
52+
--ignore-vmlinux::
53+
Ignore vmlinux files.
54+
4855
--kallsyms=<file>::
4956
kallsyms pathname
5057

tools/perf/builtin-inject.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,10 @@ int cmd_inject(int argc, const char **argv)
940940
#endif
941941
OPT_INCR('v', "verbose", &verbose,
942942
"be more verbose (show build ids, etc)"),
943+
OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
944+
"file", "vmlinux pathname"),
945+
OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux,
946+
"don't load vmlinux even if found"),
943947
OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, "file",
944948
"kallsyms pathname"),
945949
OPT_BOOLEAN('f', "force", &data.force, "don't complain, do it"),
@@ -974,6 +978,9 @@ int cmd_inject(int argc, const char **argv)
974978
return -1;
975979
}
976980

981+
if (symbol__validate_sym_arguments())
982+
return -1;
983+
977984
if (inject.in_place_update) {
978985
if (!strcmp(inject.input_name, "-")) {
979986
pr_err("Input file name required for in-place updating\n");

0 commit comments

Comments
 (0)