Skip to contentSkip to conversation

perf, tools: Define MADV_*HUGEPAGE for old kernels

PATCH In review Andi Kleen 2 participants 4 messages Mar 6, 2013 – Mar 7, 2013 perf events

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/2 perf, tools: Define MADV_*HUGEPAGE for old kernels

From: Andi Kleen <[email protected]>

Avoids this on RHEL6:

bench/numa.c: In function ‘alloc_data’:
bench/numa.c:334: error: ‘MADV_HUGEPAGE’ undeclared (first use in this function) bench/numa.c:334: error: (Each undeclared identifier is reported only once bench/numa.c:334: error: for each function it appears in.) bench/numa.c:341: error: ‘MADV_NOHUGEPAGE’ undeclared (first use in this function)

---
 tools/perf/bench/numa.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
tools/perf/bench/numa.c +3 -0
index 30d1c32..8f30ce1 100644
@@ -30,6 +30,9 @@
 #include <numa.h>
 #include <numaif.h>
 
+#define MADV_HUGEPAGE   14              /* Worth backing with hugepages */
+#define MADV_NOHUGEPAGE 15              /* Not worth backing with hugepages */
+
 /*
  * Regular printout to the terminal, supressed if -q is specified:
  */
Signature · 1 line
1.7.7.6
author
#1 lore raw

PATCH 2/2 perf, tools: Fix compilation without newt support

From: Andi Kleen <[email protected]>

Fix

builtin-annotate.c: In function ‘hists__find_annotations’:
builtin-annotate.c:161:4: error: duplicate case value builtin-annotate.c:154:4: error: previously used here

and

builtin-report.c:479:15: error: ‘K_SWITCH_INPUT_DATA’ undeclared (first use in this function) builtin-report.c:479:15: note: each undeclared identifier is reported only once for each function it appears in builtin-report.c: In function ‘cmd_report’:
builtin-report.c:823:13: error: ‘K_SWITCH_INPUT_DATA’ undeclared (first use in this function)

by changing the values of the fallback K_LEFT, K_RIGHT and adding a dummy K_SWITCH_INPUT_DATA too

---
 tools/perf/util/hist.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
tools/perf/util/hist.h +3 -2
index 3862468..a8d7284 100644
@@ -208,8 +208,9 @@ static inline int script_browse(const char *script_opt __maybe_unused)
 	return 0;
 }
 
-#define K_LEFT -1
-#define K_RIGHT -2
+#define K_LEFT -10
+#define K_RIGHT -20
+#define K_SWITCH_INPUT_DATA -30
 #endif
 
 #ifdef GTK2_SUPPORT
Signature · 1 line
1.7.7.6
maintainer
#2 lore raw

Re: [PATCH 2/2] perf, tools: Fix compilation without newt support

Quoted 10 lines · Andi Kleen

From: Andi Kleen <[email protected]>

Fix

builtin-annotate.c: In function ‘hists__find_annotations’:
builtin-annotate.c:161:4: error: duplicate case value builtin-annotate.c:154:4: error: previously used here

and

Quoted 7 lines

builtin-report.c:479:15: error: ‘K_SWITCH_INPUT_DATA’ undeclared (first use in this function) builtin-report.c:479:15: note: each undeclared identifier is reported only once for each function it appears in builtin-report.c: In function ‘cmd_report’:
builtin-report.c:823:13: error: ‘K_SWITCH_INPUT_DATA’ undeclared (first use in this function)

by changing the values of the fallback K_LEFT, K_RIGHT and adding a dummy K_SWITCH_INPUT_DATA too

The fixes are already in the acme/perf/core.

Thanks,
Namhyung

maintainer
#3 lore raw
In reply to Andi Kleen

Hi Andi,

Quoted 9 lines · Andi Kleen

From: Andi Kleen <[email protected]>

Avoids this on RHEL6:

bench/numa.c: In function ‘alloc_data’:
bench/numa.c:334: error: ‘MADV_HUGEPAGE’ undeclared (first use in this function) bench/numa.c:334: error: (Each undeclared identifier is reported only once bench/numa.c:334: error: for each function it appears in.) bench/numa.c:341: error: ‘MADV_NOHUGEPAGE’ undeclared (first use in this function)

The fix was posted already but there's an issue also. Please see

https://lkml.org/lkml/2013/3/6/2

Thanks,
Namhyung