On Fri, Jan 17, 2020 at 05:05:07PM +0000, Peter Maydell wrote: > On Fri, 17 Jan 2020 at 16:46, Guenter Roeck <li...@roeck-us.net> wrote: > > > > On Fri, Jan 17, 2020 at 01:23:46PM +0000, Peter Maydell wrote: > > > Won't this now do all the work of constructing the hexdump strings, > > > even if tracing is disabled ? > > > > > That is correct. Can I check > > if (trace_event_get_state(TRACE_PL330_HEXDUMP) && > > qemu_loglevel_mask(LOG_TRACE)) { > > directly in pl330_hexdump(), or is there some other means to handle > > this kind of situation ? > > It's not something I've had to do before. > docs/devel/tracing.txt says "just use the TRACE_FOO_ENABLED > macro", but looking at what it does that doesn't seem to check > the runtime state of the trace event, so maybe those docs are out > of date. Stefan, what's the current best way to guard expensive > computations used only for trace output ? > trace_event_get_state_backends(TRACE_PL330_HEXDUMP), maybe ?
Thanks, Guenter