qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Lluís Vilanova" <vilanova@ac.upc.edu>,
	"Stefan Hajnoczi" <stefanha@redhat.com>
Subject: [Qemu-devel] [PULL 13/13] trace: Add a proper API to manage auto-generated events from the 'tcg' property
Date: Tue,  1 Mar 2016 15:48:14 +0000	[thread overview]
Message-ID: <1456847294-13576-14-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1456847294-13576-1-git-send-email-stefanha@redhat.com>

From: Lluís Vilanova <vilanova@ac.upc.edu>

Formalizes the existence of the 'event_trans' and 'event_exec' event
attributes, which until now were monkey-patched only when necessary.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Message-id: 145640558759.20978.6374959404425591089.stgit@localhost
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 scripts/tracetool/__init__.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 23caba0..be24039 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -163,7 +163,8 @@ class Event(object):
 
     _VALID_PROPS = set(["disable", "tcg", "tcg-trans", "tcg-exec", "vcpu"])
 
-    def __init__(self, name, props, fmt, args, orig=None):
+    def __init__(self, name, props, fmt, args, orig=None,
+                 event_trans=None, event_exec=None):
         """
         Parameters
         ----------
@@ -176,13 +177,19 @@ class Event(object):
         args : Arguments
             Event arguments.
         orig : Event or None
-            Original Event before transformation.
+            Original Event before transformation/generation.
+        event_trans : Event or None
+            Generated translation-time event ("tcg" property).
+        event_exec : Event or None
+            Generated execution-time event ("tcg" property).
 
         """
         self.name = name
         self.properties = props
         self.fmt = fmt
         self.args = args
+        self.event_trans = event_trans
+        self.event_exec = event_exec
 
         if orig is None:
             self.original = weakref.ref(self)
@@ -198,7 +205,7 @@ class Event(object):
     def copy(self):
         """Create a new copy."""
         return Event(self.name, list(self.properties), self.fmt,
-                     self.args.copy(), self)
+                     self.args.copy(), self, self.event_trans, self.event_exec)
 
     @staticmethod
     def build(line_str):
-- 
2.5.0

  parent reply	other threads:[~2016-03-01 15:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 15:48 [Qemu-devel] [PULL 00/13] Tracing patches Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 01/13] trace: drop trailing empty strings Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 02/13] trace: docs: "simple" backend does support strings Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 03/13] trace: split subpage MMIOs into their own trace events Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 04/13] trace: use addresses instead of offsets in memory tracepoints Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 05/13] vl: fix tracing initialization Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 06/13] trace: Extend API to manage event arguments Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 07/13] trace: Remove unnecessary intermediate event copies Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 08/13] tcg: Add type for vCPU pointers Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 09/13] tcg: Move definition of type TCGv Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 10/13] trace: Add helper function to cast event arguments Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 11/13] typedefs: Add CPUState Stefan Hajnoczi
2016-03-01 15:48 ` [Qemu-devel] [PULL 12/13] trace: Add 'vcpu' event property to trace guest vCPU Stefan Hajnoczi
2016-03-01 15:48 ` Stefan Hajnoczi [this message]
2016-03-01 16:47 ` [Qemu-devel] [PULL 00/13] Tracing patches Peter Maydell

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=1456847294-13576-14-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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).