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] [day] [month] [year] [list]
Message-ID: <002d3bee-ae51-4a19-9eaa-8cdc63a97e86@intel.com>
Date:   Wed, 11 Aug 2021 13:18:47 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] perf script: Fix unnecessary machine_resolve()

On 10/08/21 9:25 pm, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 10, 2021 at 02:48:09PM +0300, Adrian Hunter escreveu:
>> machine_resolve() may have already been called. Test for that to avoid
>> calling it again unnecessarily.
> 
> By some dlfilter function, right...
> 
> Perhaps it would be better for machine__resolve() itself to check that?
> 
> Probably we'll need a 'force' arg, or have __machine__resolve() that
> does exactly what machine__resolve() does today and then tools wanting
> to force it to avoid using whatever is 'cached'?

Yes, or perhaps introduce machine__resolve_once() and thread__resolve_once() ?

> 
> - Arnaldo
>  
>> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
>> ---
>>  tools/perf/builtin-script.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
>> index e2e165b53499..f469354155f1 100644
>> --- a/tools/perf/builtin-script.c
>> +++ b/tools/perf/builtin-script.c
>> @@ -2212,7 +2212,7 @@ static int process_sample_event(struct perf_tool *tool,
>>  	if (filter_cpu(sample))
>>  		goto out_put;
>>  
>> -	if (machine__resolve(machine, &al, sample) < 0) {
>> +	if (!al.thread && machine__resolve(machine, &al, sample) < 0) {
>>  		pr_err("problem processing %d event, skipping it.\n",
>>  		       event->header.type);
>>  		ret = -1;
>> -- 
>> 2.17.1
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ