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: <2340d60c-e8a6-2333-06ce-77076c912a1c@intel.com>
Date:   Mon, 7 Oct 2019 15:06:30 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] perf tools: Support single perf.data file directory

On 7/10/19 2:20 PM, Jiri Olsa wrote:
> On Fri, Oct 04, 2019 at 11:31:20AM +0300, Adrian Hunter wrote:
> 
> SNIP
> 
>>  	u8 pad[8] = {0};
>>  
>> -	if (!perf_data__is_pipe(data) && !perf_data__is_dir(data)) {
>> +	if (!perf_data__is_pipe(data) && perf_data__is_single_file(data)) {
>>  		off_t file_offset;
>>  		int fd = perf_data__fd(data);
>>  		int err;
>> diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c
>> index df173f0bf654..964ea101dba6 100644
>> --- a/tools/perf/util/data.c
>> +++ b/tools/perf/util/data.c
>> @@ -76,6 +76,13 @@ int perf_data__open_dir(struct perf_data *data)
>>  	DIR *dir;
>>  	int nr = 0;
>>  
>> +	/*
>> +	 * Directory containing a single regular perf data file which is already
>> +	 * open, means there is nothing more to do here.
>> +	 */
>> +	if (perf_data__is_single_file(data))
>> +		return 0;
>> +
> 
> cool, I like this approach much more than the previous flag

Yes it is much nicer.  Thanks for your direction on that.

> 
> any change you (if there's repost) or Arnaldo
> could squeeze in indent change below?

Sent a patch, to be applied before these.

> 
> thanks,
> jirka
> 
> 
> ---
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index bfa80fe8d369..7f567a521cea 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -227,8 +227,8 @@ struct perf_session *perf_session__new(struct perf_data *data,
>  			/* Open the directory data. */
>  			if (data->is_dir) {
>  				ret = perf_data__open_dir(data);
> -			if (ret)
> -				goto out_delete;
> +				if (ret)
> +					goto out_delete;
>  			}
>  
>  			if (!symbol_conf.kallsyms_name &&
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ