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

perf probe: Ignore vmlinux Build-id when offline vmlinux given

Ignore vmlinux build-id when user gives offline vmlinux if the command
does not affect running kernel.

perf-probe has several actions some of them does not change the running
kernel, like --lines, --vars, and --funcs.

e.g.
-----
$ ./perf probe -k ./vmlinux-arm -V do_sys_open:14
Available variables at do_sys_open:14
@<do_sys_open+202>
char* filename
int dfd
int fd
int flags
struct filename* tmp
struct open_flags op
umode_t mode
-----

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/147222347320.5088.2582658035296667520.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Masami Hiramatsu and committed by
Arnaldo Carvalho de Melo
e50243bb 293d5b43

+8 -7
+8 -7
tools/perf/builtin-probe.c
··· 611 611 */ 612 612 symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL); 613 613 614 + /* 615 + * Except for --list, --del and --add, other command doesn't depend 616 + * nor change running kernel. So if user gives offline vmlinux, 617 + * ignore its buildid. 618 + */ 619 + if (!strchr("lda", params.command) && symbol_conf.vmlinux_name) 620 + symbol_conf.ignore_vmlinux_buildid = true; 621 + 614 622 switch (params.command) { 615 623 case 'l': 616 624 if (params.uprobes) { ··· 663 655 } 664 656 break; 665 657 case 'D': 666 - /* 667 - * If user gives offline vmlinux, ignore buildid, since 668 - * --definition doesn't change running kernel. 669 - */ 670 - if (symbol_conf.vmlinux_name) 671 - symbol_conf.ignore_vmlinux_buildid = true; 672 - /* fall through */ 673 658 case 'a': 674 659 675 660 /* Ensure the last given target is used */