Commit 2b1b7100 authored by Don Zickus's avatar Don Zickus Committed by Jiri Olsa

perf tools: Add support to dynamically get cacheline size

Different arches may have different cacheline sizes.  Look it up and set
a global variable for reference.
Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
Link: http://lkml.kernel.org/r/1401480605-97442-1-git-send-email-dzickus@redhat.comSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
parent 7365be55
...@@ -458,6 +458,7 @@ int main(int argc, const char **argv) ...@@ -458,6 +458,7 @@ int main(int argc, const char **argv)
/* The page_size is placed in util object. */ /* The page_size is placed in util object. */
page_size = sysconf(_SC_PAGE_SIZE); page_size = sysconf(_SC_PAGE_SIZE);
cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
cmd = perf_extract_argv0_path(argv[0]); cmd = perf_extract_argv0_path(argv[0]);
if (!cmd) if (!cmd)
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* XXX We need to find a better place for these things... * XXX We need to find a better place for these things...
*/ */
unsigned int page_size; unsigned int page_size;
int cacheline_size;
bool test_attr__enabled; bool test_attr__enabled;
......
...@@ -304,6 +304,7 @@ char *rtrim(char *s); ...@@ -304,6 +304,7 @@ char *rtrim(char *s);
void dump_stack(void); void dump_stack(void);
extern unsigned int page_size; extern unsigned int page_size;
extern int cacheline_size;
void get_term_dimensions(struct winsize *ws); void get_term_dimensions(struct winsize *ws);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment