qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: qemu-devel@nongnu.org
Cc: blauwirbel@gmail.com, stefanha@gmail.com
Subject: [Qemu-devel] [PATCH v3 3/6] trace: [monitor] Use new event control interface
Date: Fri, 10 Feb 2012 15:28:49 +0100	[thread overview]
Message-ID: <20120210142849.13518.88459.stgit@ginnungagap.bsc.es> (raw)
In-Reply-To: <20120210142832.13518.22003.stgit@ginnungagap.bsc.es>

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 monitor.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/monitor.c b/monitor.c
index 5e099bd..010f659 100644
--- a/monitor.c
+++ b/monitor.c
@@ -617,10 +617,19 @@ static void do_trace_event_set_state(Monitor *mon, const QDict *qdict)
 {
     const char *tp_name = qdict_get_str(qdict, "name");
     bool new_state = qdict_get_bool(qdict, "option");
-    int ret = trace_event_set_state(tp_name, new_state);
 
-    if (!ret) {
-        monitor_printf(mon, "unknown event name \"%s\"\n", tp_name);
+    if (trace_event_is_pattern(tp_name)) {
+        TraceEvent *ev = NULL;
+        while ((ev = trace_event_pattern(tp_name, ev)) != NULL) {
+            trace_event_set_state_dynamic(ev, new_state);
+        }
+    } else {
+        TraceEvent *ev = trace_event_name(tp_name);
+        if (ev == NULL) {
+            monitor_printf(mon, "unknown event name \"%s\"\n", tp_name);
+        } else {
+            trace_event_set_state_dynamic(ev, new_state);
+        }
     }
 }
 

  parent reply	other threads:[~2012-02-10 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 14:28 [Qemu-devel] [PATCH v3 0/6] trace: Generic event state description Lluís Vilanova
2012-02-10 14:28 ` [Qemu-devel] [PATCH v3 1/6] trace: Provide a generic tracing event descriptor Lluís Vilanova
2012-02-10 14:28 ` [Qemu-devel] [PATCH v3 2/6] trace: Provide a detailed event control interface Lluís Vilanova
2012-02-10 14:28 ` Lluís Vilanova [this message]
2012-02-10 14:28 ` [Qemu-devel] [PATCH v3 4/6] trace: [default] Use new " Lluís Vilanova
2012-02-10 14:29 ` [Qemu-devel] [PATCH v3 5/6] trace: [simple] Port to generic event information and new " Lluís Vilanova
2012-02-10 14:29 ` [Qemu-devel] [PATCH v3 6/6] trace: [stderr] " Lluís Vilanova
2012-03-14 13:32 ` [Qemu-devel] [PATCH v3 0/6] trace: Generic event state description Lluís Vilanova

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=20120210142849.13518.88459.stgit@ginnungagap.bsc.es \
    --to=vilanova@ac.upc.edu \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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).