From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@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: Wed, 13 Aug 2014 23:21:34 +0900 [thread overview]
Message-ID: <53EB746E.1020904@hitachi.com> (raw)
In-Reply-To: <87r40ldkv8.fsf@sejong.aot.lge.com>
(2014/08/13 14:22), Namhyung Kim wrote:
> Hi Masami,
>
> 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.
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)
Thank you,
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2014-08-13 14:21 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 [this message]
2014-08-13 14:48 ` Arnaldo Carvalho de Melo
2014-08-13 16:02 ` Masami Hiramatsu
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=53EB746E.1020904@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox