All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
	Naohiro Aota <naota@elisp.net>, Ingo Molnar <mingo@redhat.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] [BUGFIX] perf probe: Fix --list option to show events only with uprobe events
Date: Thu, 14 Aug 2014 01:02:52 +0900	[thread overview]
Message-ID: <53EB8C2C.9030709@hitachi.com> (raw)
In-Reply-To: <20140813144801.GA2718@kernel.org>

(2014/08/13 23:48), Arnaldo Carvalho de Melo wrote:
> Em Wed, Aug 13, 2014 at 11:21:34PM +0900, Masami Hiramatsu escreveu:
>> (2014/08/13 14:22), Namhyung Kim wrote:
>>> On Wed, 13 Aug 2014 00:50:55 +0000, Masami Hiramatsu wrote:
>>>> +	if (kp_fd < 0 && up_fd < 0) {
>>>> +		/* Both kprobes and uprobes are disabled, warn it. */
>>>> +		if (kp_fd == -ENOTSUP && up_fd == -ENOTSUP)
>>>> +			pr_warning("Debugfs is not mounted.\n");
>>>> +		else if (kp_fd == -ENOENT && up_fd == -ENOENT)
>>>> +			pr_warning("Please rebuild kernel with "
>>>> +				   "CONFIG_KPROBE_EVENTS or/and "
>>>> +				   "CONFIG_UPROBE_EVENTS.\n");
>>>> +		else
>>>> +			pr_warning("Failed to open kprobe events: %s.\n" \
>>>> +				   "Failed to open uprobe events: %s.\n",
>>>> +				   strerror(-kp_fd), strerror(-up_fd));
>>>
>>> It seems the second strerror() might overwrite the message of the
>>> first.  You'd better using strerror_r() IMHO.
> 
> Well spotted!
>  
>> Oops, right, it must use the same buffer...
>> But instead of using strerror_r, we can call pr_warning twice. Or should we
>> better replace all strerror to strerror_r in perf? (it should be another series)
> 
> Well, don't introduce new strerror() uses, we have threads in perf
> already and if both try to use strerror() for different reasons, say the
> UI to print something to the user and some logging/debugging thread do
> it to the disk, we may race.

OK, I'll use strerror_r() in next version.

> So, in this case, please use strerror_r() and if you feel like
> contributing the changes to any other place where strerror() is still
> used, you are welcome to do so at a later patch :)

Yeah, I'll do that. :)

Thank you!

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



      reply	other threads:[~2014-08-13 16:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13  0:50 [PATCH 1/2] [BUGFIX] perf probe: Fix --list option to show events only with uprobe events Masami Hiramatsu
2014-08-13  0:50 ` [PATCH 2/2] [BUGFIX] perf probe: Fix --del option to delete " Masami Hiramatsu
2014-08-13  5:22 ` [PATCH 1/2] [BUGFIX] perf probe: Fix --list option to show " Namhyung Kim
2014-08-13 14:21   ` Masami Hiramatsu
2014-08-13 14:48     ` Arnaldo Carvalho de Melo
2014-08-13 16:02       ` Masami Hiramatsu [this message]

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=53EB8C2C.9030709@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=naota@elisp.net \
    --cc=paulus@samba.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.