From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30961 invoked by alias); 11 Feb 2007 20:03:43 -0000 Received: (qmail 30845 invoked by uid 22791); 11 Feb 2007 20:03:42 -0000 X-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_05,FORGED_RCVD_HELO X-Spam-Check-By: sourceware.org Received: from tomts20.bellnexxia.net (HELO tomts20-srv.bellnexxia.net) (209.226.175.74) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 11 Feb 2007 20:03:34 +0000 Received: from krystal.dyndns.org ([65.95.37.140]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070211200332.PHDY24907.tomts20-srv.bellnexxia.net@krystal.dyndns.org> for ; Sun, 11 Feb 2007 15:03:32 -0500 Received: from localhost (localhost [127.0.0.1]) (uid 1000) by krystal.dyndns.org with local; Sun, 11 Feb 2007 15:03:28 -0500 id 00301C85.45CF7690.00000CE1 From: Mathieu Desnoyers To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Mathieu Desnoyers , Christoph Hellwig , Ingo Molnar , systemtap@sources.redhat.com, ltt-dev@shafik.org Subject: [PATCH 03/05] Linux Kernel Markers : powerpc optimization Date: Sun, 11 Feb 2007 20:03:00 -0000 Message-Id: <1171224208261-git-send-email-mathieu.desnoyers@polymtl.ca> X-Mailer: git-send-email 1.4.4.4 In-Reply-To: <1171224207118-git-send-email-mathieu.desnoyers@polymtl.ca> References: <1171224207118-git-send-email-mathieu.desnoyers@polymtl.ca> X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q1/txt/msg00316.txt.bz2 Linux Kernel Markers : powerpc optimization Signed-off-by: Mathieu Desnoyers --- /dev/null +++ b/include/asm-powerpc/marker.h @@ -0,0 +1,49 @@ +/* + * marker.h + * + * Code markup for dynamic and static tracing. PowerPC architecture + * optimisations. + * + * (C) Copyright 2006 Mathieu Desnoyers + * + * This file is released under the GPLv2. + * See the file COPYING for more details. + */ + +#include + +#ifdef CONFIG_MARKERS + +#define MARK(name, format, args...) \ + do { \ + static marker_probe_func *__mark_call_##name = \ + __mark_empty_function; \ + static const struct __mark_marker_c __mark_c_##name \ + __attribute__((section(".markers.c"))) = \ + { #name, &__mark_call_##name, format, \ + MARKER_OPTIMIZED } ; \ + char condition; \ + asm volatile( ".section .markers, \"a\";\n\t" \ + PPC_LONG "%1, 0f;\n\t" \ + ".previous;\n\t" \ + ".align 4\n\t" \ + "0:\n\t" \ + "li %0,0;\n\t" \ + : "=r" (condition) \ + : "i" (&__mark_c_##name)); \ + __mark_check_format(format, ## args); \ + if (unlikely(condition)) { \ + preempt_disable(); \ + (*__mark_call_##name)(format, ## args); \ + preempt_enable(); \ + } \ + } while (0) + + +/* Offset of the immediate value from the start of the addi instruction (result + * of the li mnemonic), in bytes. */ +#define MARK_ENABLE_IMMEDIATE_OFFSET 2 +#define MARK_ENABLE_TYPE short +#define MARK_POLYMORPHIC + +#endif