All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Song Liu <liu.song.a23@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, jolsa@redhat.com,
	namhyung@kernel.org, ak@linux.intel.com,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v14 3/3]: perf record: extend trace writing to multi AIO
Date: Fri, 2 Nov 2018 19:12:57 +0300	[thread overview]
Message-ID: <fd54bec6-83f0-e585-1087-dbc33da3c519@linux.intel.com> (raw)
In-Reply-To: <CAPhsuW52Vfsx7gfPppxH_E=6Y6xtMrWzCAx0=aJk0odm_q=ZzA@mail.gmail.com>

Hi,

On 01.11.2018 21:30, Song Liu wrote:
> On Sun, Oct 14, 2018 at 11:47 PM Alexey Budankov
> <alexey.budankov@linux.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@fb.com>
> 

  reply	other threads:[~2018-11-02 16:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  6:26 [PATCH v14 0/3]: perf: reduce data loss when profiling highly parallel CPU bound workloads Alexey Budankov
2018-10-15  6:42 ` [PATCH v14 1/3]: perf util: map data buffer for preserving collected data Alexey Budankov
2018-11-01 18:47   ` Song Liu
2018-11-02 16:14     ` Alexey Budankov
2018-10-15  6:44 ` [PATCH v14 2/3]: perf record: enable asynchronous trace writing Alexey Budankov
2018-11-01 18:42   ` Song Liu
2018-11-02 16:11     ` Alexey Budankov
2018-10-15  6:46 ` [PATCH v14 3/3]: perf record: extend trace writing to multi AIO Alexey Budankov
2018-11-01 18:30   ` Song Liu
2018-11-02 16:12     ` Alexey Budankov [this message]
2018-10-15 10:17 ` [PATCH v14 0/3]: perf: reduce data loss when profiling highly parallel CPU bound workloads Jiri Olsa
2018-10-25  7:59   ` Alexey Budankov
2018-10-25  8:54     ` Jiri Olsa
2018-10-25 11:12       ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd54bec6-83f0-e585-1087-dbc33da3c519@linux.intel.com \
    --to=alexey.budankov@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.song.a23@gmail.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.