perf tools: Make fetch_kernel_version() publicly available
authorWang Nan <wangnan0@huawei.com>
Fri, 6 Nov 2015 13:55:35 +0000 (13:55 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 6 Nov 2015 18:57:18 +0000 (15:57 -0300)
commit07bc5c699a3d8fe5e26dbcd72e4103c7988055ba
treefac957d198bae637f821596f3e2d9b8d7f3474ec
parent45825d8ab8ef6287f5d05aea141419d8d4278852
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>
tools/perf/util/llvm-utils.c
tools/perf/util/util.c
tools/perf/util/util.h