Re: [PATCH] Linux Kernel Markers 0.7 for 2.6.17 (with type checking!)

From: Jeremy Fitzhardinge
Date: Thu Sep 21 2006 - 20:44:10 EST


Mathieu Desnoyers wrote:
+#ifdef CONFIG_MARK_SYMBOL
+#define MARK_SYM(name) \
+ do { \
+ __label__ here; \
+ here: asm volatile \
+ (MARK_KPROBE_PREFIX#name " = %0" : : "m" (*&&here)); \
+ } while(0)
+#else +#define MARK_SYM(name)
+#endif

BTW, this won't work if you put the MARK_SYM in a loop which gcc unrolls; you'll only get the mark in the last unrolled iteration (because the symbol assignments will override each other).

Do make this work properly, you really need to put the mark entries into a separate section, so that if gcc duplicates the code, you get duplicated markers too.

J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/