qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lluís <xscript@gmx.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/4] trace: always use the "nop" backend on events with the "disable" keyword
Date: Sun, 27 Mar 2011 21:43:25 +0200	[thread overview]
Message-ID: <20110327194325.622.66779.stgit@ginnungagap.bsc.es> (raw)
In-Reply-To: <20110327194249.622.69985.stgit@ginnungagap.bsc.es>

Any event with the keyword/property "disable" generates an empty trace event
using the "nop" backend, regardless of the current backend.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 docs/tracing.txt  |    3 +++
 scripts/tracetool |   15 ++-------------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/docs/tracing.txt b/docs/tracing.txt
index 5dbd3c0..49e030e 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -126,6 +126,9 @@ The "nop" backend generates empty trace event functions so that the compiler
 can optimize out trace events completely.  This is the default and imposes no
 performance penalty.
 
+Note that regardless of the selected trace backend, events with the "disable"
+property will be generated with the "nop" backend.
+
 === Stderr ===
 
 The "stderr" backend sends trace events directly to standard error.  This
diff --git a/scripts/tracetool b/scripts/tracetool
index 6d8ead2..7506776 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -506,21 +506,10 @@ convert()
         # Skip comments and empty lines
         test -z "${str%%#*}" && continue
 
+        echo
         # Process the line.  The nop backend handles disabled lines.
-        disable="0"
         if has_property "$str" "disable"; then
-            disable="1"
-        fi
-        echo
-        if [ "$disable" = "1" ]; then
-            # Pass the disabled state as an arg for the simple
-            # or DTrace backends which handle it dynamically.
-            # For all other backends, call lineto$1_nop()
-            if [ $backend = "simple" -o "$backend" = "dtrace" ]; then
-                "$process_line" "$str"
-            else
-                "lineto$1_nop" "${str##disable }"
-            fi
+            "lineto$1_nop" "$str"
         else
             "$process_line" "$str"
         fi

  parent reply	other threads:[~2011-03-27 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-27 19:42 [Qemu-devel] [PATCH 1/4] trace: [ust] fix generation of 'trace.c' on events without args Lluís
2011-03-27 19:43 ` [Qemu-devel] [PATCH 2/4] trace: generalize the "property" concept in the trace-events file Lluís
2011-03-27 19:43 ` Lluís [this message]
2011-03-27 19:43 ` [Qemu-devel] [PATCH 4/4] trace: [simple] always enable trace points Lluís
2011-03-28 12:31   ` Lluís
2011-03-28 12:39   ` Lluís

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=20110327194325.622.66779.stgit@ginnungagap.bsc.es \
    --to=xscript@gmx.net \
    --cc=qemu-devel@nongnu.org \
    /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).