From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
"David Ahern" <dsahern@gmail.com>,
"Ingo Molnar" <mingo@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
"Matt Fleming" <matt@codeblueprint.co.uk>,
"Raphaël Beamonte" <raphael.beamonte@gmail.com>
Subject: [PATCH 05/11] perf tools: Move tracing_path stuff under same namespace
Date: Wed, 26 Aug 2015 15:46:47 +0200 [thread overview]
Message-ID: <1440596813-12844-6-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1440596813-12844-1-git-send-email-jolsa@kernel.org>
Renaming all functions touching tracing_path under same
namespace. New interface is:
char tracing_path[];
char tracing_events_path[];
- tracing mount
void perf_tracing_path_set(const char *mountpoint);
- setting directly tracing_path(_events), used by --debugfs-dir option
const char *perf_tracing_path_mount(const char *mountpoint);
- initial setup of tracing_path(_events), called from perf.c
int tracing_path_strerror_open(int err, char *buf, size_t size, const char *filename);
int tracing_path_strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
- strerror functions to get error string when failing to open
tracepoint files
char *get_tracing_file(const char *name);
void put_tracing_file(char *file);
- get/put tracing file path
Link: http://lkml.kernel.org/n/tip-miy6kftxxryjf40b3qb6eknc@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/builtin-trace.c | 4 ++--
tools/perf/perf.c | 8 ++++----
tools/perf/util/util.c | 26 +++++++++++++-------------
tools/perf/util/util.h | 8 ++++----
4 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 2f1162daa3c5..384ebe32698a 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2667,11 +2667,11 @@ out_delete_evlist:
char errbuf[BUFSIZ];
out_error_sched_stat_runtime:
- debugfs__strerror_open_tp(errno, errbuf, sizeof(errbuf), "sched", "sched_stat_runtime");
+ tracing_path_strerror_open_tp(errno, errbuf, sizeof(errbuf), "sched", "sched_stat_runtime");
goto out_error;
out_error_raw_syscalls:
- debugfs__strerror_open_tp(errno, errbuf, sizeof(errbuf), "raw_syscalls", "sys_(enter|exit)");
+ tracing_path_strerror_open_tp(errno, errbuf, sizeof(errbuf), "raw_syscalls", "sys_(enter|exit)");
goto out_error;
out_error_mmap:
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 07dbff5c0e60..c5acdadde347 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -214,7 +214,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
fprintf(stderr, "No directory given for --debugfs-dir.\n");
usage(perf_usage_string);
}
- perf_debugfs_set_path((*argv)[1]);
+ perf_tracing_path_set((*argv)[1]);
if (envchanged)
*envchanged = 1;
(*argv)++;
@@ -230,7 +230,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
(*argv)++;
(*argc)--;
} else if (!prefixcmp(cmd, CMD_DEBUGFS_DIR)) {
- perf_debugfs_set_path(cmd + strlen(CMD_DEBUGFS_DIR));
+ perf_tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR));
fprintf(stderr, "dir: %s\n", tracing_path);
if (envchanged)
*envchanged = 1;
@@ -517,8 +517,8 @@ int main(int argc, const char **argv)
cmd = perf_extract_argv0_path(argv[0]);
if (!cmd)
cmd = "perf-help";
- /* get debugfs mount point from /proc/mounts */
- perf_debugfs_mount(NULL);
+ /* get debugfs/tracefs mount point from /proc/mounts */
+ perf_tracing_path_mount(NULL);
/*
* "perf-xxxx" is the same as "perf xxxx", but we obviously:
*
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 03d1d74a5ede..675d112a887d 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -390,7 +390,7 @@ void set_term_quiet_input(struct termios *old)
tcsetattr(0, TCSANOW, &tc);
}
-static void set_tracing_events_path(const char *tracing, const char *mountpoint)
+static void tracing_path_set(const char *tracing, const char *mountpoint)
{
snprintf(tracing_path, sizeof(tracing_path), "%s/%s",
mountpoint, tracing);
@@ -398,7 +398,7 @@ static void set_tracing_events_path(const char *tracing, const char *mountpoint)
mountpoint, tracing, "events");
}
-static const char *__perf_tracefs_mount(const char *mountpoint)
+static const char *tracing_path_tracefs_mount(const char *mountpoint)
{
const char *mnt;
@@ -406,12 +406,12 @@ static const char *__perf_tracefs_mount(const char *mountpoint)
if (!mnt)
return NULL;
- set_tracing_events_path("", mnt);
+ tracing_path_set("", mnt);
return mnt;
}
-static const char *__perf_debugfs_mount(const char *mountpoint)
+static const char *tracing_path_debugfs_mount(const char *mountpoint)
{
const char *mnt;
@@ -419,30 +419,30 @@ static const char *__perf_debugfs_mount(const char *mountpoint)
if (!mnt)
return NULL;
- set_tracing_events_path("tracing/", mnt);
+ tracing_path_set("tracing/", mnt);
return mnt;
}
-const char *perf_debugfs_mount(const char *mountpoint)
+const char *perf_tracing_path_mount(const char *mountpoint)
{
const char *mnt;
- mnt = __perf_tracefs_mount(mountpoint);
+ mnt = tracing_path_tracefs_mount(mountpoint);
if (mnt)
return mnt;
- mnt = __perf_debugfs_mount(mountpoint);
+ mnt = tracing_path_debugfs_mount(mountpoint);
return mnt;
}
-void perf_debugfs_set_path(const char *mntpt)
+void perf_tracing_path_set(const char *mntpt)
{
- set_tracing_events_path("tracing/", mntpt);
+ tracing_path_set("tracing/", mntpt);
}
-int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename)
+int tracing_path_strerror_open(int err, char *buf, size_t size, const char *filename)
{
char sbuf[128];
@@ -485,13 +485,13 @@ int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename
return 0;
}
-int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
+int tracing_path_strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
{
char path[PATH_MAX];
snprintf(path, PATH_MAX, "tracing/events/%s/%s", sys, name ?: "*");
- return debugfs__strerror_open(err, buf, size, path);
+ return tracing_path_strerror_open(err, buf, size, path);
}
char *get_tracing_file(const char *name)
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index da48c00ab0db..34a68faf53fe 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -85,10 +85,10 @@ extern const char *graph_dotted_line;
extern char buildid_dir[];
extern char tracing_path[];
extern char tracing_events_path[];
-extern void perf_debugfs_set_path(const char *mountpoint);
-const char *perf_debugfs_mount(const char *mountpoint);
-int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename);
-int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
+extern void perf_tracing_path_set(const char *mountpoint);
+const char *perf_tracing_path_mount(const char *mountpoint);
+int tracing_path_strerror_open(int err, char *buf, size_t size, const char *filename);
+int tracing_path_strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
char *get_tracing_file(const char *name);
void put_tracing_file(char *file);
--
2.4.3
next prev parent reply other threads:[~2015-08-26 13:47 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 13:46 [RFC 00/11] perf tools: Enhance parsing events tracepoint error output Jiri Olsa
2015-08-26 13:46 ` [PATCH 01/11] tools: Add err.h with ERR_PTR PTR_ERR interface Jiri Olsa
2015-08-28 16:21 ` Arnaldo Carvalho de Melo
2015-08-31 7:37 ` Jiri Olsa
2015-08-31 15:27 ` Arnaldo Carvalho de Melo
2015-08-26 13:46 ` [PATCH 02/11] perf tools: Add tracing_path and remove unneeded functions Jiri Olsa
2015-08-27 22:47 ` Matt Fleming
2015-08-28 16:27 ` Arnaldo Carvalho de Melo
2015-08-29 10:25 ` Jiri Olsa
2015-08-31 8:32 ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-08-26 13:46 ` [PATCH 03/11] perf tools: Do not change lib/api/fs/debugfs directly Jiri Olsa
[not found] ` <CAE_Gge2cn8LpuETTTkf2nP8JLj=9RDiuW3M8BXzv7ZTJpY9x7w@mail.gmail.com>
2015-08-26 14:17 ` Jiri Olsa
2015-08-26 14:27 ` Arnaldo Carvalho de Melo
2015-08-28 12:26 ` Matt Fleming
2015-08-28 12:19 ` Matt Fleming
2015-08-31 8:33 ` [tip:perf/core] perf tools: Do not change lib/api/fs/ debugfs directly tip-bot for Jiri Olsa
2015-08-26 13:46 ` [PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object Jiri Olsa
2015-08-26 13:52 ` Arnaldo Carvalho de Melo
2015-08-26 14:16 ` Jiri Olsa
2015-08-28 12:59 ` Matt Fleming
2015-08-26 13:46 ` Jiri Olsa [this message]
2015-08-26 14:42 ` [PATCH 05/11] perf tools: Move tracing_path stuff under same namespace Arnaldo Carvalho de Melo
2015-08-26 14:48 ` Jiri Olsa
2015-08-26 14:58 ` Arnaldo Carvalho de Melo
2015-08-26 15:06 ` Jiri Olsa
2015-08-28 13:06 ` Matt Fleming
2015-08-31 7:43 ` Jiri Olsa
2015-08-26 13:46 ` [PATCH 06/11] perf tools: Move tracing_path interface into trace-event-path.c Jiri Olsa
2015-08-26 13:46 ` [PATCH 07/11] perf tools: Make tracing_path_strerror_open message generic Jiri Olsa
2015-08-26 13:46 ` [PATCH 08/11] perf tools: Do not export debugfs_mountpoint and tracefs_mountpoint Jiri Olsa
2015-08-26 13:46 ` [PATCH 09/11] perf tools: Propagate error info for the tracepoint parsing Jiri Olsa
2015-08-28 13:20 ` Matt Fleming
2015-08-28 13:32 ` Jiri Olsa
2015-08-26 13:46 ` [PATCH 10/11] perf tools: Propagate error info from tp_format Jiri Olsa
2015-08-26 13:46 ` [PATCH 11/11] perf tools: Enhance parsing events tracepoint error output Jiri Olsa
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=1440596813-12844-6-git-send-email-jolsa@kernel.org \
--to=jolsa@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeblueprint.co.uk \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=raphael.beamonte@gmail.com \
/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