lkml.org 
[lkml]   [2017]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/12] perf, tools: Print probe warnings for binaries only once per binary
Date
From: Andi Kleen <ak@linux.intel.com>

When the perf probe code is called from perf script we may end up
with a flood of bad binary errors with -v. Only print the error message
once in this case.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/probe-event.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index fb5031ac24a2..85fbeeb364bf 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -492,12 +492,16 @@ static struct debuginfo *open_debuginfo(const char *module, struct nsinfo *nsi,
nsinfo__mountns_enter(nsi, &nsc);
ret = debuginfo__new(path);
if (!ret && (!silent || verbose)) {
- pr_warning("The %s file has no debug information.\n", path);
- if (!module || !strtailcmp(path, ".ko"))
- pr_warning("Rebuild with CONFIG_DEBUG_INFO=y, ");
- else
- pr_warning("Rebuild with -g, ");
- pr_warning("or install an appropriate debuginfo package.\n");
+ static char printed[1024];
+ if (strcmp(path, printed)) {
+ snprintf(printed, sizeof printed, "%s", path);
+ pr_warning("The %s file has no debug information.\n", path);
+ if (!module || !strtailcmp(path, ".ko"))
+ pr_warning("Rebuild with CONFIG_DEBUG_INFO=y, ");
+ else
+ pr_warning("Rebuild with -g, ");
+ pr_warning("or install an appropriate debuginfo package.\n");
+ }
}
nsinfo__mountns_exit(&nsc);
return ret;
--
2.13.6
\
 
 \ /
  Last update: 2017-11-28 01:24    [W:0.120 / U:4.624 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site