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]
Message-ID: <aa62d0ed-abca-2123-c8bf-cd6bced2fe9c@linux.intel.com>
Date:   Fri, 8 Oct 2021 11:42:18 +0300
From:   "Bayduraev, Alexey V" <alexey.v.bayduraev@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Andi Kleen <ak@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Alexander Antonov <alexander.antonov@...ux.intel.com>,
        Alexei Budankov <abudankov@...wei.com>,
        Riccardo Mancini <rickyman7@...il.com>
Subject: Re: [PATCH v3 6/8] perf session: Move event read code to separate
 function



On 08.10.2021 10:33, Jiri Olsa wrote:
> On Thu, Oct 07, 2021 at 01:25:41PM +0300, Alexey Bayduraev wrote:
> 
> SNIP
> 
>>  static int
>> -reader__process_events(struct reader *rd, struct perf_session *session,
>> -		       struct ui_progress *prog)
>> +reader__read_event(struct reader *rd, struct perf_session *session,
>> +		   struct ui_progress *prog)
>>  {
>>  	u64 size;
>>  	int err = 0;
>>  	union perf_event *event;
>>  	s64 skip;
>>  
>> -	err = reader__init(rd, &session->one_mmap);
>> -	if (err)
>> -		goto out;
>> -
>> -remap:
>> -	err = reader__mmap(rd, session);
>> -	if (err)
>> -		goto out;
>> -
>> -more:
>>  	event = fetch_mmaped_event(rd->head, rd->mmap_size, rd->mmap_cur,
>>  				   session->header.needs_swap);
>>  	if (IS_ERR(event))
>>  		return PTR_ERR(event);
>>  
>>  	if (!event)
>> -		goto remap;
>> +		return 1;
>>  
>>  	session->active_decomp = &rd->decomp_data;
>>  	size = event->header.size;
>> @@ -2311,6 +2301,33 @@ reader__process_events(struct reader *rd, struct perf_session *session,
>>  
>>  	ui_progress__update(prog, size);
>>  
>> +out:
>> +	session->active_decomp = &session->decomp_data;
>> +	return err;
>> +}
>> +
>> +static int
>> +reader__process_events(struct reader *rd, struct perf_session *session,
>> +		       struct ui_progress *prog)
>> +{
>> +	int err;
>> +
>> +	err = reader__init(rd, &session->one_mmap);
>> +	if (err)
>> +		goto out;
>> +
>> +remap:
>> +	err = reader__mmap(rd, session);
>> +	if (err)
>> +		goto out;
>> +
>> +more:
>> +	err = reader__read_event(rd, session, prog);
>> +	if (err < 0)
>> +		goto out;
>> +	else if (err == 1)
>> +		goto remap;
>> +
>>  	if (session_done())
>>  		goto out;
>>  
>> @@ -2318,7 +2335,6 @@ reader__process_events(struct reader *rd, struct perf_session *session,
>>  		goto more;
>>  
>>  out:
>> -	session->active_decomp = &session->decomp_data;
> 
> active_decomp should be set/unset within reader__process_events,
> not just for single event read, right?

No, it should be set before perf_session__process_event/process_decomp_events
and unset after these calls. So active_decomp setting/unsetting is moved in
this patch to the reader__read_event function. This is necessary for multiple
trace reader because it could call reader__read_event in round-robin manner.

Regards,
Alexey

> 
> jirka
> 
>>  	return err;
>>  }
>>  
>> -- 
>> 2.19.0
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ