Re: [PATCH 2/3] perf tools: Cache dso data file descriptor

From: Namhyung Kim
Date: Sun Apr 27 2014 - 10:36:50 EST


2014-04-17 (ë), 19:39 +0200, Jiri Olsa:
> Keeping the data file description open for the whole life
> of the dso object.

I suspect there might be an issue for reporting very large data file
with this approach - like open file limit?


[SNIP]
> @@ -168,8 +174,8 @@ int dso__data_fd(struct dso *dso, struct machine *machine)
> };
> int i = 0;
>
> - if (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND)
> - return open_dso(dso, machine);

Why did you remove this line?

Thanks,
Namhyung


> + if (dso->data_fd >= 0)
> + return dso->data_fd;
>
> do {
> int fd;
> @@ -178,7 +184,7 @@ int dso__data_fd(struct dso *dso, struct machine *machine)
>
> fd = open_dso(dso, machine);
> if (fd >= 0)
> - return fd;
> + return dso->data_fd = fd;
>
> } while (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND);


--
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/