Re: [PATCH v1 2/3] perf version: Print the status of compiled-in libraries

From: Jiri Olsa
Date: Tue Mar 27 2018 - 09:36:00 EST


On Tue, Mar 27, 2018 at 09:17:57PM +0800, Jin, Yao wrote:

SNIP

> > +#define IS_BUILTIN(option) __is_defined(option)
> > +
> > +
> > +static void status_print(const char *name, const char *status)
> > +{
> > + printf("%22s: [ %3s ]\n", name, status);
> > +}
> > +
> > int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused)
> > {
> > printf("perf version %s\n", perf_version_string);
> > +
> > +#define STATUS(__d, __m) \
> > + if (IS_BUILTIN(__d)) \
> > + status_print(#__m, "on"); \
> > + else \
> > + status_print(#__m, "OFF");
> > +
> > + STATUS(HAVE_DWARF_SUPPORT, dwarf)
> > + STATUS(HAVE_KRAVA_SUPPORT, krava)
> > return 0;
> > }
> >
>
> Hi Jiri,
>
> It looks we need to copy the IS_BUILTIN and associated macro definitions to
> a common header file.
>
> I guess you will post this patch if Arnaldo agree with this idea, right?
>
> I plan to post v2 of this patch series after this 'IS_BUILTIN' patch gets
> merged.


please post patch below with your patchset
and feel free to change it if needed

thanks,
jirka


---