public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Subject: [PATCH] linux-kernel-markers-documentation-update-flags
Date: Thu, 1 Mar 2007 02:20:01 -0500	[thread overview]
Message-ID: <20070301072001.GF19339@Krystal> (raw)

linux-kernel-markers-documentation-update-flags

Documents the flag usage.

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

--- a/Documentation/marker.txt
+++ b/Documentation/marker.txt
@@ -78,6 +78,21 @@ which saves a data cache hit, but also requires cross CPU code modification. In
 order to support embedded systems which use read-only memory for their code, the
 optimization can be disabled through menu options.
 
+The MF_* flags can be used to control the type of marker. See the
+include/marker.h header for the list of flags. They can be specified as the
+first parameter of the _MARK() macro, such as the following example which is
+safe wrt lockdep.c (useful for marking lockdep.c functions).
+
+_MARK(_MF_DEFAULT | ~_MF_LOCKDEP, subsystem_eventb,
+  MARK_NOARGS);
+
+Another example is to specify that a specific marker must never call printk :
+_MARK(_MF_DEFAULT | ~_MF_PRINTK, subsystem_eventc,
+  "%d %s %p[struct task_struct]",
+  someint, somestring, current);
+
+Flag compatibility is checked before connecting the probe to the marker.
+
 
 * Probe example
 
@@ -122,6 +137,13 @@ void probe_subsystem_event(const char *format, ...)
 	va_end(ap);
 }
 
+#define SUBSYSTEM_EVENTB_FORMAT MARK_NOARGS
+void probe_subsystem_eventb(const char *format, ...)
+{
+	/* Increment counters, trace, ... but _never_ generate a call to
+	 * lockdep.c ! */
+}
+
 static int __init probe_init(void)
 {
 	int result;
@@ -130,16 +152,24 @@ static int __init probe_init(void)
 			probe_subsystem_event);
 	if (!result)
 		goto cleanup;
+	result = _marker_set_probe(_MF_DEFAULT & ~_MF_LOCKDEP,
+			"subsystem_eventb",
+			SUBSYSTEM_EVENTB_FORMAT,
+			probe_subsystem_eventb);
+	if (!result)
+		goto cleanup;
 	return 0;
 
 cleanup:
 	marker_remove_probe(probe_subsystem_event);
+	marker_remove_probe(probe_subsystem_eventb);
 	return -EPERM;
 }
 
 static void __exit probe_fini(void)
 {
 	marker_remove_probe(probe_subsystem_event);
+	marker_remove_probe(probe_subsystem_eventb);
 }
 
 module_init(probe_init);
-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

                 reply	other threads:[~2007-03-01  7:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070301072001.GF19339@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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