From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
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 [thread overview]
Message-ID: <20170125160824.GC29006@redhat.com> (raw)
In-Reply-To: <87d1fci916.fsf@frigg.lan>
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 <berrange@redhat.com>
> [...]
> > 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/ :|
next prev parent reply other threads:[~2017-01-25 16:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 11:01 [Qemu-devel] [PATCH v3 0/8] Switch all subdirs over to modular trace.h file Daniel P. Berrange
2017-01-24 11:01 ` [Qemu-devel] [PATCH v3 1/8] make: move top level dir to end of include search path Daniel P. Berrange
2017-01-24 20:11 ` Eric Blake
2017-01-25 10:56 ` Daniel P. Berrange
2017-01-24 11:01 ` [Qemu-devel] [PATCH v3 2/8] trace: move hw/block/dataplane events to correct subdir Daniel P. Berrange
2017-01-25 13:43 ` Stefan Hajnoczi
2017-01-24 11:01 ` [Qemu-devel] [PATCH v3 3/8] trace: move hw/xen " Daniel P. Berrange
2017-01-25 13:43 ` Stefan Hajnoczi
2017-01-24 11:01 ` [Qemu-devel] [PATCH v3 4/8] trace: move hw/i386/xen " Daniel P. Berrange
2017-01-25 13:43 ` Stefan Hajnoczi
2017-01-24 11:01 ` [Qemu-devel] [PATCH v3 5/8] trace: move setting of group name into Makefiles Daniel P. Berrange
2017-01-25 14:03 ` Stefan Hajnoczi
2017-01-24 11:01 ` [Qemu-devel] [PATCH v3 6/8] trace: switch to modular code generation for sub-directories Daniel P. Berrange
2017-01-24 18:53 ` Lluís Vilanova
2017-01-25 16:08 ` Daniel P. Berrange [this message]
2017-01-25 14:38 ` Stefan Hajnoczi
2017-01-24 11:01 ` [Qemu-devel] [PATCH v3 7/8] trace: update docs to reflect new code generation approach Daniel P. Berrange
2017-01-25 14:41 ` Stefan Hajnoczi
2017-01-24 11:01 ` [Qemu-devel] [PATCH v3 8/8] trace: improve error reporting when parsing simpletrace header Daniel P. Berrange
2017-01-25 14:41 ` Stefan Hajnoczi
2017-01-25 14:42 ` [Qemu-devel] [PATCH v3 0/8] Switch all subdirs over to modular trace.h file Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170125160824.GC29006@redhat.com \
--to=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).