forked from luck/tmp_suning_uos_patched
perf tools: Move tracing_path stuff under same namespace
Renaming all functions touching tracing_path under same namespace. New interface is: char tracing_path[]; - tracing mount path char tracing_events_path[]; - tracing mount/events path void tracing_path_set(const char *mountpoint); - setting directly tracing_path(_events), used by --debugfs-dir option const char *tracing_path_mount(void); - initial setup of tracing_(events)_path, called from perf.c mounts debugfs/tracefs if needed and possible char *get_tracing_file(const char *name); void put_tracing_file(char *file); - get/put tracing file path Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Raphael Beamonte <raphael.beamonte@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1441180605-24737-4-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
f6a09af7de
commit
65d4b26510
|
@ -214,7 +214,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
|
||||||
fprintf(stderr, "No directory given for --debugfs-dir.\n");
|
fprintf(stderr, "No directory given for --debugfs-dir.\n");
|
||||||
usage(perf_usage_string);
|
usage(perf_usage_string);
|
||||||
}
|
}
|
||||||
perf_debugfs_set_path((*argv)[1]);
|
tracing_path_set((*argv)[1]);
|
||||||
if (envchanged)
|
if (envchanged)
|
||||||
*envchanged = 1;
|
*envchanged = 1;
|
||||||
(*argv)++;
|
(*argv)++;
|
||||||
|
@ -230,7 +230,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
|
||||||
(*argv)++;
|
(*argv)++;
|
||||||
(*argc)--;
|
(*argc)--;
|
||||||
} else if (!prefixcmp(cmd, CMD_DEBUGFS_DIR)) {
|
} else if (!prefixcmp(cmd, CMD_DEBUGFS_DIR)) {
|
||||||
perf_debugfs_set_path(cmd + strlen(CMD_DEBUGFS_DIR));
|
tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR));
|
||||||
fprintf(stderr, "dir: %s\n", tracing_path);
|
fprintf(stderr, "dir: %s\n", tracing_path);
|
||||||
if (envchanged)
|
if (envchanged)
|
||||||
*envchanged = 1;
|
*envchanged = 1;
|
||||||
|
@ -517,8 +517,10 @@ int main(int argc, const char **argv)
|
||||||
cmd = perf_extract_argv0_path(argv[0]);
|
cmd = perf_extract_argv0_path(argv[0]);
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
cmd = "perf-help";
|
cmd = "perf-help";
|
||||||
/* get debugfs mount point from /proc/mounts */
|
|
||||||
perf_debugfs_mount();
|
/* get debugfs/tracefs mount point from /proc/mounts */
|
||||||
|
tracing_path_mount();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "perf-xxxx" is the same as "perf xxxx", but we obviously:
|
* "perf-xxxx" is the same as "perf xxxx", but we obviously:
|
||||||
*
|
*
|
||||||
|
|
|
@ -390,7 +390,7 @@ void set_term_quiet_input(struct termios *old)
|
||||||
tcsetattr(0, TCSANOW, &tc);
|
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",
|
snprintf(tracing_path, sizeof(tracing_path), "%s/%s",
|
||||||
mountpoint, tracing);
|
mountpoint, tracing);
|
||||||
|
@ -398,7 +398,7 @@ static void set_tracing_events_path(const char *tracing, const char *mountpoint)
|
||||||
mountpoint, tracing, "events");
|
mountpoint, tracing, "events");
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *__perf_tracefs_mount(void)
|
static const char *tracing_path_tracefs_mount(void)
|
||||||
{
|
{
|
||||||
const char *mnt;
|
const char *mnt;
|
||||||
|
|
||||||
|
@ -406,12 +406,12 @@ static const char *__perf_tracefs_mount(void)
|
||||||
if (!mnt)
|
if (!mnt)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
set_tracing_events_path("", mnt);
|
__tracing_path_set("", mnt);
|
||||||
|
|
||||||
return mnt;
|
return mnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *__perf_debugfs_mount(void)
|
static const char *tracing_path_debugfs_mount(void)
|
||||||
{
|
{
|
||||||
const char *mnt;
|
const char *mnt;
|
||||||
|
|
||||||
|
@ -419,27 +419,27 @@ static const char *__perf_debugfs_mount(void)
|
||||||
if (!mnt)
|
if (!mnt)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
set_tracing_events_path("tracing/", mnt);
|
__tracing_path_set("tracing/", mnt);
|
||||||
|
|
||||||
return mnt;
|
return mnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *perf_debugfs_mount(void)
|
const char *tracing_path_mount(void)
|
||||||
{
|
{
|
||||||
const char *mnt;
|
const char *mnt;
|
||||||
|
|
||||||
mnt = __perf_tracefs_mount();
|
mnt = tracing_path_tracefs_mount();
|
||||||
if (mnt)
|
if (mnt)
|
||||||
return mnt;
|
return mnt;
|
||||||
|
|
||||||
mnt = __perf_debugfs_mount();
|
mnt = tracing_path_debugfs_mount();
|
||||||
|
|
||||||
return mnt;
|
return mnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void perf_debugfs_set_path(const char *mntpt)
|
void tracing_path_set(const char *mntpt)
|
||||||
{
|
{
|
||||||
set_tracing_events_path("tracing/", mntpt);
|
__tracing_path_set("tracing/", mntpt);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *get_tracing_file(const char *name)
|
char *get_tracing_file(const char *name)
|
||||||
|
|
|
@ -85,8 +85,8 @@ extern const char *graph_dotted_line;
|
||||||
extern char buildid_dir[];
|
extern char buildid_dir[];
|
||||||
extern char tracing_path[];
|
extern char tracing_path[];
|
||||||
extern char tracing_events_path[];
|
extern char tracing_events_path[];
|
||||||
extern void perf_debugfs_set_path(const char *mountpoint);
|
extern void tracing_path_set(const char *mountpoint);
|
||||||
const char *perf_debugfs_mount(void);
|
const char *tracing_path_mount(void);
|
||||||
char *get_tracing_file(const char *name);
|
char *get_tracing_file(const char *name);
|
||||||
void put_tracing_file(char *file);
|
void put_tracing_file(char *file);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user