mirror of
https://github.com/torvalds/linux.git
synced 2024-11-07 04:32:03 +00:00
perf probe: Fix to use correct debugfs path finder
Instead of using debugfs_path, use debugfs_find_mountpoint() to find actual debugfs path. LKML-Reference: <20100414223928.14630.38326.stgit@localhost6.localdomain6> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Reported-by: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
02b95dadc8
commit
7ca5989dd0
@ -40,7 +40,6 @@
|
|||||||
#include "util/debug.h"
|
#include "util/debug.h"
|
||||||
#include "util/debugfs.h"
|
#include "util/debugfs.h"
|
||||||
#include "util/parse-options.h"
|
#include "util/parse-options.h"
|
||||||
#include "util/parse-events.h" /* For debugfs_path */
|
|
||||||
#include "util/probe-finder.h"
|
#include "util/probe-finder.h"
|
||||||
#include "util/probe-event.h"
|
#include "util/probe-event.h"
|
||||||
|
|
||||||
@ -205,9 +204,6 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
|
|||||||
!params.show_lines))
|
!params.show_lines))
|
||||||
usage_with_options(probe_usage, options);
|
usage_with_options(probe_usage, options);
|
||||||
|
|
||||||
if (debugfs_valid_mountpoint(debugfs_path) < 0)
|
|
||||||
die("Failed to find debugfs path.");
|
|
||||||
|
|
||||||
if (params.list_events) {
|
if (params.list_events) {
|
||||||
if (params.nevents != 0 || params.dellist) {
|
if (params.nevents != 0 || params.dellist) {
|
||||||
pr_err(" Error: Don't use --list with --add/--del.\n");
|
pr_err(" Error: Don't use --list with --add/--del.\n");
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "symbol.h"
|
#include "symbol.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
#include "debugfs.h"
|
||||||
#include "trace-event.h" /* For __unused */
|
#include "trace-event.h" /* For __unused */
|
||||||
#include "parse-events.h" /* For debugfs_path */
|
|
||||||
#include "probe-event.h"
|
#include "probe-event.h"
|
||||||
#include "probe-finder.h"
|
#include "probe-finder.h"
|
||||||
|
|
||||||
@ -1075,10 +1075,18 @@ void clear_kprobe_trace_event(struct kprobe_trace_event *tev)
|
|||||||
static int open_kprobe_events(bool readwrite)
|
static int open_kprobe_events(bool readwrite)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
const char *__debugfs;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = e_snprintf(buf, PATH_MAX, "%s/../kprobe_events", debugfs_path);
|
__debugfs = debugfs_find_mountpoint();
|
||||||
|
if (__debugfs == NULL) {
|
||||||
|
pr_warning("Debugfs is not mounted.\n");
|
||||||
|
return -ENOENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = e_snprintf(buf, PATH_MAX, "%stracing/kprobe_events", __debugfs);
|
||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
|
pr_debug("Opening %s write=%d\n", buf, readwrite);
|
||||||
if (readwrite && !probe_event_dry_run)
|
if (readwrite && !probe_event_dry_run)
|
||||||
ret = open(buf, O_RDWR, O_APPEND);
|
ret = open(buf, O_RDWR, O_APPEND);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user