Skip to content

Commit e5a9078

Browse files
acmelgregkh
authored andcommitted
perf intel-pt: Use __fallthrough
commit 7ea6856d6f5629d742edc23b8b76e6263371ef45 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0586f5c commit e5a9078

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

tools/perf/util/intel-pt-decoder/intel-pt-decoder.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <errno.h>
2323
#include <stdint.h>
2424
#include <inttypes.h>
25+
#include <linux/compiler.h>
2526

2627
#include "../cache.h"
2728
#include "../util.h"
@@ -1708,6 +1709,7 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder)
17081709
switch (decoder->packet.type) {
17091710
case INTEL_PT_TIP_PGD:
17101711
decoder->continuous_period = false;
1712+
__fallthrough;
17111713
case INTEL_PT_TIP_PGE:
17121714
case INTEL_PT_TIP:
17131715
intel_pt_log("ERROR: Unexpected packet\n");
@@ -1762,6 +1764,8 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder)
17621764
decoder->pge = false;
17631765
decoder->continuous_period = false;
17641766
intel_pt_clear_tx_flags(decoder);
1767+
__fallthrough;
1768+
17651769
case INTEL_PT_TNT:
17661770
decoder->have_tma = false;
17671771
intel_pt_log("ERROR: Unexpected packet\n");
@@ -1802,6 +1806,7 @@ static int intel_pt_walk_to_ip(struct intel_pt_decoder *decoder)
18021806
switch (decoder->packet.type) {
18031807
case INTEL_PT_TIP_PGD:
18041808
decoder->continuous_period = false;
1809+
__fallthrough;
18051810
case INTEL_PT_TIP_PGE:
18061811
case INTEL_PT_TIP:
18071812
decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD;

tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <string.h>
1818
#include <endian.h>
1919
#include <byteswap.h>
20+
#include <linux/compiler.h>
2021

2122
#include "intel-pt-pkt-decoder.h"
2223

@@ -488,6 +489,7 @@ int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf,
488489
case INTEL_PT_FUP:
489490
if (!(packet->count))
490491
return snprintf(buf, buf_len, "%s no ip", name);
492+
__fallthrough;
491493
case INTEL_PT_CYC:
492494
case INTEL_PT_VMCS:
493495
case INTEL_PT_MTC:

0 commit comments

Comments
 (0)