qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 08/17] trace: remove the TraceEventID and Tra


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4 08/17] trace: remove the TraceEventID and TraceEventVCPUID enums
Date: Fri, 23 Sep 2016 15:23:44 +0100
User-agent: Mutt/1.7.0 (2016-08-17)

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 <address@hidden>
> ---
>  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 <address@hidden>

Attachment: signature.asc
Description: PGP signature


reply via email to

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