diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-17 21:03:05 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-17 22:03:34 +0300 |
commit | 9ac94e31ca8c6311ec9eb68aea513e39ad809013 (patch) | |
tree | 352e30a3305522b1744c6c333ae497e119b9fac8 /tools/perf/util/util.h | |
parent | 6e1690c4c0b540930f08295b6a95c8660b257745 (diff) | |
download | linux-9ac94e31ca8c6311ec9eb68aea513e39ad809013.tar.xz |
perf tools: Read the cache line size lazily
It is not read as commonly as 'page_size', so it makes sense to read it
lazily, caching its value when it is first read.
Less files open unconditionally at startup.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-35xhrq91u94uc1djtclek1ie@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, 1 insertions, 1 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index c9626c206208..74d21dfe0d29 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -43,7 +43,7 @@ size_t hex_width(u64 v); int hex2u64(const char *ptr, u64 *val); extern unsigned int page_size; -extern int cacheline_size; +int __pure cacheline_size(void); int fetch_kernel_version(unsigned int *puint, char *str, size_t str_sz); |