Skip to content
Snippets Groups Projects
  • Markus Armbruster's avatar
    13d4ff07
    trace: Do not include qom/cpu.h into generated trace.h · 13d4ff07
    Markus Armbruster authored
    
    docs/devel/tracing.txt explains "since many source files include
    trace.h, [the generated trace.h use] a minimum of types and other
    header files included to keep the namespace clean and compile times
    and dependencies down."
    
    Commit 48151859 "trace: Add per-vCPU tracing states for events with
    the 'vcpu' property" made them all include qom/cpu.h via
    control-internal.h.  qom/cpu.h in turn includes about thirty headers.
    Ouch.
    
    Per-vCPU tracing is currently not supported in sub-directories'
    trace-events.  In other words, qom/cpu.h can only be used in
    trace-root.h, not in any trace.h.
    
    Split trace/control-vcpu.h off trace/control.h and
    trace/control-internal.h.  Have the generated trace.h include
    trace/control.h (which no longer includes qom/cpu.h), and trace-root.h
    include trace/control-vcpu.h (which includes it).
    
    The resulting improvement is a bit disappointing: in my "build
    everything" tree, some 1100 out of 6600 objects (not counting tests
    and objects that don't depend on qemu/osdep.h) depend on a trace.h,
    and about 600 of them no longer depend on qom/cpu.h.  But more than
    1300 others depend on trace-root.h.  More work is clearly needed.
    Left for another day.
    
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20190812052359.30071-8-armbru@redhat.com>
    13d4ff07
    History
    trace: Do not include qom/cpu.h into generated trace.h
    Markus Armbruster authored
    
    docs/devel/tracing.txt explains "since many source files include
    trace.h, [the generated trace.h use] a minimum of types and other
    header files included to keep the namespace clean and compile times
    and dependencies down."
    
    Commit 48151859 "trace: Add per-vCPU tracing states for events with
    the 'vcpu' property" made them all include qom/cpu.h via
    control-internal.h.  qom/cpu.h in turn includes about thirty headers.
    Ouch.
    
    Per-vCPU tracing is currently not supported in sub-directories'
    trace-events.  In other words, qom/cpu.h can only be used in
    trace-root.h, not in any trace.h.
    
    Split trace/control-vcpu.h off trace/control.h and
    trace/control-internal.h.  Have the generated trace.h include
    trace/control.h (which no longer includes qom/cpu.h), and trace-root.h
    include trace/control-vcpu.h (which includes it).
    
    The resulting improvement is a bit disappointing: in my "build
    everything" tree, some 1100 out of 6600 objects (not counting tests
    and objects that don't depend on qemu/osdep.h) depend on a trace.h,
    and about 600 of them no longer depend on qom/cpu.h.  But more than
    1300 others depend on trace-root.h.  More work is clearly needed.
    Left for another day.
    
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20190812052359.30071-8-armbru@redhat.com>