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, 12 Oct 2018 19:28:23 +0300
From:   Alexey Budankov <alexey.budankov@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Andi Kleen <ak@...ux.intel.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v13 3/3]: perf record: extend trace writing to multi AIO

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@...va 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()

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ