diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2014-12-11 16:37:59 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2014-12-11 20:53:04 +0000 |
| commit | ce27309f67c347e6e49ebd45042f5362b0ccbdcc (patch) | |
| tree | 5ca6a4d73f1a41f8104cc558582478c6206cd42f /tools/perf/util/util.c | |
| parent | tools lib fs: Add sysctl__read_int helper (diff) | |
| download | kernel-ce27309f67c347e6e49ebd45042f5362b0ccbdcc.tar.gz kernel-ce27309f67c347e6e49ebd45042f5362b0ccbdcc.zip | |
perf tools: Use sysctl__read_int instead of ad-hoc copies
Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/util.c')
| -rw-r--r-- | tools/perf/util/util.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 41125e5b011e..b86744f29eef 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -506,16 +506,9 @@ const char *get_filename_for_perf_kvm(void) int perf_event_paranoid(void) { - char path[PATH_MAX]; - const char *procfs = procfs__mountpoint(); int value; - if (!procfs) - return INT_MAX; - - scnprintf(path, PATH_MAX, "%s/sys/kernel/perf_event_paranoid", procfs); - - if (filename__read_int(path, &value)) + if (sysctl__read_int("kernel/perf_event_paranoid", &value)) return INT_MAX; return value; |
