[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150125135010.GA24454@danjae>
Date: Sun, 25 Jan 2015 22:50:10 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Jiri Olsa <jolsa@...nel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Subject: Re: [PATCH 5/5] perf: Make perf aware of tracefs
Hi Steve,
On Sat, Jan 24, 2015 at 01:13:35PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <rostedt@...dmis.org>
>
> As tracefs may be mounted instead of debugfs to get to the event directories,
> have perf know about tracefs, and use that file system over debugfs if it
> is present.
>
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
> ---
> const char *find_tracing_dir(void)
> {
> + const char *tracing_dir = "";
> static char *tracing;
> static int tracing_found;
> const char *debugfs;
> @@ -351,11 +385,15 @@ const char *find_tracing_dir(void)
> if (tracing_found)
> return tracing;
>
> - debugfs = find_debugfs();
> - if (!debugfs)
> - return NULL;
> + debugfs = find_tracefs();
> + if (!debugfs) {
> + tracing_dir = "/tracing";
> + debugfs = find_debugfs();
> + if (!debugfs)
> + return NULL;
> + }
>
> - if (asprintf(&tracing, "%s/tracing", debugfs) < 0)
> + if (asprintf(&tracing, "%s%s", tracing_dir, debugfs) < 0)
s/tracing_dir, debugfs/debugfs, tracing_dir/
Thanks,
Namhyung
> return NULL;
>
> tracing_found = 1;
> diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
> index 027a5153495c..73c2f8e557ab 100644
> --- a/tools/perf/util/util.h
> +++ b/tools/perf/util/util.h
> @@ -75,6 +75,7 @@
> #include <linux/types.h>
> #include <sys/ttydefaults.h>
> #include <api/fs/debugfs.h>
> +#include <api/fs/tracefs.h>
> #include <termios.h>
> #include <linux/bitops.h>
> #include <termios.h>
> --
> 2.1.4
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists