Eric Blake <ebl...@redhat.com> writes: > On 07/28/2017 12:01 PM, Markus Armbruster wrote: >> "Denis V. Lunev" <d...@openvz.org> writes: >> >>> Calculate req_json only if trace_handle_qmp_command enabled. >>> >>> Signed-off-by: Denis V. Lunev <d...@openvz.org> >>> CC: Stefan Hajnoczi <stefa...@redhat.com> >>> CC: LluĂs Vilanova <vilan...@ac.upc.edu> >>> CC: Dr. David Alan Gilbert <dgilb...@redhat.com> >>> CC: Markus Armbruster <arm...@redhat.com> >>> --- > >> Conflicts with Eric's commit 8a4613a, but I can resolve that in my tree. >> >> The commit message is too terse. "Improve tracing" makes me think of >> more informative traces, but that's not the case. What exactly is >> improved here? > > Reduce overhead when not tracing. Without the patch, we are malloc'ing > a QString and spending CPU cycles on converting a QObject to string, > just for the sake of sticking the string in the trace message - if we > aren't tracing, it's wasted effort.
What about: monitor: Reduce handle_qmp_command() tracing overhead We are malloc'ing a QString and spending CPU cycles on converting a QObject to string, just for the sake of sticking the string in the trace message. Wasted when we aren't tracing. Avoid that. Denis?