* Alex Bennée (alex.ben...@linaro.org) wrote: > Now we have counts for each trace point we can expose them in the > monitor when the user queries what trace points are available. > > Signed-off-by: Alex Bennée <alex.ben...@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > --- > monitor.c | 5 +++-- > qapi/trace.json | 3 ++- > trace/qmp.c | 1 + > 3 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/monitor.c b/monitor.c > index c4677b502b..d8229cd2b0 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -1421,9 +1421,10 @@ static void hmp_info_trace_events(Monitor *mon, const > QDict *qdict) > } > > for (elem = events; elem != NULL; elem = elem->next) { > - monitor_printf(mon, "%s : state %u\n", > + monitor_printf(mon, "%s : state %u count %" PRIu64 "\n", > elem->value->name, > - elem->value->state == TRACE_EVENT_STATE_ENABLED ? 1 : > 0); > + elem->value->state == TRACE_EVENT_STATE_ENABLED ? 1 : > 0, > + elem->value->count); > } > qapi_free_TraceEventInfoList(events); > } > diff --git a/qapi/trace.json b/qapi/trace.json > index 799b254a18..b9184b0d18 100644 > --- a/qapi/trace.json > +++ b/qapi/trace.json > @@ -33,6 +33,7 @@ > # @name: Event name. > # @state: Tracing state. > # @vcpu: Whether this is a per-vCPU event (since 2.7). > +# @count: Current hits on trace-point (since 3.1). > # > # An event is per-vCPU if it has the "vcpu" property in the "trace-events" > # files. > @@ -40,7 +41,7 @@ > # Since: 2.2 > ## > { 'struct': 'TraceEventInfo', > - 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} } > + 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool', > 'count': 'int' } } > > ## > # @trace-event-get-state: > diff --git a/trace/qmp.c b/trace/qmp.c > index ea99b00956..cce8198091 100644 > --- a/trace/qmp.c > +++ b/trace/qmp.c > @@ -102,6 +102,7 @@ TraceEventInfoList *qmp_trace_event_get_state(const char > *name, > elem->value = g_new(TraceEventInfo, 1); > elem->value->vcpu = is_vcpu; > elem->value->name = g_strdup(trace_event_get_name(ev)); > + elem->value->count = ev->count; > > if (!trace_event_get_state_static(ev)) { > elem->value->state = TRACE_EVENT_STATE_UNAVAILABLE; > -- > 2.17.1 > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK