Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1435019

[PATCH 3/4] perf tool: Fix build when sysconf doesn't support cache line size

From Chris Phlipot <cphlipot0@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 3/4] perf tool: Fix build when sysconf doesn't support cache line size
Date 2016-07-01 07:20 +0200
Message-ID <rPZ1T-2y2-13@gated-at.bofh.it> (permalink)
References <rPZ1T-2y2-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Enable perf to build on libc implementations where sysconf() doesn't
support _SC_LEVEL1_DCACHE_LINESIZE as a parameter.

For example, the Bionic implementation does not support this as a
paremter. Older versions of Bionic will throw an error when this is passed
in as a parameter, and more recent versions will just return 0 as the
cache line size.

Signed-off-by: Chris Phlipot <cphlipot0@gmail.com>
---
 tools/perf/perf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 8f21922..113ca5b 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -509,7 +509,11 @@ int main(int argc, const char **argv)
 
 	/* The page_size is placed in util object. */
 	page_size = sysconf(_SC_PAGE_SIZE);
+#ifdef _SC_LEVEL1_DCACHE_LINESIZE
 	cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
+#else
+	cacheline_size = 0;
+#endif
 
 	if (sysctl__read_int("kernel/perf_event_max_stack", &value) == 0)
 		sysctl_perf_event_max_stack = value;
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] perf tool: Fix Android build Chris Phlipot <cphlipot0@gmail.com> - 2016-07-01 07:20 +0200
  [PATCH 3/4] perf tool: Fix build when sysconf doesn't support cache line size Chris Phlipot <cphlipot0@gmail.com> - 2016-07-01 07:20 +0200
    Re: [PATCH 3/4] perf tool: Fix build when sysconf doesn't support  cache line size Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-05 00:50 +0200
      Re: [PATCH 3/4] perf tool: Fix build when sysconf doesn't support  cache line size Chris Phlipot <cphlipot0@gmail.com> - 2016-07-05 02:20 +0200
        Re: [PATCH 3/4] perf tool: Fix build when sysconf doesn't support  cache line size Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-05 02:30 +0200
          Re: [PATCH 3/4] perf tool: Fix build when sysconf doesn't support  cache line size Chris Phlipot <cphlipot0@gmail.com> - 2016-07-05 02:50 +0200
            Re: [PATCH 3/4] perf tool: Fix build when sysconf doesn't support  cache line size Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-05 03:00 +0200
  [PATCH 2/4] tools lib subcmd: Respect WERROR=0 for build Chris Phlipot <cphlipot0@gmail.com> - 2016-07-01 07:20 +0200
    [tip:perf/core] tools lib subcmd: Respect WERROR=0 for build tip-bot for Chris Phlipot <tipbot@zytor.com> - 2016-07-05 12:30 +0200
  [PATCH 1/4] tools lib api: Respect WERROR=0 for build Chris Phlipot <cphlipot0@gmail.com> - 2016-07-01 07:20 +0200
    [tip:perf/core] tools lib api: Respect WERROR=0 for build tip-bot for Chris Phlipot <tipbot@zytor.com> - 2016-07-05 12:30 +0200
  [PATCH 4/4] perf tool: Update android build documentation Chris Phlipot <cphlipot0@gmail.com> - 2016-07-01 07:20 +0200
    [tip:perf/core] perf tools: Update android build documentation tip-bot for Chris Phlipot <tipbot@zytor.com> - 2016-07-05 12:30 +0200

csiph-web