From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, dgilbert@redhat.com, armbru@redhat.com,
vsementsov@virtuozzo.com, den@openvz.org
Subject: [Qemu-devel] [PATCH 1/2] trace: do not calculate arguments for disabled trace-points
Date: Fri, 21 Jul 2017 17:31:48 +0300 [thread overview]
Message-ID: <20170721143149.43721-2-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20170721143149.43721-1-vsementsov@virtuozzo.com>
Do not calculate arguments if trace-point is disabled. For this:
- move to macro do { ... } while (0) scheme
- use additional macro-layer to handle calls of trace-points where
a macro generates parameter list
(like trace_e1000e_mac_set_permanent(MAC_ARG(macaddr)))
This is needed to allow some additional logic in trace-point parameter
calculation, which will not be executed if this trace-point is
disabled.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
scripts/tracetool/format/h.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py
index aecf249d66..d0baccc453 100644
--- a/scripts/tracetool/format/h.py
+++ b/scripts/tracetool/format/h.py
@@ -73,12 +73,13 @@ def generate(events, backend, group):
cond = "true"
out('',
- 'static inline void %(api)s(%(args)s)',
- '{',
- ' if (%(cond)s) {',
- ' %(api_nocheck)s(%(names)s);',
- ' }',
- '}',
+ '#define %(api)s(...) _do_%(api)s(__VA_ARGS__)',
+ '#define _do_%(api)s(%(names)s) \\',
+ 'do { \\',
+ ' if (%(cond)s) { \\',
+ ' %(api_nocheck)s(%(names)s); \\',
+ ' } \\',
+ '} while (0)',
api=e.api(),
api_nocheck=e.api(e.QEMU_TRACE_NOCHECK),
args=e.args,
--
2.11.1
next prev parent reply other threads:[~2017-07-21 14:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-21 14:31 [Qemu-devel] [PATCH 0/2] improve tracing Vladimir Sementsov-Ogievskiy
2017-07-21 14:31 ` Vladimir Sementsov-Ogievskiy [this message]
2017-07-21 14:31 ` [Qemu-devel] [PATCH 2/2] monitor: improve tracing in handle_qmp_command Vladimir Sementsov-Ogievskiy
2017-07-24 11:39 ` Stefan Hajnoczi
2017-07-21 17:04 ` [Qemu-devel] [PATCH 0/2] improve tracing Lluís Vilanova
2017-07-24 8:55 ` Vladimir Sementsov-Ogievskiy
2017-07-24 11:07 ` Lluís Vilanova
2017-07-24 11:16 ` Denis V. Lunev
2017-07-24 11:32 ` Stefan Hajnoczi
2017-07-24 11:34 ` Stefan Hajnoczi
2017-07-24 12:17 ` Denis V. Lunev
2017-07-24 14:43 ` Lluís Vilanova
2017-07-24 14:55 ` Denis V. Lunev
2017-07-24 16:32 ` Lluís Vilanova
2017-07-25 13:52 ` Stefan Hajnoczi
2017-07-24 16:24 ` Philippe Mathieu-Daudé
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=20170721143149.43721-2-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=dgilbert@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.