From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38539 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8Cxh-0008E1-Dv for qemu-devel@nongnu.org; Tue, 19 Oct 2010 10:15:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8CxD-0000xZ-3Q for qemu-devel@nongnu.org; Tue, 19 Oct 2010 10:14:19 -0400 Received: from david.siemens.de ([192.35.17.14]:15731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8CxC-0000xL-Q8 for qemu-devel@nongnu.org; Tue, 19 Oct 2010 10:14:15 -0400 Message-ID: <4CBDA7B1.6020902@siemens.com> Date: Tue, 19 Oct 2010 16:14:09 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] simpletrace: Inline runtime state check List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel Instead of preparing all traced args, jumping into the common trace function, even collecting a timestamp, do the check if a particular tracepoint is enabled inline. Also, mark the enabled case unlikely to motivate the compiler to push the trace code out of the fastpath. Signed-off-by: Jan Kiszka --- simpletrace.c | 4 ---- tracetool | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/simpletrace.c b/simpletrace.c index deb1e07..224e4ab 100644 --- a/simpletrace.c +++ b/simpletrace.c @@ -148,10 +148,6 @@ static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, */ clock_gettime(CLOCK_MONOTONIC, &ts); - if (!trace_list[event].state) { - return; - } - rec->event = event; rec->timestamp_ns = ts.tv_sec * 1000000000LL + ts.tv_nsec; rec->x1 = x1; diff --git a/tracetool b/tracetool index 7010858..9532409 100755 --- a/tracetool +++ b/tracetool @@ -146,6 +146,8 @@ linetoh_begin_simple() { cat <