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: Lluís Vilanova
Subject: Re: [Qemu-devel] [PATCH v3 6/8] trace: switch to modular code generation for sub-directories
Date: Tue, 24 Jan 2017 20:53:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

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.


Cheers,
  Lluis



reply via email to

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