diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-02-09 13:22:22 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-02-09 14:32:03 -0500 |
commit | 7ea6856d6f5629d742edc23b8b76e6263371ef45 (patch) | |
tree | e7ac94937db58f10519b4abaaf255eca96b49b47 /tools/perf | |
parent | 2e2bbc039fad9eabad6c4c1a473c8b2554cdd2d4 (diff) |
perf intel-pt: Use __fallthrough
To address new warnings emmited by gcc 7, e.g.::
CC /tmp/build/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.o
CC /tmp/build/perf/tests/parse-events.o
util/intel-pt-decoder/intel-pt-pkt-decoder.c: In function 'intel_pt_pkt_desc':
util/intel-pt-decoder/intel-pt-pkt-decoder.c:499:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (!(packet->count))
^
util/intel-pt-decoder/intel-pt-pkt-decoder.c:501:2: note: here
case INTEL_PT_CYC:
^~~~
CC /tmp/build/perf/util/intel-pt-decoder/intel-pt-decoder.o
cc1: all warnings being treated as errors
Acked-by: Andi Kleen <ak@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.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-mf0hw789pu9x855us5l32c83@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 5 | ||||
-rw-r--r-- | tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c index e4e7dc781d21..7cf7f7aca4d2 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <errno.h> | 22 | #include <errno.h> |
23 | #include <stdint.h> | 23 | #include <stdint.h> |
24 | #include <inttypes.h> | 24 | #include <inttypes.h> |
25 | #include <linux/compiler.h> | ||
25 | 26 | ||
26 | #include "../cache.h" | 27 | #include "../cache.h" |
27 | #include "../util.h" | 28 | #include "../util.h" |
@@ -1746,6 +1747,7 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder) | |||
1746 | switch (decoder->packet.type) { | 1747 | switch (decoder->packet.type) { |
1747 | case INTEL_PT_TIP_PGD: | 1748 | case INTEL_PT_TIP_PGD: |
1748 | decoder->continuous_period = false; | 1749 | decoder->continuous_period = false; |
1750 | __fallthrough; | ||
1749 | case INTEL_PT_TIP_PGE: | 1751 | case INTEL_PT_TIP_PGE: |
1750 | case INTEL_PT_TIP: | 1752 | case INTEL_PT_TIP: |
1751 | intel_pt_log("ERROR: Unexpected packet\n"); | 1753 | intel_pt_log("ERROR: Unexpected packet\n"); |
@@ -1799,6 +1801,8 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder) | |||
1799 | decoder->pge = false; | 1801 | decoder->pge = false; |
1800 | decoder->continuous_period = false; | 1802 | decoder->continuous_period = false; |
1801 | intel_pt_clear_tx_flags(decoder); | 1803 | intel_pt_clear_tx_flags(decoder); |
1804 | __fallthrough; | ||
1805 | |||
1802 | case INTEL_PT_TNT: | 1806 | case INTEL_PT_TNT: |
1803 | decoder->have_tma = false; | 1807 | decoder->have_tma = false; |
1804 | intel_pt_log("ERROR: Unexpected packet\n"); | 1808 | intel_pt_log("ERROR: Unexpected packet\n"); |
@@ -1839,6 +1843,7 @@ static int intel_pt_walk_to_ip(struct intel_pt_decoder *decoder) | |||
1839 | switch (decoder->packet.type) { | 1843 | switch (decoder->packet.type) { |
1840 | case INTEL_PT_TIP_PGD: | 1844 | case INTEL_PT_TIP_PGD: |
1841 | decoder->continuous_period = false; | 1845 | decoder->continuous_period = false; |
1846 | __fallthrough; | ||
1842 | case INTEL_PT_TIP_PGE: | 1847 | case INTEL_PT_TIP_PGE: |
1843 | case INTEL_PT_TIP: | 1848 | case INTEL_PT_TIP: |
1844 | decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD; | 1849 | decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD; |
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c index 4f7b32020487..7528ae4f7e28 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <string.h> | 17 | #include <string.h> |
18 | #include <endian.h> | 18 | #include <endian.h> |
19 | #include <byteswap.h> | 19 | #include <byteswap.h> |
20 | #include <linux/compiler.h> | ||
20 | 21 | ||
21 | #include "intel-pt-pkt-decoder.h" | 22 | #include "intel-pt-pkt-decoder.h" |
22 | 23 | ||
@@ -498,6 +499,7 @@ int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, | |||
498 | case INTEL_PT_FUP: | 499 | case INTEL_PT_FUP: |
499 | if (!(packet->count)) | 500 | if (!(packet->count)) |
500 | return snprintf(buf, buf_len, "%s no ip", name); | 501 | return snprintf(buf, buf_len, "%s no ip", name); |
502 | __fallthrough; | ||
501 | case INTEL_PT_CYC: | 503 | case INTEL_PT_CYC: |
502 | case INTEL_PT_VMCS: | 504 | case INTEL_PT_VMCS: |
503 | case INTEL_PT_MTC: | 505 | case INTEL_PT_MTC: |