diff options
author | Borislav Petkov <bp@suse.de> | 2013-02-20 10:32:31 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-03-15 12:06:01 -0400 |
commit | 1355915ac626da30a0c02ccd4569c1e5ce2cbb82 (patch) | |
tree | 37a7cb0618572c4c45d0ec6949cdda6253694291 /tools/lib | |
parent | 85c66be101e1847f0eb46dcb48d5738572129694 (diff) |
perf tools: Extract perf-specific stuff from debugfs.c
Move them to util.c and simplify code a bit.
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1361374353-30385-6-git-send-email-bp@alien8.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/lk/debugfs.c | 15 | ||||
-rw-r--r-- | tools/lib/lk/debugfs.h | 2 |
2 files changed, 0 insertions, 17 deletions
diff --git a/tools/lib/lk/debugfs.c b/tools/lib/lk/debugfs.c index 9cda7a6f5917..099e7cd022e4 100644 --- a/tools/lib/lk/debugfs.c +++ b/tools/lib/lk/debugfs.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include "debugfs.h" | 11 | #include "debugfs.h" |
12 | 12 | ||
13 | char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug"; | 13 | char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug"; |
14 | char tracing_events_path[PATH_MAX + 1] = "/sys/kernel/debug/tracing/events"; | ||
15 | 14 | ||
16 | static const char * const debugfs_known_mountpoints[] = { | 15 | static const char * const debugfs_known_mountpoints[] = { |
17 | "/sys/kernel/debug/", | 16 | "/sys/kernel/debug/", |
@@ -75,14 +74,7 @@ int debugfs_valid_mountpoint(const char *debugfs) | |||
75 | return 0; | 74 | return 0; |
76 | } | 75 | } |
77 | 76 | ||
78 | static void debugfs_set_tracing_events_path(const char *mountpoint) | ||
79 | { | ||
80 | snprintf(tracing_events_path, sizeof(tracing_events_path), "%s/%s", | ||
81 | mountpoint, "tracing/events"); | ||
82 | } | ||
83 | |||
84 | /* mount the debugfs somewhere if it's not mounted */ | 77 | /* mount the debugfs somewhere if it's not mounted */ |
85 | |||
86 | char *debugfs_mount(const char *mountpoint) | 78 | char *debugfs_mount(const char *mountpoint) |
87 | { | 79 | { |
88 | /* see if it's already mounted */ | 80 | /* see if it's already mounted */ |
@@ -105,12 +97,5 @@ char *debugfs_mount(const char *mountpoint) | |||
105 | debugfs_found = true; | 97 | debugfs_found = true; |
106 | strncpy(debugfs_mountpoint, mountpoint, sizeof(debugfs_mountpoint)); | 98 | strncpy(debugfs_mountpoint, mountpoint, sizeof(debugfs_mountpoint)); |
107 | out: | 99 | out: |
108 | debugfs_set_tracing_events_path(debugfs_mountpoint); | ||
109 | return debugfs_mountpoint; | 100 | return debugfs_mountpoint; |
110 | } | 101 | } |
111 | |||
112 | void debugfs_set_path(const char *mountpoint) | ||
113 | { | ||
114 | snprintf(debugfs_mountpoint, sizeof(debugfs_mountpoint), "%s", mountpoint); | ||
115 | debugfs_set_tracing_events_path(mountpoint); | ||
116 | } | ||
diff --git a/tools/lib/lk/debugfs.h b/tools/lib/lk/debugfs.h index bc5ad2df7c0a..935c59bdb442 100644 --- a/tools/lib/lk/debugfs.h +++ b/tools/lib/lk/debugfs.h | |||
@@ -23,9 +23,7 @@ | |||
23 | const char *debugfs_find_mountpoint(void); | 23 | const char *debugfs_find_mountpoint(void); |
24 | int debugfs_valid_mountpoint(const char *debugfs); | 24 | int debugfs_valid_mountpoint(const char *debugfs); |
25 | char *debugfs_mount(const char *mountpoint); | 25 | char *debugfs_mount(const char *mountpoint); |
26 | void debugfs_set_path(const char *mountpoint); | ||
27 | 26 | ||
28 | extern char debugfs_mountpoint[]; | 27 | extern char debugfs_mountpoint[]; |
29 | extern char tracing_events_path[]; | ||
30 | 28 | ||
31 | #endif /* __LK_DEBUGFS_H__ */ | 29 | #endif /* __LK_DEBUGFS_H__ */ |