summaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2014-12-11 17:17:46 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-12-11 17:17:46 +0100
commit3a351127cbc682c3a0ae7383c4ff6fd0e8fee83c (patch)
tree7764be99863cf2d9ca95f0f42336756f0e6dcbb7 /tools/perf
parentperf kvm stat live: Mark events as (x86 only) in help output (diff)
downloadlinux-3a351127cbc682c3a0ae7383c4ff6fd0e8fee83c.tar.xz
linux-3a351127cbc682c3a0ae7383c4ff6fd0e8fee83c.zip
tools lib fs: Adopt filename__read_int from tools/perf/
Will be useful for new helpers to read sysctl values. 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> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/util.c17
-rw-r--r--tools/perf/util/util.h1
2 files changed, 0 insertions, 18 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index d5eab3f3323f..41125e5b011e 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -442,23 +442,6 @@ unsigned long parse_tag_value(const char *str, struct parse_tag *tags)
return (unsigned long) -1;
}
-int filename__read_int(const char *filename, int *value)
-{
- char line[64];
- int fd = open(filename, O_RDONLY), err = -1;
-
- if (fd < 0)
- return -1;
-
- if (read(fd, line, sizeof(line)) > 0) {
- *value = atoi(line);
- err = 0;
- }
-
- close(fd);
- return err;
-}
-
int filename__read_str(const char *filename, char **buf, size_t *sizep)
{
size_t size = 0, alloc_size = 0;
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index abc445ee4f60..008b361b1758 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -343,7 +343,6 @@ char *get_srcline(struct dso *dso, unsigned long addr, struct symbol *sym,
bool show_sym);
void free_srcline(char *srcline);
-int filename__read_int(const char *filename, int *value);
int filename__read_str(const char *filename, char **buf, size_t *sizep);
int perf_event_paranoid(void);