On Thu, Sep 22, 2016 at 09:40:43AM +0100, Daniel P. Berrange wrote:
> The TraceEventID and TraceEventVCPUID enums constants are
> no longer actually used for anything critical.
> 
> The TRACE_EVENT_COUNT limit is used to determine the size
> of the TraceEvents array, and can be removed if we just
> NULL terminate the array instead.
> 
> The TRACE_VCPU_EVENT_COUNT limit is used as a magic value
> for marking non-vCPU events, and also for declaring the
> size of the trace dstate mask in the CPUState struct.
> The former usage can be replaced by a dedicated constant
> TRACE_EVENT_VCPU_NONE, defined as (uint32_t)-1. For the
> latter usage, we can simply define a constant for the
> number of VCPUs, avoiding the need for the full enum.
> 
> The only other usages of the enum values can be replaced
> by accesing the id/vcpu_id fields via the named TraceEvent
> structs.
> 
> Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
> ---
>  scripts/tracetool/backend/simple.py  |  4 ++--
>  scripts/tracetool/format/events_c.py | 16 +++++++++++-----
>  scripts/tracetool/format/events_h.py | 18 +++---------------
>  scripts/tracetool/format/h.py        |  3 +--
>  trace/control-internal.h             | 19 ++++++++++---------
>  trace/control-target.c               |  2 +-
>  trace/control.c                      |  2 +-
>  trace/control.h                      | 31 ++++++++-----------------------
>  trace/event-internal.h               |  6 ++++++
>  trace/simple.c                       |  8 ++++----
>  trace/simple.h                       |  2 +-
>  11 files changed, 48 insertions(+), 63 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Attachment: signature.asc
Description: PGP signature

Reply via email to