Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d38e1d5aaee384698fcef9455d6e2df1d062a1d0
Commit:     d38e1d5aaee384698fcef9455d6e2df1d062a1d0
Parent:     96645678cd726e87ce42a0664de71e047e32bca4
Author:     Peter Zijlstra <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 19 01:49:01 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 10:04:49 2007 -0700

    lockstat: better class name representation
    
    optionally add class->name_version and class->subclass to the class name
    
    Signed-off-by: Peter Zijlstra <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 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 7ff8013..9f17af4 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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to