public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl•ca>
To: linux-kernel@vger•kernel.org, paulus@samba•org,
	Andrew Morton <akpm@osdl•org>, Ingo Molnar <mingo@redhat•com>,
	Greg Kroah-Hartman <gregkh@suse•de>,
	Christoph Hellwig <hch@infradead•org>
Cc: "Martin J. Bligh" <mbligh@mbligh•org>,
	linuxppc-dev@ozlabs•org, Douglas Niehaus <niehaus@eecs•ku.edu>,
	ltt-dev@shafik•org, systemtap@sources•redhat.com,
	Thomas Gleixner <tglx@linutronix•de>
Subject: [PATCH 4/4] Linux Kernel Markers : powerpc optimisation
Date: Wed, 20 Dec 2006 19:01:40 -0500	[thread overview]
Message-ID: <20061221000140.GE28643@Krystal> (raw)
In-Reply-To: <20061220235216.GA28643@Krystal>

This is the powerpc Linux Kernel Markers optimised version.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl•ca>

--- /dev/null
+++ b/include/asm-powerpc/marker.h
@@ -0,0 +1,58 @@
+/*
+ * marker.h
+ *
+ * Code markup for dynamic and static tracing. PowerPC architecture
+ * optimisations.
+ *
+ * (C) Copyright 2006 Mathieu Desnoyers <mathieu.desnoyers@polymtl•ca>
+ *
+ * This file is released under the GPLv2.
+ * See the file COPYING for more details.
+ */
+
+#include <asm/asm-compat.h>
+
+struct __mark_marker_c {
+	const char *name;
+	marker_probe_func **call;
+	const char *format;
+} __attribute__((packed));
+
+struct __mark_marker {
+	struct __mark_marker_c *cmark;
+	volatile short *enable;
+} __attribute__((packed));
+
+#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 } ; \
+		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_no_resched(); \
+		} \
+	} 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_POLYMORPHIC
+
+#endif

OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 

           reply	other threads:[~2006-12-21  0:59 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20061220235216.GA28643@Krystal>]

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=20061221000140.GE28643@Krystal \
    --to=mathieu.desnoyers@polymtl$(echo .)ca \
    --cc=akpm@osdl$(echo .)org \
    --cc=gregkh@suse$(echo .)de \
    --cc=hch@infradead$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=ltt-dev@shafik$(echo .)org \
    --cc=mbligh@mbligh$(echo .)org \
    --cc=mingo@redhat$(echo .)com \
    --cc=niehaus@eecs$(echo .)ku.edu \
    --cc=paulus@samba$(echo .)org \
    --cc=systemtap@sources$(echo .)redhat.com \
    --cc=tglx@linutronix$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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