Skip to contentSkip to conversation

spufs support multiple probes markers

PATCH In review Mathieu Desnoyers 2 participants 3 messages Feb 12, 2008 – Feb 14, 2008 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20080212233914.GA22966@Krystal

#2 lore raw

PATCH 1/1 spufs support multiple probes markers

Quoted 18 lines · * Mathieu Desnoyers ([email protected]) wrote:
Quoted 3 lines · * Andrew Morton ([email protected]) wrote:

fyi, I have this on hold because I spotted spufs build breakage, but I haven't had time to investigate. powerpc allmodconfig, iirc.

Christoph told me he would update his sputrace accordingly. Christoph, should I do the changes or let you do it ?

It's mostly the probe function prototype which changes from

(quoted diff) +0 -2
-typedef void marker_probe_func(const struct marker *mdata,
-       void *private_data, const char *fmt, ...);

to

(quoted diff) +2 -0
+typedef void marker_probe_func(void *probe_private, void *call_private,
+               const char *fmt, va_list *args);
Quoted 8 lines

Where you receive an already ready va_list instead of having to call va_start/va_end in the probe.

Also, there is no more marker_arm/marker_disarm. It is now automatically done upon register/unregister.

Mathieu

Update spufs to the new linux kernel markers API, which supports connecting more than one probe to a single marker.

(compile-tested only)

CC Christoph Hellwig <[email protected]>
CC "Frank Ch. Eigler" <[email protected]>
CC Steven Rostedt <[email protected]>
CC Andrew Morton <[email protected]>
---
 arch/powerpc/platforms/cell/spufs/sputrace.c |   31 +++++++++------------------
 1 file changed, 11 insertions(+), 20 deletions(-)
arch/powerpc/platforms/cell/spufs/sputrace.c +11 -20
Index: linux-2.6-lttng/arch/powerpc/platforms/cell/spufs/sputrace.c
===================================================================
@@ -146,34 +146,28 @@
 	wake_up(&sputrace_wait);
 }
 
-static void spu_context_event(const struct marker *mdata,
-		void *private, const char *format, ...)
+static void spu_context_event(void *probe_private, void *call_data,
+		const char *format, va_list *args)
 {
-	struct spu_probe *p = mdata->private;
-	va_list ap;
+	struct spu_probe *p = probe_private;
 	struct spu_context *ctx;
 	struct spu *spu;
 
-	va_start(ap, format);
-	ctx = va_arg(ap, struct spu_context *);
-	spu = va_arg(ap, struct spu *);
+	ctx = va_arg(*args, struct spu_context *);
+	spu = va_arg(*args, struct spu *);
 
 	sputrace_log_item(p->name, ctx, spu);
-	va_end(ap);
 }
 
-static void spu_context_nospu_event(const struct marker *mdata,
-		void *private, const char *format, ...)
+static void spu_context_nospu_event(void *probe_private, void *call_data,
+		const char *format, va_list *args)
 {
-	struct spu_probe *p = mdata->private;
-	va_list ap;
+	struct spu_probe *p = probe_private;
 	struct spu_context *ctx;
 
-	va_start(ap, format);
-	ctx = va_arg(ap, struct spu_context *);
+	ctx = va_arg(*args, struct spu_context *);
 
 	sputrace_log_item(p->name, ctx, NULL);
-	va_end(ap);
 }
 
 struct spu_probe spu_probes[] = {
@@ -219,10 +213,6 @@
 		if (error)
 			printk(KERN_INFO "Unable to register probe %s\n",
 					p->name);
-
-		error = marker_arm(p->name);
-		if (error)
-			printk(KERN_INFO "Unable to arm probe %s\n", p->name);
 	}
 
 	return 0;
@@ -238,7 +228,8 @@
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(spu_probes); i++)
-		marker_probe_unregister(spu_probes[i].name);
+		marker_probe_unregister(spu_probes[i].name,
+			spu_probes[i].probe_func, &spu_probes[i]);
 
 	remove_proc_entry("sputrace", NULL);
 	kfree(sputrace_log);
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#3 lore raw
Quoted 2 lines · Mathieu Desnoyers

Update spufs to the new linux kernel markers API, which supports connecting more than one probe to a single marker.

Compiles and works for me. But saying I like the odd API would be lying.

#4 lore raw
Quoted 6 lines · * Christoph Hellwig ([email protected]) wrote:
Quoted 2 lines · Mathieu Desnoyers

Update spufs to the new linux kernel markers API, which supports connecting more than one probe to a single marker.

Compiles and works for me. But saying I like the odd API would be lying.

Are there any concerns of yours that I should address then ? The changes I made to the probe function prototype appeared to be technically required and caused by variadic argument limitations when it comes to support multiple probes.

I think that the marker arm/disarm removal gets rid of an unnecessary redundancy.

Mathieu

Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68