summaryrefslogtreecommitdiff
path: root/kernel/lockdep_proc.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-07-19 12:49:01 +0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 21:04:49 +0400
commitd38e1d5aaee384698fcef9455d6e2df1d062a1d0 (patch)
treeba23e36611be644fa731e616f2f6c9d360491ad6 /kernel/lockdep_proc.c
parent96645678cd726e87ce42a0664de71e047e32bca4 (diff)
downloadlinux-d38e1d5aaee384698fcef9455d6e2df1d062a1d0.tar.xz
lockstat: better class name representation
optionally add class->name_version and class->subclass to the class name Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/lockdep_proc.c')
-rw-r--r--kernel/lockdep_proc.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c
index 7ff80135cbeb..9f17af4a2490 100644
--- a/kernel/lockdep_proc.c
+++ b/kernel/lockdep_proc.c
@@ -421,8 +421,30 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data)
class = data->class;
stats = &data->stats;
- snprintf(name, 38, "%s", class->name);
+ namelen = 38;
+ if (class->name_version > 1)
+ namelen -= 2; /* XXX truncates versions > 9 */
+ if (class->subclass)
+ namelen -= 2;
+
+ if (!class->name) {
+ char str[KSYM_NAME_LEN];
+ const char *key_name;
+
+ key_name = __get_key_name(class->key, str);
+ snprintf(name, namelen, "%s", key_name);
+ } else {
+ snprintf(name, namelen, "%s", class->name);
+ }
namelen = strlen(name);
+ if (class->name_version > 1) {
+ snprintf(name+namelen, 3, "#%d", class->name_version);
+ namelen += 2;
+ }
+ if (class->subclass) {
+ snprintf(name+namelen, 3, "/%d", class->subclass);
+ namelen += 2;
+ }
if (stats->write_holdtime.nr) {
if (stats->read_holdtime.nr)