diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:20:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:20:25 -0500 |
commit | 6556a6743549defc32e5f90ee2cb1ecd833a44c3 (patch) | |
tree | 622306583d4a3c13235a8bfc012854c125c597f1 /tools/perf/util/debugfs.c | |
parent | e0d272429a34ff143bfa04ee8e29dd4eed2964c7 (diff) | |
parent | 1dd2980d990068e20045b90c424518cc7f3657ff (diff) |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (172 commits)
perf_event, amd: Fix spinlock initialization
perf_event: Fix preempt warning in perf_clock()
perf tools: Flush maps on COMM events
perf_events, x86: Split PMU definitions into separate files
perf annotate: Handle samples not at objdump output addr boundaries
perf_events, x86: Remove superflous MSR writes
perf_events: Simplify code by removing cpu argument to hw_perf_group_sched_in()
perf_events, x86: AMD event scheduling
perf_events: Add new start/stop PMU callbacks
perf_events: Report the MMAP pgoff value in bytes
perf annotate: Defer allocating sym_priv->hist array
perf symbols: Improve debugging information about symtab origins
perf top: Use a macro instead of a constant variable
perf symbols: Check the right return variable
perf/scripts: Tag syscall_name helper as not yet available
perf/scripts: Add perf-trace-python Documentation
perf/scripts: Remove unnecessary PyTuple resizes
perf/scripts: Add syscall tracing scripts
perf/scripts: Add Python scripting engine
perf/scripts: Remove check-perf-trace from listed scripts
...
Fix trivial conflict in tools/perf/util/probe-event.c
Diffstat (limited to 'tools/perf/util/debugfs.c')
-rw-r--r-- | tools/perf/util/debugfs.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/perf/util/debugfs.c b/tools/perf/util/debugfs.c index 06b73ee02c49..a88fefc0cc0a 100644 --- a/tools/perf/util/debugfs.c +++ b/tools/perf/util/debugfs.c | |||
@@ -106,16 +106,14 @@ int debugfs_valid_entry(const char *path) | |||
106 | return 0; | 106 | return 0; |
107 | } | 107 | } |
108 | 108 | ||
109 | /* mount the debugfs somewhere */ | 109 | /* mount the debugfs somewhere if it's not mounted */ |
110 | 110 | ||
111 | int debugfs_mount(const char *mountpoint) | 111 | char *debugfs_mount(const char *mountpoint) |
112 | { | 112 | { |
113 | char mountcmd[128]; | ||
114 | |||
115 | /* see if it's already mounted */ | 113 | /* see if it's already mounted */ |
116 | if (debugfs_find_mountpoint()) { | 114 | if (debugfs_find_mountpoint()) { |
117 | debugfs_premounted = 1; | 115 | debugfs_premounted = 1; |
118 | return 0; | 116 | return debugfs_mountpoint; |
119 | } | 117 | } |
120 | 118 | ||
121 | /* if not mounted and no argument */ | 119 | /* if not mounted and no argument */ |
@@ -127,13 +125,14 @@ int debugfs_mount(const char *mountpoint) | |||
127 | mountpoint = "/sys/kernel/debug"; | 125 | mountpoint = "/sys/kernel/debug"; |
128 | } | 126 | } |
129 | 127 | ||
128 | if (mount(NULL, mountpoint, "debugfs", 0, NULL) < 0) | ||
129 | return NULL; | ||
130 | |||
130 | /* save the mountpoint */ | 131 | /* save the mountpoint */ |
131 | strncpy(debugfs_mountpoint, mountpoint, sizeof(debugfs_mountpoint)); | 132 | strncpy(debugfs_mountpoint, mountpoint, sizeof(debugfs_mountpoint)); |
133 | debugfs_found = 1; | ||
132 | 134 | ||
133 | /* mount it */ | 135 | return debugfs_mountpoint; |
134 | snprintf(mountcmd, sizeof(mountcmd), | ||
135 | "/bin/mount -t debugfs debugfs %s", mountpoint); | ||
136 | return system(mountcmd); | ||
137 | } | 136 | } |
138 | 137 | ||
139 | /* umount the debugfs */ | 138 | /* umount the debugfs */ |