lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150629130549.GA11747@kernel.org>
Date:	Mon, 29 Jun 2015 10:05:49 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Adrian Hunter <adrian.hunter@...el.com>,
	Jiri Olsa <jolsa@...nel.org>, Kan Liang <kan.liang@...el.com>,
	lkml <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH perf/core] perf tools: Add missing break for
 PERF_RECORD_ITRACE_START

Em Mon, Jun 29, 2015 at 01:47:14PM +0200, Peter Zijlstra escreveu:
> On Mon, Jun 29, 2015 at 02:17:18PM +0300, Adrian Hunter wrote:
> > On 29/06/15 14:12, Jiri Olsa wrote:
> > > +++ b/tools/perf/util/machine.c
> > > @@ -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?
 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ