Commit f9829cce authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Minor cleanup to lockdep.c

- Use printk formatting for indentation
- Don't leave NTFS in the default event filter
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8f72e402
...@@ -169,22 +169,17 @@ EXPORT_SYMBOL(lockdep_internal); ...@@ -169,22 +169,17 @@ EXPORT_SYMBOL(lockdep_internal);
*/ */
static int class_filter(struct lock_class *class) static int class_filter(struct lock_class *class)
{ {
#if 0
/* Example */
if (class->name_version == 1 && if (class->name_version == 1 &&
!strcmp(class->name, "&rl->lock")) !strcmp(class->name, "lockname"))
return 1; return 1;
if (class->name_version == 1 && if (class->name_version == 1 &&
!strcmp(class->name, "&ni->mrec_lock")) !strcmp(class->name, "&struct->lockfield"))
return 1; return 1;
if (class->name_version == 1 && #endif
!strcmp(class->name, "mft_ni_runlist_lock")) /* Allow everything else. 0 would be filter everything else */
return 1;
if (class->name_version == 1 &&
!strcmp(class->name, "mft_ni_mrec_lock"))
return 1;
if (class->name_version == 1 &&
!strcmp(class->name, "&vol->lcnbmp_lock"))
return 1; return 1;
return 0;
} }
#endif #endif
...@@ -408,23 +403,12 @@ static void lockdep_print_held_locks(struct task_struct *curr) ...@@ -408,23 +403,12 @@ static void lockdep_print_held_locks(struct task_struct *curr)
print_lock(curr->held_locks + i); print_lock(curr->held_locks + i);
} }
} }
/*
* Helper to print a nice hierarchy of lock dependencies:
*/
static void print_spaces(int nr)
{
int i;
for (i = 0; i < nr; i++)
printk(" ");
}
static void print_lock_class_header(struct lock_class *class, int depth) static void print_lock_class_header(struct lock_class *class, int depth)
{ {
int bit; int bit;
print_spaces(depth); printk("%*s->", depth, "");
printk("->");
print_lock_name(class); print_lock_name(class);
printk(" ops: %lu", class->ops); printk(" ops: %lu", class->ops);
printk(" {\n"); printk(" {\n");
...@@ -433,17 +417,14 @@ static void print_lock_class_header(struct lock_class *class, int depth) ...@@ -433,17 +417,14 @@ static void print_lock_class_header(struct lock_class *class, int depth)
if (class->usage_mask & (1 << bit)) { if (class->usage_mask & (1 << bit)) {
int len = depth; int len = depth;
print_spaces(depth); len += printk("%*s %s", depth, "", usage_str[bit]);
len += printk(" %s", usage_str[bit]);
len += printk(" at:\n"); len += printk(" at:\n");
print_stack_trace(class->usage_traces + bit, len); print_stack_trace(class->usage_traces + bit, len);
} }
} }
print_spaces(depth); printk("%*s }\n", depth, "");
printk(" }\n");
print_spaces(depth); printk("%*s ... key at: ",depth,"");
printk(" ... key at: ");
print_ip_sym((unsigned long)class->key); print_ip_sym((unsigned long)class->key);
} }
...@@ -463,8 +444,7 @@ static void print_lock_dependencies(struct lock_class *class, int depth) ...@@ -463,8 +444,7 @@ static void print_lock_dependencies(struct lock_class *class, int depth)
DEBUG_LOCKS_WARN_ON(!entry->class); DEBUG_LOCKS_WARN_ON(!entry->class);
print_lock_dependencies(entry->class, depth + 1); print_lock_dependencies(entry->class, depth + 1);
print_spaces(depth); printk("%*s ... acquired at:\n",depth,"");
printk(" ... acquired at:\n");
print_stack_trace(&entry->trace, 2); print_stack_trace(&entry->trace, 2);
printk("\n"); printk("\n");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment