diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-04-08 11:04:29 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-04-08 11:04:29 -0400 |
| commit | f9383452a26fc47f62c4ddcfa20ccebb7a09c2d8 (patch) | |
| tree | ffe146edf1ed91483318c7e8f1884b5710a5a52d | |
| parent | bfc279f3d233150ff260e9e93012e14f86810648 (diff) | |
perf dwarf: Guard !x86_64 definitions under #ifdef else clause
To fix the build on Fedora Rawhide (gcc 6.0.0 20160311 (Red Hat 6.0.0-0.17):
CC /tmp/build/perf/arch/x86/util/dwarf-regs.o
arch/x86/util/dwarf-regs.c:66:36: error: 'x86_32_regoffset_table' defined but not used [-Werror=unused-const-variable=]
static const struct pt_regs_offset x86_32_regoffset_table[] = {
^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-fghuksc1u8ln82bof4lwcj0o@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
| -rw-r--r-- | tools/perf/arch/x86/util/dwarf-regs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/arch/x86/util/dwarf-regs.c b/tools/perf/arch/x86/util/dwarf-regs.c index 9223c164e545..1f86ee8fb831 100644 --- a/tools/perf/arch/x86/util/dwarf-regs.c +++ b/tools/perf/arch/x86/util/dwarf-regs.c | |||
| @@ -63,6 +63,8 @@ struct pt_regs_offset { | |||
| 63 | # define REG_OFFSET_NAME_32(n, r) {.name = n, .offset = offsetof(struct pt_regs, r)} | 63 | # define REG_OFFSET_NAME_32(n, r) {.name = n, .offset = offsetof(struct pt_regs, r)} |
| 64 | #endif | 64 | #endif |
| 65 | 65 | ||
| 66 | /* TODO: switching by dwarf address size */ | ||
| 67 | #ifndef __x86_64__ | ||
| 66 | static const struct pt_regs_offset x86_32_regoffset_table[] = { | 68 | static const struct pt_regs_offset x86_32_regoffset_table[] = { |
| 67 | REG_OFFSET_NAME_32("%ax", eax), | 69 | REG_OFFSET_NAME_32("%ax", eax), |
| 68 | REG_OFFSET_NAME_32("%cx", ecx), | 70 | REG_OFFSET_NAME_32("%cx", ecx), |
| @@ -75,6 +77,8 @@ static const struct pt_regs_offset x86_32_regoffset_table[] = { | |||
| 75 | REG_OFFSET_END, | 77 | REG_OFFSET_END, |
| 76 | }; | 78 | }; |
| 77 | 79 | ||
| 80 | #define regoffset_table x86_32_regoffset_table | ||
| 81 | #else | ||
| 78 | static const struct pt_regs_offset x86_64_regoffset_table[] = { | 82 | static const struct pt_regs_offset x86_64_regoffset_table[] = { |
| 79 | REG_OFFSET_NAME_64("%ax", rax), | 83 | REG_OFFSET_NAME_64("%ax", rax), |
| 80 | REG_OFFSET_NAME_64("%dx", rdx), | 84 | REG_OFFSET_NAME_64("%dx", rdx), |
| @@ -95,11 +99,7 @@ static const struct pt_regs_offset x86_64_regoffset_table[] = { | |||
| 95 | REG_OFFSET_END, | 99 | REG_OFFSET_END, |
| 96 | }; | 100 | }; |
| 97 | 101 | ||
| 98 | /* TODO: switching by dwarf address size */ | ||
| 99 | #ifdef __x86_64__ | ||
| 100 | #define regoffset_table x86_64_regoffset_table | 102 | #define regoffset_table x86_64_regoffset_table |
| 101 | #else | ||
| 102 | #define regoffset_table x86_32_regoffset_table | ||
| 103 | #endif | 103 | #endif |
| 104 | 104 | ||
| 105 | /* Minus 1 for the ending REG_OFFSET_END */ | 105 | /* Minus 1 for the ending REG_OFFSET_END */ |
