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:	Wed, 29 Apr 2015 14:26:34 +0300
From:	Adrian Hunter <adrian.hunter@...el.com>
To:	Jiri Olsa <jolsa@...hat.com>
CC:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Namhyung Kim <namhyung@...il.com>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH V3 04/25] perf tools: Add AUX area tracing index

On 28/04/15 15:07, Jiri Olsa wrote:
> On Fri, Apr 24, 2015 at 10:29:46PM +0300, Adrian Hunter wrote:
> 
> SNIP
> 
>> +
>> +int auxtrace_index__process(int fd, u64 size, struct perf_session *session,
>> +			    bool needs_swap)
>> +{
>> +	struct list_head *head = &session->auxtrace_index;
>> +	u64 nr;
>> +
>> +	if (readn(fd, &nr, sizeof(u64)) != sizeof(u64))
>> +		return -1;
>> +
>> +	if (needs_swap)
>> +		nr = bswap_64(nr);
>> +
>> +	if (sizeof(u64) + nr * sizeof(struct auxtrace_index_entry) != size)
>> +		return -1;
> 
> so the total nr is only used to double check the data size is correct,
> it could be omited and you could use just the size of the section..
> also the auxtrace_index__write would be shorter of one loop
> 
> but no big deal.. just asking ;-)

I would like to have it as a check that the file structure is the way it is
meant to be.

Also I will change it to " > size" so that more stuff can be added to the
section in the future.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists