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

perf srcline: Conditionally suppress addr2line warnings

It has symbol_conf.disable_add2line_warn to suppress some warnings. Let's
make it consistent with others.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221215192817.2734573-6-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
d5e33ce0 3b27222d

+10 -5
+10 -5
tools/perf/util/srcline.c
··· 573 573 * "??"/"??:0" lines. 574 574 */ 575 575 if (fprintf(a2l->to_child, "%016"PRIx64"\n,\n", addr) < 0 || fflush(a2l->to_child) != 0) { 576 - pr_warning("%s %s: could not send request\n", __func__, dso_name); 576 + if (!symbol_conf.disable_add2line_warn) 577 + pr_warning("%s %s: could not send request\n", __func__, dso_name); 577 578 goto out; 578 579 } 579 580 580 581 switch (read_addr2line_record(a2l, &record_function, &record_filename, &record_line_nr)) { 581 582 case -1: 582 - pr_warning("%s %s: could not read first record\n", __func__, dso_name); 583 + if (!symbol_conf.disable_add2line_warn) 584 + pr_warning("%s %s: could not read first record\n", __func__, dso_name); 583 585 goto out; 584 586 case 0: 585 587 /* ··· 590 588 */ 591 589 switch (read_addr2line_record(a2l, NULL, NULL, NULL)) { 592 590 case -1: 593 - pr_warning("%s %s: could not read delimiter record\n", __func__, dso_name); 591 + if (!symbol_conf.disable_add2line_warn) 592 + pr_warning("%s %s: could not read delimiter record\n", 593 + __func__, dso_name); 594 594 break; 595 595 case 0: 596 596 /* As expected. */ 597 597 break; 598 598 default: 599 - pr_warning("%s %s: unexpected record instead of sentinel", 600 - __func__, dso_name); 599 + if (!symbol_conf.disable_add2line_warn) 600 + pr_warning("%s %s: unexpected record instead of sentinel", 601 + __func__, dso_name); 601 602 break; 602 603 } 603 604 goto out;