aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-07-19 04:49:01 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:49 -0400
commitd38e1d5aaee384698fcef9455d6e2df1d062a1d0 (patch)
treeba23e36611be644fa731e616f2f6c9d360491ad6 /kernel
parent96645678cd726e87ce42a0664de71e047e32bca4 (diff)
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')
-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)
421 class = data->class; 421 class = data->class;
422 stats = &data->stats; 422 stats = &data->stats;
423 423
424 snprintf(name, 38, "%s", class->name); 424 namelen = 38;
425 if (class->name_version > 1)
426 namelen -= 2; /* XXX truncates versions > 9 */
427 if (class->subclass)
428 namelen -= 2;
429
430 if (!class->name) {
431 char str[KSYM_NAME_LEN];
432 const char *key_name;
433
434 key_name = __get_key_name(class->key, str);
435 snprintf(name, namelen, "%s", key_name);
436 } else {
437 snprintf(name, namelen, "%s", class->name);
438 }
425 namelen = strlen(name); 439 namelen = strlen(name);
440 if (class->name_version > 1) {
441 snprintf(name+namelen, 3, "#%d", class->name_version);
442 namelen += 2;
443 }
444 if (class->subclass) {
445 snprintf(name+namelen, 3, "/%d", class->subclass);
446 namelen += 2;
447 }
426 448
427 if (stats->write_holdtime.nr) { 449 if (stats->write_holdtime.nr) {
428 if (stats->read_holdtime.nr) 450 if (stats->read_holdtime.nr)