mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
trace: Allocate cpu->trace_dstate in place
There's little point in dynamically allocating the bitmap if we know at compile-time the max number of events we want to support. Thus, make room in the struct for the bitmap, which will make things easier later: this paves the way for upcoming changes, in which we'll use a u32 to fully capture cpu->trace_dstate. This change also increases performance by saving a dereference and improving locality--note that this is important since upcoming work makes reading this bitmap fairly common. Signed-off-by: Emilio G. Cota <cota@braap.org> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 149915725977.6295.15069969323605305641.stgit@frigg.lan Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
4871b51b92
commit
d01c05c955
3 changed files with 11 additions and 15 deletions
|
@ -259,6 +259,7 @@ typedef void (*run_on_cpu_func)(CPUState *cpu, run_on_cpu_data data);
|
|||
struct qemu_work_item;
|
||||
|
||||
#define CPU_UNSET_NUMA_NODE_ID -1
|
||||
#define CPU_TRACE_DSTATE_MAX_EVENTS 32
|
||||
|
||||
/**
|
||||
* CPUState:
|
||||
|
@ -370,12 +371,8 @@ struct CPUState {
|
|||
struct KVMState *kvm_state;
|
||||
struct kvm_run *kvm_run;
|
||||
|
||||
/*
|
||||
* Used for events with 'vcpu' and *without* the 'disabled' properties.
|
||||
* Dynamically allocated based on bitmap requried to hold up to
|
||||
* trace_get_vcpu_event_count() entries.
|
||||
*/
|
||||
unsigned long *trace_dstate;
|
||||
/* Used for events with 'vcpu' and *without* the 'disabled' properties */
|
||||
DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS);
|
||||
|
||||
/* TODO Move common fields from CPUArchState here. */
|
||||
int cpu_index; /* used by alpha TCG */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue