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:   Fri, 2 Nov 2018 19:12:57 +0300
From:   Alexey Budankov <alexey.budankov@...ux.intel.com>
To:     Song Liu <liu.song.a23@...il.com>
Cc:     Peter Zijlstra <peterz@...radead.org>, mingo@...hat.com,
        acme@...nel.org, alexander.shishkin@...ux.intel.com,
        jolsa@...hat.com, namhyung@...nel.org, ak@...ux.intel.com,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v14 3/3]: perf record: extend trace writing to multi AIO

Hi,

On 01.11.2018 21:30, Song Liu wrote:
> On Sun, Oct 14, 2018 at 11:47 PM Alexey Budankov
> <alexey.budankov@...ux.intel.com> wrote:
>>
<SNIP>
>>
>>
>>  static int nr_cblocks_default = 1;
>>
>>  static int record__aio_parse(const struct option *opt,
>> -                            const char *str __maybe_unused,
>> +                            const char *str,
>>                              int unset)
>>  {
>>         struct record_opts *opts = (struct record_opts *)opt->value;
>>
>> -       if (unset)
>> +       if (unset) {
>>                 opts->nr_cblocks = 0;
>> -       else
>> -               opts->nr_cblocks = nr_cblocks_default;
>> +       } else {
>> +               if (str)
>> +                       opts->nr_cblocks = strtol(str, NULL, 0);
>> +               if (!opts->nr_cblocks)
>> +                       opts->nr_cblocks = nr_cblocks_default;
>> +       }
>>
>>         return 0;
>>  }
>>  #else /* HAVE_AIO_SUPPORT */
<SNIP>
>> @@ -1492,6 +1517,13 @@ static int perf_record_config(const char *var, const char *value, void *cb)
>>                 var = "call-graph.record-mode";
>>                 return perf_default_config(var, value, cb);
>>         }
>> +#ifdef HAVE_AIO_SUPPORT
>> +       if (!strcmp(var, "record.aio")) {
>> +               rec->opts.nr_cblocks = strtol(value, NULL, 0);
>> +               if (!rec->opts.nr_cblocks)
>> +                       rec->opts.nr_cblocks = nr_cblocks_default;
>> +       }
>> +#endif
>>
>>         return 0;
>>  }
>> @@ -1884,8 +1916,8 @@ static struct option __record_options[] = {
>>         OPT_BOOLEAN(0, "dry-run", &dry_run,
>>                     "Parse options then exit"),
>>  #ifdef HAVE_AIO_SUPPORT
>> -       OPT_CALLBACK_NOOPT(0, "aio", &record.opts,
>> -                    NULL, "Enable asynchronous trace writing mode",
>> +       OPT_CALLBACK_OPTARG(0, "aio", &record.opts,
>> +                    &nr_cblocks_default, "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)",
>>                      record__aio_parse),
>>  #endif
>>         OPT_END()
>> @@ -2080,6 +2112,8 @@ int cmd_record(int argc, const char **argv)
>>                 goto out;
>>         }
>>
>> +       if (rec->opts.nr_cblocks > 4)
>> +               rec->opts.nr_cblocks = 4;
> nit: I feel this logic belongs to record__aio_parse(). And we should have
> 
> static int nr_cblocks_max = 4;

This looks reasonable.

Thanks,
Alexey

> 
> Other than this
> 
> Acked-by: Song Liu <songliubraving@...com>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ