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]
Date:	Thu, 23 Jun 2016 22:31:39 +0800
From:	pi3orama <pi3orama@....com>
To:	Nilay Vaish <nilayvaish@...il.com>
Cc:	Wang Nan <wangnan0@...wei.com>, acme@...nel.org,
	Linux Kernel list <linux-kernel@...r.kernel.org>,
	He Kuang <hekuang@...wei.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Jiri Olsa <jolsa@...nel.org>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Zefan Li <lizefan@...wei.com>
Subject: Re: [PATCH v10 07/10] perf record: Read from overwritable ring buffer



发自我的 iPhone

> 在 2016年6月23日,下午10:27,Nilay Vaish <nilayvaish@...il.com> 写道:
> 
>> On 23 June 2016 at 00:27, Wang Nan <wangnan0@...wei.com> wrote:
>> @@ -542,6 +568,79 @@ static struct perf_event_header finished_round_event = {
>>        .type = PERF_RECORD_FINISHED_ROUND,
>> };
>> 
>> +static void
>> +record__toggle_overwrite_evsels(struct record *rec,
>> +                               enum overwrite_evt_state state)
>> +{
>> +       struct perf_evlist *evlist = rec->overwrite_evlist;
>> +       enum overwrite_evt_state old_state = rec->overwrite_evt_state;
>> +       enum action {
>> +               NONE,
>> +               PAUSE,
>> +               RESUME,
>> +       } action = NONE;
>> +
>> +       switch (old_state) {
>> +       case OVERWRITE_EVT_RUNNING: {
>> +               switch (state) {
>> +               case OVERWRITE_EVT_DATA_PENDING:
>> +                       action = PAUSE;
>> +                       break;
>> +               case OVERWRITE_EVT_RUNNING:
>> +               case OVERWRITE_EVT_EMPTY:
>> +               default:
>> +                       goto state_err;
>> +               }
>> +               break;
>> +       }
>> +       case OVERWRITE_EVT_DATA_PENDING: {
>> +               switch (state) {
>> +               case OVERWRITE_EVT_EMPTY:
>> +                       break;
>> +               case OVERWRITE_EVT_RUNNING:
>> +               case OVERWRITE_EVT_DATA_PENDING:
>> +               default:
>> +                       goto state_err;
>> +               }
>> +               break;
>> +       }
>> +       case OVERWRITE_EVT_EMPTY: {
>> +               switch (state) {
>> +               case OVERWRITE_EVT_RUNNING:
>> +                       action = RESUME;
>> +                       break;
>> +               case OVERWRITE_EVT_EMPTY:
>> +               case OVERWRITE_EVT_DATA_PENDING:
>> +               default:
>> +                       goto state_err;
> 
> 
> Wang, thanks for making the changes I suggested.
> The patch overall looks fine to me.  Just as a matter
> of style, I probably would not write case labels that
> do not have any statements associated with them.
> I'll let default take care of those labels.
> 

I don't like them either.

You have to do this when you start working
on perf code. It turns on -Wall and -Werror,
without these case gcc will complain,
compiling will fail.

Thank you.

> --
> Nilay


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ