diff options
author | Irina Tirdea <irina.tirdea@gmail.com> | 2012-09-10 18:15:01 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-11 10:48:30 -0400 |
commit | 9ac3e487f0eeef0fa058d72da7681398cc052ee9 (patch) | |
tree | 1a6bb20a22c574e759e336db8a71029475d93eb9 /tools/perf/util/session.c | |
parent | 3f34f6c0233ae055b592e8f8da23d873b82070bb (diff) |
perf tools: fix ALIGN redefinition in system headers
On some systems (e.g. Android), ALIGN is defined in system headers as
ALIGN(p). The definition of ALIGN used in perf takes 2 parameters:
ALIGN(x,a). This leads to redefinition conflicts.
Redefinition error on Android:
In file included from util/include/linux/list.h:1:0,
from util/callchain.h:5,
from util/hist.h:6,
from util/session.h:4,
from util/build-id.h:4,
from util/annotate.c:11:
util/include/linux/kernel.h:11:0: error: "ALIGN" redefined [-Werror]
bionic/libc/include/sys/param.h:38:0: note: this is the location of
the previous definition
Conflics with system defined ALIGN in Android:
util/event.c: In function 'perf_event__synthesize_comm':
util/event.c:115:32: error: macro "ALIGN" passed 2 arguments, but takes just 1
util/event.c:115:9: error: 'ALIGN' undeclared (first use in this function)
util/event.c:115:9: note: each undeclared identifier is reported only once for
each function it appears in
In order to avoid this redefinition, ALIGN is renamed to PERF_ALIGN.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Irina Tirdea <irina.tirdea@intel.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1347315303-29906-5-git-send-email-irina.tirdea@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 945375897c2a..3806ea49f1f7 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -527,7 +527,7 @@ static void perf_event__comm_swap(union perf_event *event, bool sample_id_all) | |||
527 | if (sample_id_all) { | 527 | if (sample_id_all) { |
528 | void *data = &event->comm.comm; | 528 | void *data = &event->comm.comm; |
529 | 529 | ||
530 | data += ALIGN(strlen(data) + 1, sizeof(u64)); | 530 | data += PERF_ALIGN(strlen(data) + 1, sizeof(u64)); |
531 | swap_sample_id_all(event, data); | 531 | swap_sample_id_all(event, data); |
532 | } | 532 | } |
533 | } | 533 | } |
@@ -544,7 +544,7 @@ static void perf_event__mmap_swap(union perf_event *event, | |||
544 | if (sample_id_all) { | 544 | if (sample_id_all) { |
545 | void *data = &event->mmap.filename; | 545 | void *data = &event->mmap.filename; |
546 | 546 | ||
547 | data += ALIGN(strlen(data) + 1, sizeof(u64)); | 547 | data += PERF_ALIGN(strlen(data) + 1, sizeof(u64)); |
548 | swap_sample_id_all(event, data); | 548 | swap_sample_id_all(event, data); |
549 | } | 549 | } |
550 | } | 550 | } |