[RFC PATCH 09/19] lockdep: generate usage strings
From: Peter Zijlstra
Date: Thu Jan 22 2009 - 12:49:44 EST
generate the usage strings
XXX capital invasion :-(
Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
kernel/lockdep.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
Index: linux-2.6/kernel/lockdep.c
===================================================================
--- linux-2.6.orig/kernel/lockdep.c
+++ linux-2.6/kernel/lockdep.c
@@ -445,21 +445,21 @@ atomic_t nr_find_usage_backwards_recursi
* Locking printouts:
*/
+#define __STR(foo) #foo
+#define STR(foo) __STR(foo)
+
+#define __USAGE(__STATE) \
+ [LOCK_USED_IN_##__STATE] = "IN-"STR(__STATE)"-W", \
+ [LOCK_ENABLED_##__STATE] = STR(__STATE)"-ON-W", \
+ [LOCK_USED_IN_##__STATE##_READ] = "IN-"STR(__STATE)"-R", \
+ [LOCK_ENABLED_##__STATE##_READ] = STR(__STATE)"-ON-R",
+
static const char *usage_str[] =
{
- [LOCK_USED] = "initial-use ",
- [LOCK_USED_IN_HARDIRQ] = "in-hardirq-W",
- [LOCK_USED_IN_SOFTIRQ] = "in-softirq-W",
- [LOCK_ENABLED_SOFTIRQ] = "softirq-on-W",
- [LOCK_ENABLED_HARDIRQ] = "hardirq-on-W",
- [LOCK_USED_IN_HARDIRQ_READ] = "in-hardirq-R",
- [LOCK_USED_IN_SOFTIRQ_READ] = "in-softirq-R",
- [LOCK_ENABLED_SOFTIRQ_READ] = "softirq-on-R",
- [LOCK_ENABLED_HARDIRQ_READ] = "hardirq-on-R",
- [LOCK_USED_IN_RECLAIM_FS] = "in-reclaim-W",
- [LOCK_USED_IN_RECLAIM_FS_READ] = "in-reclaim-R",
- [LOCK_ENABLED_RECLAIM_FS] = "ov-reclaim-W",
- [LOCK_ENABLED_RECLAIM_FS_READ] = "ov-reclaim-R",
+#define LOCKDEP_STATE(__STATE) __USAGE(__STATE)
+#include "lockdep_states.h"
+#undef LOCKDEP_STATE
+ [LOCK_USED] = "INITIAL USE",
};
const char * __get_key_name(struct lockdep_subclass_key *key, char *str)
--
--
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/