[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150327143714.GC6291@redhat.com>
Date: Fri, 27 Mar 2015 11:37:14 -0300
From: Arnaldo Carvalho de Melo <acme@...hat.com>
To: Borislav Petkov <bp@...e.de>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
Adrian Hunter <adrian.hunter@...el.com>,
David Ahern <dsahern@...il.com>,
Don Zickus <dzickus@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Namhyung Kim <namhyung@...nel.org>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 14/25] perf symbols: Save DSO loading errno to better
report errors
Em Fri, Mar 27, 2015 at 11:32:43AM +0100, Borislav Petkov escreveu:
> On Tue, Mar 24, 2015 at 01:19:29PM -0300, Arnaldo Carvalho de Melo wrote:
> > + /*
> > + * This must have a same ordering as the enum dso_load_errno.
> > + */
> > + static const char *dso_load__error_str[] = {
> > + "Internal tools/perf/ library error",
> > + "Invalid ELF file",
> > + "Can not read build id",
> > + "Mismatching build id",
> > + "Decompression failure",
> > + };
>
> You could define this str array by using the dso_load_errno defines so
> that they're always in sync:
>
> static const char *dso_load__error_str[] = {
> [DSO_LOAD_ERRNO__INTERNAL_ERROR - __DSO_LOAD_ERRNO__START] = "Internal tools/perf/ library error",
> [DSO_LOAD_ERRNO__INVALID_ELF - __DSO_LOAD_ERRNO__START] = "Invalid ELF file",
> ...
>
> and even use a small macro to hide the __DSO_LOAD_ERRNO__START thing.
Right, good idea, I'll change both this and the code that was used as a
template.
- Arnaldo
--
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