Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752229AbbEJDXM (ORCPT ); Sat, 9 May 2015 23:23:12 -0400 Received: from mail7.hitachi.co.jp ([133.145.228.42]:37492 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043AbbEJDXK (ORCPT ); Sat, 9 May 2015 23:23:10 -0400 Message-ID: <554ECF17.6000700@hitachi.com> Date: Sun, 10 May 2015 12:23:03 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: He Kuang , a.p.zijlstra@chello.nl, acme@kernel.org, jolsa@kernel.org, mingo@redhat.com CC: wangnan0@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] perf probe: Show better error message when failed to find variable References: <1431165306-106463-1-git-send-email-hekuang@huawei.com> <1431165306-106463-3-git-send-email-hekuang@huawei.com> In-Reply-To: <1431165306-106463-3-git-send-email-hekuang@huawei.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2167 Lines: 60 On 2015/05/09 18:55, He Kuang wrote: > Indicate to check variable location range in error message when we got > failed to find the variable. > > Before this patch: > > $ perf probe --add 'generic_perform_write+118 bytes' > Failed to find the location of bytes at this address. > Perhaps, it has been optimized out. > Error: Failed to add events. > > After this patch: > $ perf probe --add 'generic_perform_write+118 bytes' > Failed to find the location of bytes at this address. > Perhaps, it has been optimized out. > Use -V with --range option to show variable location range. > Error: Failed to add events. OK, this helps users :) Acked-by: Masami Hiramatsu Thank you, > > Signed-off-by: He Kuang > --- > tools/perf/util/probe-finder.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c > index 30a1a1b..2b91323 100644 > --- a/tools/perf/util/probe-finder.c > +++ b/tools/perf/util/probe-finder.c > @@ -532,7 +532,9 @@ static int convert_variable(Dwarf_Die *vr_die, struct probe_finder *pf) > &pf->sp_die, pf->tvar); > if (ret == -ENOENT || ret == -EINVAL) > pr_err("Failed to find the location of %s at this address.\n" > - " Perhaps, it has been optimized out.\n", pf->pvar->var); > + " Perhaps, it has been optimized out.\n" > + " Use -V with --range option to show variable location range.\n", > + pf->pvar->var); > else if (ret == -ENOTSUP) > pr_err("Sorry, we don't support this variable location yet.\n"); > else if (ret == 0 && pf->pvar->field) { > -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development Group E-mail: masami.hiramatsu.pt@hitachi.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/