From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] trace: fix simple trace "disable" keyword
Date: Thu, 16 Jan 2014 14:24:20 +0800 [thread overview]
Message-ID: <20140116062420.GA14680@stefanha-thinkpad> (raw)
In-Reply-To: <1389756247-9425-1-git-send-email-stefanha@redhat.com>
On Wed, Jan 15, 2014 at 11:24:07AM +0800, Stefan Hajnoczi wrote:
> The trace-events "disable" keyword turns an event into a nop at
> compile-time. This is important for high-frequency events that can
> impact performance.
>
> The "disable" keyword is currently broken in the simple trace backend.
> This patch fixes the problem as follows:
>
> Trace events are identified by their TraceEventID number. When events
> are disabled there are two options for assigning TraceEventID numbers:
> 1. Skip disabled events and don't assign them a number.
> 2. Assign numbers for all events regardless of the disabled keyword.
>
> The simple trace backend and its binary file format uses approach #1.
>
> The tracetool infrastructure has been using approach #2 for a while.
>
> The result is that the numbers used in simple trace files do not
> correspond with TraceEventIDs. In trace/simple.c we assumed that they
> are identical and therefore emitted bogus numbers.
>
> This patch fixes the bug by using TraceEventID for trace_event_id()
> while sticking to approach #1 for simple trace file numbers. This
> preserves simple trace file format compatibility.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> scripts/tracetool/backend/simple.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing
I applied this fairly quickly, so feel free to speak up if you have any
code review feedback. I can still drop it from the tracing queue before
sending the next pull request.
Stefan
prev parent reply other threads:[~2014-01-16 6:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 3:24 [Qemu-devel] [PATCH] trace: fix simple trace "disable" keyword Stefan Hajnoczi
2014-01-16 6:24 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140116062420.GA14680@stefanha-thinkpad \
--to=stefanha@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).