perf tools: Add missing break for PERF_RECORD_ITRACE_START
Jiri Olsa
reviewerPATCH 1/1 perf tools: Add missing break for PERF_RECORD_ITRACE_START
Missing switch break since introduction of new event:
c4937a91ea56 perf tools: handle PERF_RECORD_LOST_SAMPLES
--- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/machine.c +1 -1
@@ -1448,7 +1448,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_AUX : ret =machine__process_aux_event (machine, event);break ;case PERF_RECORD_ITRACE_START : - ret =machine__process_itrace_start_event (machine, event); + ret =machine__process_itrace_start_event (machine, event);break ;case PERF_RECORD_LOST_SAMPLES : ret =machine__process_lost_samples_event (machine, event, sample);break ;break ;
Signature · 1 line
1.9.3
Adrian Hunter
reviewerQuoted 16 lines · Jiri Olsa
Missing switch break since introduction of new event:
c4937a91ea56perf tools: handlePERF_RECORD_LOST_SAMPLESCc Kan Liang <[email protected]>Cc Adrian Hunter <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/machine.c +0
-0
tools/perf/util/machine.c int machine__process_event(struct machine *machine, union perf_event *event, · line 1454
Quoted 8 lines
tools/perf/util/machine.c +1
-1@@ -1448,7 +1448,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_AUX : ret =machine__process_aux_event (machine, event);break ;case PERF_RECORD_ITRACE_START : - ret =machine__process_itrace_start_event (machine, event); + ret =machine__process_itrace_start_event (machine, event);break ;case PERF_RECORD_LOST_SAMPLES : ret =machine__process_lost_samples_event (machine, event, sample);break ;break ;
But now you have break; break;
Isn't putting 'break' on the end of the line making things harder to read?
PATCH v2 1/1 perf tools: Add missing break for PERF_RECORD_ITRACE_START
Quoted 12 lines · Adrian Hunter
Quoted 11 lines · Jiri Olsa
Missing switch break since introduction of new event:
c4937a91ea56perf tools: handlePERF_RECORD_LOST_SAMPLESCc Kan Liang <[email protected]>Cc Adrian Hunter <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
tools/perf/util/machine.c int machine__process_event(struct machine *machine, union perf_event *event, · line 1454
Quoted 13 lines
tools/perf/util/machine.c +1
-1@@ -1448,7 +1448,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_AUX : ret =machine__process_aux_event (machine, event);break ;case PERF_RECORD_ITRACE_START : - ret =machine__process_itrace_start_event (machine, event); + ret =machine__process_itrace_start_event (machine, event);break ;case PERF_RECORD_LOST_SAMPLES : ret =machine__process_lost_samples_event (machine, event, sample);break ;break ;But now you have break; break;
hum, I did not see the PERF_RECORD_LOST_SAMPLES has 2 breaks already, anyway the one for PERF_RECORD_ITRACE_START is missing
Quoted 1 line
Isn't putting 'break' on the end of the line making things harder to read?
I guess, but looks like we dont have firm style in this.. attaching v2 with the extra break removal
thanks,
jirka
---
Missing switch break since introduction of new event:
c4937a91ea56 perf tools: handle PERF_RECORD_LOST_SAMPLES
Also removing unneeded break for PERF_RECORD_LOST_SAMPLES.
--- tools/perf/util/machine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/util/machine.c +1 -2
@@ -1448,10 +1448,9 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_AUX : ret =machine__process_aux_event (machine, event);break ;case PERF_RECORD_ITRACE_START : - ret =machine__process_itrace_start_event (machine, event); + ret =machine__process_itrace_start_event (machine, event);break ;case PERF_RECORD_LOST_SAMPLES : ret =machine__process_lost_samples_event (machine, event, sample);break ; -break ;default : ret =-1 ;break ;
Signature · 1 line
1.9.3
Em Mon, Jun 29, 2015 at 01:27:45PM +0200, Jiri Olsa escreveu:
Quoted 10 lines · Adrian Hunter
Quoted 1 line
But now you have break; break;
hum, I did not see the
PERF_RECORD_LOST_SAMPLEShas 2 breaks already, anyway the one forPERF_RECORD_ITRACE_STARTis missingQuoted 1 line
Isn't putting 'break' on the end of the line making things harder to read?
I guess, but looks like we dont have firm style in this.. attaching v2 with the extra break removal
Thanks, applied.
- Arnaldo
tip-bot for Jiri Olsa
merge botperf tools: Add missing break for PERF_RECORD_ITRACE_START
Commit-ID: ceb92913078e41e2305250754e0ea144fc3e9b28 Gitweb: http://git.kernel.org/tip/ceb92913078e41e2305250754e0ea144fc3e9b28 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 29 Jun 2015 13:27:45 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 1 Jul 2015 17:53:48 -0300
perf tools: Add missing break for PERF_RECORD_ITRACE_START
Missing switch break since introduction of new event:
c4937a91ea56 perf tools: handle PERF_RECORD_LOST_SAMPLES
Also removing unneeded break for PERF_RECORD_LOST_SAMPLES.
--- tools/perf/util/machine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/util/machine.c +1 -2
@@ -1448,10 +1448,9 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_AUX : ret =machine__process_aux_event (machine, event);break ;case PERF_RECORD_ITRACE_START : - ret =machine__process_itrace_start_event (machine, event); + ret =machine__process_itrace_start_event (machine, event);break ;case PERF_RECORD_LOST_SAMPLES : ret =machine__process_lost_samples_event (machine, event, sample);break ; -break ;default : ret =-1 ;break ;
Peter Zijlstra
maintainerQuoted 28 lines · Adrian Hunter
Quoted 16 lines · Jiri Olsa
Missing switch break since introduction of new event:
c4937a91ea56perf tools: handlePERF_RECORD_LOST_SAMPLESCc Kan Liang <[email protected]>Cc Adrian Hunter <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/machine.c +0
-0tools/perf/util/machine.c int machine__process_event(struct machine *machine, union perf_event *event, · line 1454
Quoted 8 lines
tools/perf/util/machine.c +1
-1@@ -1448,7 +1448,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_AUX : ret =machine__process_aux_event (machine, event);break ;case PERF_RECORD_ITRACE_START : - ret =machine__process_itrace_start_event (machine, event); + ret =machine__process_itrace_start_event (machine, event);break ;case PERF_RECORD_LOST_SAMPLES : ret =machine__process_lost_samples_event (machine, event, sample);break ;break ;But now you have break; break;
Quoted 1 line
Isn't putting 'break' on the end of the line making things harder to read?
I would tend to agree, its a very odd style.
Arnaldo Carvalho de Melo
maintainerEm Mon, Jun 29, 2015 at 01:47:14PM +0200, Peter Zijlstra escreveu:
Quoted 15 lines · Adrian Hunter
Quoted 13 lines · Jiri Olsa
tools/perf/util/machine.c int machine__process_event(struct machine *machine, union perf_event *event, · line 1454
Quoted 10 lines
+++
b/tools/perf/util/machine.ctools/perf/util/machine.c +1
-1@@ -1448,7 +1448,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_AUX : ret =machine__process_aux_event (machine, event);break ;case PERF_RECORD_ITRACE_START : - ret =machine__process_itrace_start_event (machine, event); + ret =machine__process_itrace_start_event (machine, event);break ;case PERF_RECORD_LOST_SAMPLES : ret =machine__process_lost_samples_event (machine, event, sample);break ;break ;But now you have break; break;
Quoted 3 lines
Quoted 1 line
Isn't putting 'break' on the end of the line making things harder to read?
I would tend to agree, its a very odd style.
Humm, there are two cases in tools/perf/, where it was made (hey, I am to blame) for really simple stuff like:
case A: B(); break;
To make it more compact.
But I just checked and this is not that uncommon:
[acme@zoo linux]$ find . -name "*.[ch]" | xargs grep ';.*break' | wc -l 5035
[acme@zoo linux]$ find arch -name "*.[ch]" | xargs grep ';.*break' | wc -l 1440
[acme@zoo linux]$ find block -name "*.[ch]" | xargs grep ';.*break' | wc -l 7
[acme@zoo linux]$ find crypto -name "*.[ch]" | xargs grep ';.*break' | wc -l 0
[acme@zoo linux]$ find fs -name "*.[ch]" | xargs grep ';.*break' | wc -l 66
[acme@zoo linux]$ find kernel -name "*.[ch]" | xargs grep ';.*break' | wc -l 11
[acme@zoo linux]$ find mm -name "*.[ch]" | xargs grep ';.*break' | wc -l 3
[acme@zoo linux]$
But I am not that attached to it, as said, just two cases :)
- Arnaldo
Quoted 2 lines · Jiri Olsa
Missing switch break since introduction of new event:
c4937a91ea56perf tools: handlePERF_RECORD_LOST_SAMPLES
[]
tools/perf/util/machine.c
Quoted 1 line
tools/perf/util/machine.c +0
-0
[]
tools/perf/util/machine.c int machine__process_event(struct machine *machine, union perf_event *event, · line 1454
Quoted 9 lines
tools/perf/util/machine.c +1
-1@@ -1448,7 +1448,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_AUX : ret =machine__process_aux_event (machine, event);break ;case PERF_RECORD_ITRACE_START : - ret =machine__process_itrace_start_event (machine, event); + ret =machine__process_itrace_start_event (machine, event);break ;case PERF_RECORD_LOST_SAMPLES : ret =machine__process_lost_samples_event (machine, event, sample);break ;break ;
trivia: There's a duplicate/unreachable break;
on the PERF_RECORD_LOST_SAMPLES case