Re: [PATCH 06/14] perf tools: Cache dso data file descriptor

From: Namhyung Kim
Date: Mon May 26 2014 - 21:05:37 EST


Hi Jiri,

On Thu, 15 May 2014 19:23:27 +0200, Jiri Olsa wrote:

[SNIP]
> +static void data_close(void)
> +{
> + bool cache_fd = may_cache_fd();
> +
> + if (!cache_fd)
> + close_first_dso();
> +}

Why do you do this at close()? As long as there's no attempt to open a
new file, we can keep existing fd, no?

> +
> +void dso__data_close(struct dso *dso)
> +{
> + if (dso->data.fd >= 0)
> + data_close();
> +}

Hmm.. it's confusing dso__data_close(dso) closes an other dso rather
than the given dso. And this dso__data_close() is not paired with any
_open() also these close calls make me confusing which one to use. ;-p


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