linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v13 3/3]: perf record: extend trace writing to multi AIO
Date: Fri, 12 Oct 2018 19:28:23 +0300	[thread overview]
Message-ID: <2e62d730-df83-19f4-6289-3e67583ea54d@linux.intel.com> (raw)
In-Reply-To: <20181012141736.GB30156@krava>

Hi,

On 12.10.2018 17:17, Jiri Olsa wrote:
> On Thu, Oct 11, 2018 at 09:59:19PM +0300, Alexey Budankov wrote:
> 
> SNIP
> 
>> @@ -1490,6 +1514,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 = 1;
>> +	}
>> +#endif
>>  
>>  	return 0;
>>  }
>> @@ -1882,8 +1913,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(0, "aio", &record.opts,
>> +		     "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)",
>>  		     record__aio_parse),
> 
> it stoped work with no argument:
> 
> [jolsa@krava perf]$ ./perf record --aio ls
> Error:
> You may not have permission to collect system-wide stats.

This is the fix below. However, perf record --aio -- ls works without it.
I will resend the whole patch kit.

Thanks,
Alexey

---
 tools/perf/builtin-record.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index b048ede546d4..935adec937d9 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -284,13 +284,15 @@ static int record__aio_parse(const struct option *opt,
        if (unset) {
                opts->nr_cblocks = 0;
        } else {
-               opts->nr_cblocks = strtol(str, NULL, 0);
+               if (str)
+                       opts->nr_cblocks = strtol(str, NULL, 0);
                if (!opts->nr_cblocks)
                        opts->nr_cblocks = 1;
        }
 
        return 0;
 }
+static int nr_cblocks_default = 1;
 #else /* HAVE_AIO_SUPPORT */
 static int record__aio_sync(struct perf_mmap *md __maybe_unused, bool sync_all __maybe_unused)
 {
@@ -1913,8 +1915,8 @@ static struct option __record_options[] = {
        OPT_BOOLEAN(0, "dry-run", &dry_run,
                    "Parse options then exit"),
 #ifdef HAVE_AIO_SUPPORT
-       OPT_CALLBACK(0, "aio", &record.opts,
-                    "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)",
+       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()

  reply	other threads:[~2018-10-12 16:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 18:35 [PATCH v13 0/3]: perf: reduce data loss when profiling highly parallel CPU bound workloads Alexey Budankov
2018-10-11 18:51 ` [PATCH v13 1/3]: perf util: map data buffer for preserving collected data Alexey Budankov
2018-10-11 18:55 ` [PATCH v13 2/3]: perf record: enable asynchronous trace writing Alexey Budankov
2018-10-11 18:59 ` [PATCH v13 3/3]: perf record: extend trace writing to multi AIO Alexey Budankov
2018-10-12  9:49   ` Namhyung Kim
2018-10-12 10:21     ` Alexey Budankov
2018-10-12 14:17   ` Jiri Olsa
2018-10-12 16:28     ` Alexey Budankov [this message]
2018-10-14 14:06       ` Jiri Olsa

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=2e62d730-df83-19f4-6289-3e67583ea54d@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).