From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753275AbdK3CiM (ORCPT ); Wed, 29 Nov 2017 21:38:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:53104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbdK3CiL (ORCPT ); Wed, 29 Nov 2017 21:38:11 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B2A821984 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org Date: Thu, 30 Nov 2017 11:38:08 +0900 From: Masami Hiramatsu To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, mhiramat@kernel.org, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 11/12] perf, tools: Print probe warnings for binaries only once per binary Message-Id: <20171130113808.cf2b1ead6870f13a9d56c66c@kernel.org> In-Reply-To: <20171128002321.2878-12-andi@firstfloor.org> References: <20171128002321.2878-1-andi@firstfloor.org> <20171128002321.2878-12-andi@firstfloor.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Nov 2017 16:23:20 -0800 Andi Kleen wrote: > From: Andi Kleen > > 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. Indeed, but this looks like a hack. You may need to store the path in blacklist and skip it next time. Thank you, > > Signed-off-by: Andi Kleen > --- > 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 > -- Masami Hiramatsu