Re: [PATCH RFC 3/6] perf dso: Add dso__data_write_cache_addr()

From: Jiri Olsa
Date: Mon Oct 28 2019 - 11:45:14 EST


On Fri, Oct 25, 2019 at 03:59:57PM +0300, Adrian Hunter wrote:
SNIP

>
> -static ssize_t data_read_offset(struct dso *dso, struct machine *machine,
> - u64 offset, u8 *data, ssize_t size)
> +static ssize_t data_read_write_offset(struct dso *dso, struct machine *machine,
> + u64 offset, u8 *data, ssize_t size,
> + bool out)
> {
> if (dso__data_file_size(dso, machine))
> return -1;
> @@ -1034,7 +1037,7 @@ static ssize_t data_read_offset(struct dso *dso, struct machine *machine,
> if (offset + size < offset)
> return -1;
>
> - return cached_read(dso, machine, offset, data, size);
> + return cached_io(dso, machine, offset, data, size, out);

you renamed the function as _read_write_ so the bool choosing
the opration should be named either read or write.. I had to
go all the way down to find out what 'out' means ;-)

jirka