diff options
Diffstat (limited to 'kernel/lockdep_proc.c')
-rw-r--r-- | kernel/lockdep_proc.c | 24 |
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) |