summaryrefslogtreecommitdiff
path: root/tools/perf/util/util.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2014-12-11 19:37:59 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-12-11 23:53:04 +0300
commitce27309f67c347e6e49ebd45042f5362b0ccbdcc (patch)
tree5ca6a4d73f1a41f8104cc558582478c6206cd42f /tools/perf/util/util.c
parent42e3c4a1274d49b42e9d4306ec096b282a6e14aa (diff)
downloadlinux-ce27309f67c347e6e49ebd45042f5362b0ccbdcc.tar.xz
perf tools: Use sysctl__read_int instead of ad-hoc copies
Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-pt2u7a3b50oddggecx7rwq2n@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.c')
-rw-r--r--tools/perf/util/util.c9
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;