public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
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 14:22:35 +0900	[thread overview]
Message-ID: <87r40ldkv8.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20140813005055.24360.73553.stgit@kbuild-fedora.novalocal> (Masami Hiramatsu's message of "Wed, 13 Aug 2014 00:50:55 +0000")

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.

Thanks,
Namhyung


> +		ret = kp_fd;
> +		goto out;
>  	}
>  
> +	if (up_fd >= 0) {
> +		ret = __show_perf_probe_events(up_fd, false);
> +		close(up_fd);
> +	}
> +out:
>  	exit_symbol_maps();
>  	return ret;
>  }

  parent reply	other threads:[~2014-08-13  5:22 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 ` Namhyung Kim [this message]
2014-08-13 14:21   ` [PATCH 1/2] [BUGFIX] perf probe: Fix --list option to show " Masami Hiramatsu
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=87r40ldkv8.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --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