mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>, <guohanjun@huawei.com>
Subject: Re: [PATCH] perf probe: Return errno when does not hit any event
Date: Fri, 17 Mar 2017 10:57:13 +0900	[thread overview]
Message-ID: <20170317105713.a4b1564a1fa2df5c9e340d5a@kernel.org> (raw)
In-Reply-To: <9b267cb2-02cc-0259-0b28-1e9e79164899@huawei.com>

On Thu, 16 Mar 2017 20:07:08 +0800
Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

> 
> 
> On 2017/3/16 17:39, Masami Hiramatsu wrote:
> > On Tue, 14 Mar 2017 10:30:56 -0300
> > Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > 
> >> Em Tue, Mar 14, 2017 at 09:19:47PM +0800, Kefeng Wang escreveu:
> >>> Hi all, any comments, thanks.
> >>
> >> For 'perf probe' make sure Masami is in the CC list, adding him, Masami?
> > 
> > Thanks Arnaldo,
> > 
> > Hi Kefeng, I've made the error ignored by design, since user might pass
> > the wildcard pattern to perf probe -d just for making sure.
> > 
> > You can check the pattern hits any event by using perf-probe --list PATTERN.
> > Would you have any use case to check the result?
> 
> There are some perf test cases from our inner tester, they will check
> the returned value for each execution, and they think return errno is
> better to cater for users when delete inexistent events, as it was before.
> And the patch only returns error when does not hit any event.
> 
> If such behavior, error ignored is more reasonableo<\f I will push them to
> modify the test cases.

Hmm, the commit dddc7ee32fa1 ("perf probe: Fix an error when deleting probes successfully") introduced this behavior. But I think this fix will not be
the best solution.

OK, so could you update your patch according my comment and resend it?


> >>>>> diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
> >>>>> index 1fcebc3..c46b41c 100644
> >>>>> --- a/tools/perf/builtin-probe.c
> >>>>> +++ b/tools/perf/builtin-probe.c
> >>>>> @@ -444,7 +444,8 @@ static int perf_del_probe_events(struct strfilter *filter)
> >>>>>  	if (ret == -ENOENT && ret2 == -ENOENT)
> >>>>>  		pr_debug("\"%s\" does not hit any event.\n", str);

This should be pr_warning if this case has an error.

> >>>>>  		/* Note that this is silently ignored */

This comment should be removed too, since this error is not ignored anymore.


> >>>>> -	ret = 0;
> >>>>> +	else
> >>>>> +		ret = 0;
> >>>>>  

With these patches, perf probe shows an error if there is no event hit
for --delete.

$ sudo ./perf probe -d hoge
"hoge" does not hit any event.
  Error: Failed to delete events.


Thanks,


> >>>>>  error:
> >>>>>  	if (kfd >= 0)
> >>>>>
> >>>>
> >>>>
> >>>> .
> >>>>
> > 
> > 
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2017-03-17  2:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06  9:34 Kefeng Wang
2017-03-07  7:33 ` Kefeng Wang
2017-03-14 13:19   ` Kefeng Wang
2017-03-14 13:30     ` Arnaldo Carvalho de Melo
2017-03-16  9:39       ` Masami Hiramatsu
2017-03-16 12:07         ` Kefeng Wang
2017-03-17  1:57           ` Masami Hiramatsu [this message]
2017-03-17  8:16             ` [PATCH v2] " Kefeng Wang
2017-03-17 23:23               ` Masami Hiramatsu
2017-03-21 13:46                 ` Arnaldo Carvalho de Melo
2017-03-24 18:43               ` [tip:perf/core] perf probe: Return errno when not hitting " tip-bot for Kefeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170317105713.a4b1564a1fa2df5c9e340d5a@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=guohanjun@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=wangkefeng.wang@huawei.com \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome