diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-12 16:30:01 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-15 15:33:26 -0500 |
commit | 1ad826bad5bd0b6ccfb203f78c70302b764df0be (patch) | |
tree | 1f5f60ba774358e953c1b688c7e7c246be936117 | |
parent | 5141d7350d3d8a12f1f76b1015b937f14d2b97e2 (diff) |
perf tests: Fix build on older systems where 'signal' is reserved
fixing the following problems, for instance, on RHEL6.7:
CC /tmp/build/perf/tests/bp_signal.o
cc1: warnings being treated as errors
tests/bp_signal.c: In function ‘__event’:
tests/bp_signal.c:106: error: declaration of ‘signal’ shadows a global declaration
/usr/include/signal.h:101: error: shadowed declaration is here
tests/bp_signal.c: In function ‘bp_event’:
tests/bp_signal.c:144: error: declaration of ‘signal’ shadows a global declaration
/usr/include/signal.h:101: error: shadowed declaration is here
tests/bp_signal.c: In function ‘wp_event’:
tests/bp_signal.c:149: error: declaration of ‘signal’ shadows a global declaration
/usr/include/signal.h:101: error: shadowed declaration is here
mv: cannot stat `/tmp/build/perf/tests/.bp_signal.o.tmp': No such file or directory
make[3]: *** [/tmp/build/perf/tests/bp_signal.o] Error 1
make[2]: *** [tests] Error 2
make[1]: *** [/tmp/build/perf/perf-in.o] Error 2
make[1]: *** Waiting for unfinished jobs....
Reported-by: Vinson Lee <vlee@freedesktop.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: He Kuang <hekuang@huawei.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: pi3orama@163.com
Fixes: 8fd34e1cce18 ("perf test: Improve bp_signal")
Link: http://lkml.kernel.org/n/tip-wlpx6tik1b0jirlkw64bv400@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/tests/bp_signal.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c index 1d1bb489b4e8..e7664fe3bd33 100644 --- a/tools/perf/tests/bp_signal.c +++ b/tools/perf/tests/bp_signal.c | |||
@@ -103,7 +103,7 @@ static void sig_handler(int signum __maybe_unused, | |||
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | static int __event(bool is_x, void *addr, int signal) | 106 | static int __event(bool is_x, void *addr, int sig) |
107 | { | 107 | { |
108 | struct perf_event_attr pe; | 108 | struct perf_event_attr pe; |
109 | int fd; | 109 | int fd; |
@@ -133,7 +133,7 @@ static int __event(bool is_x, void *addr, int signal) | |||
133 | } | 133 | } |
134 | 134 | ||
135 | fcntl(fd, F_SETFL, O_RDWR|O_NONBLOCK|O_ASYNC); | 135 | fcntl(fd, F_SETFL, O_RDWR|O_NONBLOCK|O_ASYNC); |
136 | fcntl(fd, F_SETSIG, signal); | 136 | fcntl(fd, F_SETSIG, sig); |
137 | fcntl(fd, F_SETOWN, getpid()); | 137 | fcntl(fd, F_SETOWN, getpid()); |
138 | 138 | ||
139 | ioctl(fd, PERF_EVENT_IOC_RESET, 0); | 139 | ioctl(fd, PERF_EVENT_IOC_RESET, 0); |
@@ -141,14 +141,14 @@ static int __event(bool is_x, void *addr, int signal) | |||
141 | return fd; | 141 | return fd; |
142 | } | 142 | } |
143 | 143 | ||
144 | static int bp_event(void *addr, int signal) | 144 | static int bp_event(void *addr, int sig) |
145 | { | 145 | { |
146 | return __event(true, addr, signal); | 146 | return __event(true, addr, sig); |
147 | } | 147 | } |
148 | 148 | ||
149 | static int wp_event(void *addr, int signal) | 149 | static int wp_event(void *addr, int sig) |
150 | { | 150 | { |
151 | return __event(false, addr, signal); | 151 | return __event(false, addr, sig); |
152 | } | 152 | } |
153 | 153 | ||
154 | static long long bp_count(int fd) | 154 | static long long bp_count(int fd) |