diff options
| author | Ingo Molnar <mingo@elte.hu> | 2010-09-24 03:12:05 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2010-09-24 03:12:05 -0400 |
| commit | a5a2bad55de89a0adf7d6f783cb87ab7eb1a894f (patch) | |
| tree | 452cb8addc26f5c79fdd4e2fea92c78dc17fc8e8 /lib/dynamic_debug.c | |
| parent | d0303d71c2fb9bcb90a8d48e6462c78c86f70ce6 (diff) | |
| parent | 46eb3b64dddd20f44e76b08676fa642dd374bf1d (diff) | |
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
Diffstat (limited to 'lib/dynamic_debug.c')
| -rw-r--r-- | lib/dynamic_debug.c | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 02afc2533728..e925c7b960f1 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c | |||
| @@ -26,19 +26,11 @@ | |||
| 26 | #include <linux/dynamic_debug.h> | 26 | #include <linux/dynamic_debug.h> |
| 27 | #include <linux/debugfs.h> | 27 | #include <linux/debugfs.h> |
| 28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
| 29 | #include <linux/jump_label.h> | ||
| 29 | 30 | ||
| 30 | extern struct _ddebug __start___verbose[]; | 31 | extern struct _ddebug __start___verbose[]; |
| 31 | extern struct _ddebug __stop___verbose[]; | 32 | extern struct _ddebug __stop___verbose[]; |
| 32 | 33 | ||
| 33 | /* dynamic_debug_enabled, and dynamic_debug_enabled2 are bitmasks in which | ||
| 34 | * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They | ||
| 35 | * use independent hash functions, to reduce the chance of false positives. | ||
| 36 | */ | ||
| 37 | long long dynamic_debug_enabled; | ||
| 38 | EXPORT_SYMBOL_GPL(dynamic_debug_enabled); | ||
| 39 | long long dynamic_debug_enabled2; | ||
| 40 | EXPORT_SYMBOL_GPL(dynamic_debug_enabled2); | ||
| 41 | |||
| 42 | struct ddebug_table { | 34 | struct ddebug_table { |
| 43 | struct list_head link; | 35 | struct list_head link; |
| 44 | char *mod_name; | 36 | char *mod_name; |
| @@ -88,26 +80,6 @@ static char *ddebug_describe_flags(struct _ddebug *dp, char *buf, | |||
| 88 | } | 80 | } |
| 89 | 81 | ||
| 90 | /* | 82 | /* |
| 91 | * must be called with ddebug_lock held | ||
| 92 | */ | ||
| 93 | |||
| 94 | static int disabled_hash(char hash, bool first_table) | ||
| 95 | { | ||
| 96 | struct ddebug_table *dt; | ||
| 97 | char table_hash_value; | ||
| 98 | |||
| 99 | list_for_each_entry(dt, &ddebug_tables, link) { | ||
| 100 | if (first_table) | ||
| 101 | table_hash_value = dt->ddebugs->primary_hash; | ||
| 102 | else | ||
| 103 | table_hash_value = dt->ddebugs->secondary_hash; | ||
| 104 | if (dt->num_enabled && (hash == table_hash_value)) | ||
| 105 | return 0; | ||
| 106 | } | ||
| 107 | return 1; | ||
| 108 | } | ||
| 109 | |||
| 110 | /* | ||
| 111 | * Search the tables for _ddebug's which match the given | 83 | * Search the tables for _ddebug's which match the given |
| 112 | * `query' and apply the `flags' and `mask' to them. Tells | 84 | * `query' and apply the `flags' and `mask' to them. Tells |
| 113 | * the user which ddebug's were changed, or whether none | 85 | * the user which ddebug's were changed, or whether none |
| @@ -170,17 +142,9 @@ static void ddebug_change(const struct ddebug_query *query, | |||
| 170 | dt->num_enabled++; | 142 | dt->num_enabled++; |
| 171 | dp->flags = newflags; | 143 | dp->flags = newflags; |
| 172 | if (newflags) { | 144 | if (newflags) { |
| 173 | dynamic_debug_enabled |= | 145 | enable_jump_label(&dp->enabled); |
| 174 | (1LL << dp->primary_hash); | ||
| 175 | dynamic_debug_enabled2 |= | ||
| 176 | (1LL << dp->secondary_hash); | ||
| 177 | } else { | 146 | } else { |
| 178 | if (disabled_hash(dp->primary_hash, true)) | 147 | disable_jump_label(&dp->enabled); |
| 179 | dynamic_debug_enabled &= | ||
| 180 | ~(1LL << dp->primary_hash); | ||
| 181 | if (disabled_hash(dp->secondary_hash, false)) | ||
| 182 | dynamic_debug_enabled2 &= | ||
| 183 | ~(1LL << dp->secondary_hash); | ||
| 184 | } | 148 | } |
| 185 | if (verbose) | 149 | if (verbose) |
| 186 | printk(KERN_INFO | 150 | printk(KERN_INFO |
