summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.h
diff options
context:
space:
mode:
authorWang Nan2015-11-06 14:55:35 +0100
committerArnaldo Carvalho de Melo2015-11-06 19:57:18 +0100
commit07bc5c699a3d8fe5e26dbcd72e4103c7988055ba (patch)
treefac957d198bae637f821596f3e2d9b8d7f3474ec /tools/perf/util/util.h
parentbpf tools: Add new API bpf_object__get_kversion() (diff)
downloadkernel-qcow2-linux-07bc5c699a3d8fe5e26dbcd72e4103c7988055ba.tar.gz
kernel-qcow2-linux-07bc5c699a3d8fe5e26dbcd72e4103c7988055ba.tar.xz
kernel-qcow2-linux-07bc5c699a3d8fe5e26dbcd72e4103c7988055ba.zip
perf tools: Make fetch_kernel_version() publicly available
There are 2 places in llvm-utils.c which find kernel version information through uname. This patch extracts the uname related code into a fetch_kernel_version() function and puts it into util.h so it can be reused. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/1446818135-87310-1-git-send-email-wangnan0@huawei.com 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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 4cfb913aa9e0..2665126267dc 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -350,4 +350,7 @@ static inline char *asprintf_expr_not_in_ints(const char *var, size_t nints, int
int get_stack_size(const char *str, unsigned long *_size);
+int fetch_kernel_version(unsigned int *puint,
+ char *str, size_t str_sz);
+
#endif /* GIT_COMPAT_UTIL_H */