qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile rules for module code gen
Date: Wed, 10 Aug 2016 15:48:57 +0100
User-agent: Mutt/1.6.2 (2016-07-01)

On Wed, Aug 10, 2016 at 04:18:44PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> [...]
> > diff --git a/Makefile b/Makefile
> > index 48673cb..2b9ba60 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -70,9 +70,55 @@ GENERATED_SOURCES += trace/generated-helpers.c
>  
> >  ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
> >  GENERATED_HEADERS += trace/generated-ust-provider.h
> > +GENERATED_HEADERS += trace/generated-ust-provider-all.h
> >  GENERATED_SOURCES += trace/generated-ust.c
> >  endif
>  
> > +GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace.h)
> > +GENERATED_SOURCES += $(trace-events-subdirs:%=%/trace.c)
> > +GENERATED_DTRACE =
> > +ifdef CONFIG_TRACE_DTRACE
> > +GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-dtrace.h)
> > +GENERATED_DTRACE += $(trace-events-subdirs:%=%/trace-dtrace.dtrace)
> > +endif
> > +ifdef CONFIG_TRACE_UST
> > +GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-ust.h)
> > +endif
> > +
> > +%/trace.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
> > +   $(call quiet-command,$(TRACETOOL) \
> > +           --format=h \
> > +           --backends=$(TRACE_BACKENDS) \
> > +           --group=$(shell dirname $@ | tr /- _) \
> > +           < $< > $@,"  GEN   $@")
> > +
> > +%/trace.c: $(SRC_PATH)/%/trace-events $(tracetool-y)
> > +   $(call quiet-command,$(TRACETOOL) \
> > +           --format=c \
> > +           --backends=$(TRACE_BACKENDS) \
> > +           --group=$(shell dirname $@ | tr /- _) \
> > +           < $< > $@,"  GEN   $@")
> > +
> > +%/trace-ust.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
> > +   $(call quiet-command,$(TRACETOOL) \
> > +           --format=ust-events-h \
> > +           --backends=$(TRACE_BACKENDS) \
> > +           --group=$(shell dirname $@ | tr /- _) \
> > +           < $< > $@,"  GEN   $@")
> > +
> > +%/trace-dtrace.dtrace: $(SRC_PATH)/%/trace-events 
> > $(BUILD_DIR)/config-host.mak $(tracetool-y)
> > +   $(call quiet-command,$(TRACETOOL) \
> > +           --format=d \
> > +           --backends=$(TRACE_BACKENDS) \
> > +           --group=$(shell dirname $@ | tr /- _) \
> > +           < $< > $@,"  GEN   $@")
> > +
> > +%/trace-dtrace.h: %/trace-dtrace.dtrace $(tracetool-y)
> > +   $(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
> > +
> > +%/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y)
> > +
> > +
> >  # Don't try to regenerate Makefile or configure
> >  # We don't generate any of them
> >  Makefile: ;
> 
> I'd rather keep the "generated-" prefix on all files that usually are not
> directly included by QEMU developers.

I don't think that's really needed - all these files are in sub-dirs
now and its a clear rule that  trace*.[hc] is auto-generated in every
sub-dir now. Also no oither code in QEMU thats auto-generated adds
this prefix on so trace is inconsistent with practice elsewhere.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]