Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752957AbcCAKej (ORCPT ); Tue, 1 Mar 2016 05:34:39 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38162 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051AbcCAKeh convert rfc822-to-8bit (ORCPT ); Tue, 1 Mar 2016 05:34:37 -0500 MIME-Version: 1.0 In-Reply-To: <50399556C9727B4D88A595C8584AAB37B4E27589@GSjpTKYDCembx32.service.hitachi.net> References: <1456658087-4107-1-git-send-email-agnel.joel@gmail.com> <56D2DB9B.4090500@gmail.com> <20160229141944.GF8720@kernel.org> <50399556C9727B4D88A595C8584AAB37B4E274CB@GSjpTKYDCembx32.service.hitachi.net> <50399556C9727B4D88A595C8584AAB37B4E27589@GSjpTKYDCembx32.service.hitachi.net> Date: Tue, 1 Mar 2016 02:34:35 -0800 Message-ID: Subject: Re: [RFC] perf: probe_finder: continue if atleast one probe point found From: Joel Fernandes To: =?UTF-8?B?5bmz5p2+6ZuF5bezIC8gSElSQU1BVFXvvIxNQVNBTUk=?= Cc: "ltc-kernel@ml.yrl.intra.hitachi.co.jp" , Arnaldo Carvalho de Melo , Taeung Song , Joel Fernandes , "linux-perf-users@vger.kernel.org" , Linux Kernel Mailing List , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Jiri Olsa , sysp-manager Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1301 Lines: 36 Hi Hiramatu, On Mon, Feb 29, 2016 at 8:29 PM, 平松雅巳 / HIRAMATU,MASAMI wrote: > BTW, > > ./perf probe \ > -k ./vmlinux -s ./ -x /lib/x86_64-linux-gnu/libc.so.6 -a 'malloc $params' > > might help your case. $params is expanded to function parameters automatically > and if there is no parameters, it is just ignored :) Thanks, I agree this is a better approach. How about an informative error letting the user know about it? Is the below Ok? I can send a patch. ----x8-------- diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 4ce5c5e..21f282a 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -1247,8 +1247,12 @@ static int add_probe_trace_event(Dwarf_Die *sc_die, struct probe_finder *pf) pf->tvar = &tev->args[i]; /* Variable should be found from scope DIE */ ret = find_variable(sc_die, pf); - if (ret != 0) + if (ret != 0) { + pr_err("Variable couldn't be found, if probe is on inline function," + "try '%s' or '%s' instead.\n", + PROBE_ARG_PARAMS, PROBE_ARG_VARS); break; + } }