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:   Mon, 8 Oct 2018 15:24:31 +0300
From:   Alexey Budankov <alexey.budankov@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        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 v11 2/3]: perf record: enable asynchronous trace writing

Hi,

On 08.10.2018 13:52, Jiri Olsa wrote:
> On Mon, Oct 08, 2018 at 09:17:11AM +0300, Alexey Budankov wrote:
<SNIP>
>> +#ifdef HAVE_AIO_SUPPORT
>> +	off = lseek(trace_fd, 0, SEEK_CUR);
>> +#endif
> 
> I'm still little puzzled why we need to do this,
> when the aio write takes the offset value, but

pwrite() syscall [1] which is the base for aio_write() doesn't 
advance file pos value so it requires to be calculated and 
updated by callers of aio_write() API.

> please provide some aio_.. function for this

Accepted.

> 
> 
>>  	for (i = 0; i < evlist->nr_mmaps; i++) {
>>  		struct perf_mmap *map = &maps[i];
>>  
>>  		if (map->base) {
>> -			if (perf_mmap__push(map, rec, record__pushfn) != 0) {
>> -				rc = -1;
>> -				goto out;
>> +#ifdef HAVE_AIO_SUPPORT
>> +			if (!rec->opts.nr_cblocks) {
>> +#endif
>> +				if (perf_mmap__push(map, rec, record__pushfn) != 0) {
>> +					rc = -1;
>> +					goto out;
>> +				}
>> +#ifdef HAVE_AIO_SUPPORT
>> +			} else {
>> +				/*
>> +				 * Call record__aio_sync() to wait till map->data buffer
>> +				 * becomes available after previous aio write request.
>> +				 */
>> +				record__aio_sync(map);
>> +				if (perf_mmap__aio_push(map, rec, record__aio_pushfn, &off) != 0) {
>> +					lseek(trace_fd, off, SEEK_SET);
>> +					rc = -1;
>> +					goto out;
>> +				}
>>  			}
>> +#endif
>>  		}
>>  
>>  		if (map->auxtrace_mmap.base && !rec->opts.auxtrace_snapshot_mode &&
>> @@ -547,7 +694,9 @@ static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evli
>>  			goto out;
>>  		}
>>  	}
>> -
>> +#ifdef HAVE_AIO_SUPPORT
>> +	lseek(trace_fd, off, SEEK_SET);
>> +#endif
> 
> ditto

Accepted.

Thanks,
Alexey

> 
> thanks,
> jirka
> 

[1] http://man7.org/linux/man-pages/man2/pread.2.html


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ