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>
This commit is contained in:
@@ -186,13 +186,13 @@ static inline float hist_entry__get_percent_limit(struct hist_entry *he)
|
||||
static inline u64 cl_address(u64 address)
|
||||
{
|
||||
/* return the cacheline of the address */
|
||||
return (address & ~(cacheline_size - 1));
|
||||
return (address & ~(cacheline_size() - 1));
|
||||
}
|
||||
|
||||
static inline u64 cl_offset(u64 address)
|
||||
{
|
||||
/* return the cacheline of the address */
|
||||
return (address & (cacheline_size - 1));
|
||||
return (address & (cacheline_size() - 1));
|
||||
}
|
||||
|
||||
enum sort_mode {
|
||||
|
||||
Reference in New Issue
Block a user