Re: [BUG] perf report/annotate: consuming too many file descriptors

From: Namhyung Kim
Date: Fri Feb 14 2014 - 00:19:24 EST


Hi Stephane,

On Thu, 13 Feb 2014 17:26:30 +0100, Stephane Eranian wrote:
> Hi,
>
> Your patch does solve the file consumption problem on my test case.
> We still open and do the ELF read 5 times.

Cool. Could you also confirm what's the problem case - whether it's
stripped or static linked?

>
> Now, if on top of your patch, we also add the following, we save one
> open().

I think you need one more patch below on top of yours since the
filename__read_debuglink() always return -1.

Thanks,
Namhyung


diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 3e9f336740fa..8ac4a4fe2abd 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -506,6 +506,8 @@ int filename__read_debuglink(const char *filename, char *debuglink,
/* the start of this section is a zero-terminated string */
strncpy(debuglink, data->d_buf, size);

+ err = 0;
+
out_elf_end:
elf_end(elf);
out_close:

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