Re: [Qemu-devel] [PATCH 2/6] hypertrace: Add tracing event "guest_hypertrace"

2016-08-18 Thread Lluís Vilanova
Stefan Hajnoczi writes:

> On Fri, Aug 05, 2016 at 06:59:34PM +0200, Lluís Vilanova wrote:
>> +# hypertrace
>> +hyperargs=$hypertrace
>> +if test $hypertrace = "disabled"; then
>> +hyperargs=0
>> +fi
>> +echo "CONFIG_HYPERTRACE_ARGS=$hyperargs" >> $config_host_mak
>> +hypertrace_events=hypertrace/trace-events
>> +mkdir -p $(dirname $hypertrace_events)
>> +echo "# See docs/trace-events.txt for syntax documentation." 
>> >$hypertrace_events
>> +echo -n 'vcpu guest_hypertrace(' >>$hypertrace_events
>> +for i in `seq $hypertrace`; do
>> +if test $i != 1; then
>> +echo -n ", " >>$hypertrace_events
>> +fi
>> +echo -n "uint64_t arg$i" >>$hypertrace_events
>> +done
>> +echo -n ') ' >>$hypertrace_events
>> +for i in `seq $hypertrace`; do
>> +echo -n "\" arg$i=0x%016\"PRIx64" >>$hypertrace_events
>> +done
>> +echo >>$hypertrace_events

> This reminds me of the first versions of "simpletrace" where the number
> of arguments was fixed and argument size was fixed.

> This meant strings cannot be traced, number of arguments is limited, and
> you pay an space overhead for unused arguments.

> Later on the format was changed to header (including .length field) and
> binary data payload.  This reduced the space overhead, elminated the
> argument count limit, and allowed strings to be traced.

> I think these are desirable qualities for any tracing mechanism and
> would reconsider a fixed number of uint64_t arguments.

The number of arguments is fixed at *compilation time*. What is not supported
out of the box is multiplexing multiple guest events over the hypertrace
event. That is, you need to do it yourself when post-processing the traces, but
I don't think that's too bad.


Cheers,
  Lluis



Re: [Qemu-devel] [PATCH 2/6] hypertrace: Add tracing event "guest_hypertrace"

2016-08-18 Thread Stefan Hajnoczi
On Fri, Aug 05, 2016 at 06:59:34PM +0200, Lluís Vilanova wrote:
> +# hypertrace
> +hyperargs=$hypertrace
> +if test $hypertrace = "disabled"; then
> +hyperargs=0
> +fi
> +echo "CONFIG_HYPERTRACE_ARGS=$hyperargs" >> $config_host_mak
> +hypertrace_events=hypertrace/trace-events
> +mkdir -p $(dirname $hypertrace_events)
> +echo "# See docs/trace-events.txt for syntax documentation." 
> >$hypertrace_events
> +echo -n 'vcpu guest_hypertrace(' >>$hypertrace_events
> +for i in `seq $hypertrace`; do
> +if test $i != 1; then
> +echo -n ", " >>$hypertrace_events
> +fi
> +echo -n "uint64_t arg$i" >>$hypertrace_events
> +done
> +echo -n ') ' >>$hypertrace_events
> +for i in `seq $hypertrace`; do
> +echo -n "\" arg$i=0x%016\"PRIx64" >>$hypertrace_events
> +done
> +echo >>$hypertrace_events

This reminds me of the first versions of "simpletrace" where the number
of arguments was fixed and argument size was fixed.

This meant strings cannot be traced, number of arguments is limited, and
you pay an space overhead for unused arguments.

Later on the format was changed to header (including .length field) and
binary data payload.  This reduced the space overhead, elminated the
argument count limit, and allowed strings to be traced.

I think these are desirable qualities for any tracing mechanism and
would reconsider a fixed number of uint64_t arguments.

Stefan


signature.asc
Description: PGP signature