diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-10-17 15:33:43 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-10-17 15:33:43 -0400 |
commit | 97a07f10c38064dea492794c99445f6260afcdc1 (patch) | |
tree | baa4b7832bae42e80cb0f27bde490c73875f1a95 /tools/perf/util/util.h | |
parent | 6ef068cb8e77784431b6c80adc49d0b0a6a5df66 (diff) |
perf tools: Introduce filename__read_int helper
Just opens a file and calls atoi() in at most its first 64 bytes.
To read things like /proc/sys/kernel/perf_event_paranoid.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
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-669q04c5tou5pnt8jtiz6y2r@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.h')
-rw-r--r-- | tools/perf/util/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 42dfba70fbfc..c8f362daba87 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -305,4 +305,6 @@ struct dso; | |||
305 | 305 | ||
306 | char *get_srcline(struct dso *dso, unsigned long addr); | 306 | char *get_srcline(struct dso *dso, unsigned long addr); |
307 | void free_srcline(char *srcline); | 307 | void free_srcline(char *srcline); |
308 | |||
309 | int filename__read_int(const char *filename, int *value); | ||
308 | #endif /* GIT_COMPAT_UTIL_H */ | 310 | #endif /* GIT_COMPAT_UTIL_H */ |