LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Michael Petlan <mpetlan@redhat.com>
Subject: Re: [PATCH] perf tools: Fix tracing_path_mount proper path
Date: Tue, 16 Oct 2018 12:18:13 -0300
Message-ID: <20181016151813.GB3849@kernel.org> (raw)
In-Reply-To: <20181016114818.3595-1-jolsa@kernel.org>

Em Tue, Oct 16, 2018 at 01:48:18PM +0200, Jiri Olsa escreveu:
> If there's no tracefs (RHEL7) support the tracing_path_mount
> returns debugfs path which results in following fail:
> 
>   # perf probe sys_write
>   kprobe_events file does not exist - please rebuild kernel with CONFIG_KPROBE_EVENTS.
>   Error: Failed to add events.
> 
> In tracing_path_debugfs_mount function we need to return the
> 'tracing' path instead of just the mount to make it work:
> 
>   # perf probe sys_write
>   Added new event:
>     probe:sys_write      (on sys_write)
> 
>   You can now use it in all perf tools, such as:
> 
>           perf record -e probe:sys_write -aR sleep 1
> 
> Adding the 'return tracing_path;' also to tracing_path_tracefs_mount
> function just for consistency with tracing_path_debugfs_mount.
> 
> Upstream keeps working, because it has the tracefs support.
> 
> Link: http://lkml.kernel.org/n/tip-yiwkzexq9fk1ey1xg3gnjlw4@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/lib/api/fs/tracing_path.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c
> index 120037496f77..5afb11b30fca 100644
> --- a/tools/lib/api/fs/tracing_path.c
> +++ b/tools/lib/api/fs/tracing_path.c
> @@ -36,7 +36,7 @@ static const char *tracing_path_tracefs_mount(void)
>  
>  	__tracing_path_set("", mnt);
>  
> -	return mnt;
> +	return tracing_path;
>  }
>  
>  static const char *tracing_path_debugfs_mount(void)
> @@ -49,7 +49,7 @@ static const char *tracing_path_debugfs_mount(void)
>  
>  	__tracing_path_set("tracing/", mnt);
>  
> -	return mnt;
> +	return tracing_path;

Humm, colour me confused, by the name of the function I expected
tracing_path_debugfs_mount() to return the debugfs mount.

tracing_path_tracefs_mount() would return the tracefs mount point, so,
there, returning tracing_path would be ok.

Is there some other way to figure out that tracefs isn't available and
thus we should use debugfs_mount + "/tracing/" for the "tracefs" mount?

This may well be just the naming confusion... lemme read this a bit
more...

- Arnaldo

>  }
>  
>  const char *tracing_path_mount(void)
> -- 
> 2.17.2

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16 11:48 Jiri Olsa
2018-10-16 15:18 ` Arnaldo Carvalho de Melo [this message]
2018-10-16 15:23   ` Arnaldo Carvalho de Melo
2018-10-18  6:19 ` [tip:perf/urgent] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publically 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=20181016151813.GB3849@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox