Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <denik@chromium.org>
Signed-off-by: James Clark <james.clark@arm.com>
Tested-by: Denis Nikitin <denik@chromium.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20211018134844.2627174-4-james.clark@arm.com
[ Added the perf-inject man page entries for these options, as noted by Denis ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

James Clark and committed by
Arnaldo Carvalho de Melo
b3a018fc 7cc72553

+14
+7
tools/perf/Documentation/perf-inject.txt
··· 45 45 tasks slept. sched_switch contains a callchain where a task slept and 46 46 sched_stat contains a timeslice how long a task slept. 47 47 48 + -k:: 49 + --vmlinux=<file>:: 50 + vmlinux pathname 51 + 52 + --ignore-vmlinux:: 53 + Ignore vmlinux files. 54 + 48 55 --kallsyms=<file>:: 49 56 kallsyms pathname 50 57
+7
tools/perf/builtin-inject.c
··· 940 940 #endif 941 941 OPT_INCR('v', "verbose", &verbose, 942 942 "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"), 943 947 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, "file", 944 948 "kallsyms pathname"), 945 949 OPT_BOOLEAN('f', "force", &data.force, "don't complain, do it"), ··· 977 973 pr_err("--strip option requires --itrace option\n"); 978 974 return -1; 979 975 } 976 + 977 + if (symbol__validate_sym_arguments()) 978 + return -1; 980 979 981 980 if (inject.in_place_update) { 982 981 if (!strcmp(inject.input_name, "-")) {