Browse Source

perf record: Add a fallback to the reference relocation symbol

Usually "_text" is enough, but I received reports that its not always
available, so fallback to "_stext" for the symbol we use to check if we
need to apply any relocation to all the symbols in the kernel symtab,
for when, for instance, kexec is being used.

Reported-by: Darren Hart <dvhltc@us.ibm.com>
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Arnaldo Carvalho de Melo 15 years ago
parent
commit
46db2c3205
1 changed files with 3 additions and 0 deletions
  1. 3 0
      tools/perf/builtin-record.c

+ 3 - 0
tools/perf/builtin-record.c

@@ -563,6 +563,9 @@ static int __cmd_record(int argc, const char **argv)
 
 
 	err = event__synthesize_kernel_mmap(process_synthesized_event,
 	err = event__synthesize_kernel_mmap(process_synthesized_event,
 					    session, "_text");
 					    session, "_text");
+	if (err < 0)
+		err = event__synthesize_kernel_mmap(process_synthesized_event,
+						    session, "_stext");
 	if (err < 0) {
 	if (err < 0) {
 		pr_err("Couldn't record kernel reference relocation symbol.\n");
 		pr_err("Couldn't record kernel reference relocation symbol.\n");
 		return err;
 		return err;