qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 6/8] trace: switch to modular code generation


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH v3 6/8] trace: switch to modular code generation for sub-directories
Date: Wed, 25 Jan 2017 16:08:24 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

On Tue, Jan 24, 2017 at 08:53:57PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > Introduce rules in the top level Makefile that are able to generate
> > trace.[ch] files in every subdirectory which has a trace-events file.
> 
> > The top level directory is handled specially, so instead of creating
> > trace.h, it creates trace-root.h. This allows sub-directories to
> > include the top level trace-root.h file, without ambiguity wrt to
> > the trace.g file in the current sub-dir.
> 
> > Signed-off-by: Daniel P. Berrange <address@hidden>
> [...]
> > diff --git a/Makefile b/Makefile
> > index 9f8968d..a8fa28a 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -56,25 +56,136 @@ GENERATED_SOURCES += qmp-marshal.c qapi-types.c 
> > qapi-visit.c qapi-event.c
> >  GENERATED_HEADERS += qmp-introspect.h
> >  GENERATED_SOURCES += qmp-introspect.c
>  
> > -GENERATED_HEADERS += trace/generated-tracers.h
> > -ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
> > -GENERATED_HEADERS += trace/generated-tracers-dtrace.h
> > -endif
> > -GENERATED_SOURCES += trace/generated-tracers.c
> > -
> >  GENERATED_HEADERS += trace/generated-tcg-tracers.h
>  
> >  GENERATED_HEADERS += trace/generated-helpers-wrappers.h
> >  GENERATED_HEADERS += trace/generated-helpers.h
> >  GENERATED_SOURCES += trace/generated-helpers.c
>  
> > -ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
> > -GENERATED_HEADERS += trace/generated-ust-provider.h
> > -GENERATED_SOURCES += trace/generated-ust.c
> > +ifdef CONFIG_TRACE_UST
> > +GENERATED_HEADERS += trace-ust-all.h
> > +GENERATED_SOURCES += trace-ust-all.c
> >  endif
>  
> >  GENERATED_HEADERS += module_block.h
>  
> > +TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h)
> > +TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c)
> > +TRACE_DTRACE =
> > +ifdef CONFIG_TRACE_DTRACE
> > +TRACE_HEADERS += trace-dtrace-root.h 
> > $(trace-events-subdirs:%=%/trace-dtrace.h)
> > +TRACE_DTRACE += trace-dtrace-root.dtrace 
> > $(trace-events-subdirs:%=%/trace-dtrace.dtrace)
> > +endif
> > +ifdef CONFIG_TRACE_UST
> > +TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h)
> > +endif
> > +
> > +GENERATED_HEADERS += $(TRACE_HEADERS)
> > +GENERATED_SOURCES += $(TRACE_SOURCES)
> > +
> > +trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
> > +
> > +%/trace.h: %/trace.h-timestamp
> > +   @cmp $< $@ >/dev/null 2>&1 || cp $< $@
> > +%/trace.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y)
> > +   $(call quiet-command,$(TRACETOOL) \
> > +           --group=$(call trace-group-name,$@) \
> 
> Shouldn't you call trace-group-name with $*? To make sure it only contains the
> directories *below* SRC_PATH.

$@ is a relative path already

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



reply via email to

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