diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 98ca94a41819..ab25b88aae56 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -762,7 +762,6 @@ ftrace_find_profiled_func(struct ftrace_profile_stat *stat, unsigned long ip) | |||
762 | { | 762 | { |
763 | struct ftrace_profile *rec; | 763 | struct ftrace_profile *rec; |
764 | struct hlist_head *hhd; | 764 | struct hlist_head *hhd; |
765 | struct hlist_node *n; | ||
766 | unsigned long key; | 765 | unsigned long key; |
767 | 766 | ||
768 | key = hash_long(ip, ftrace_profile_bits); | 767 | key = hash_long(ip, ftrace_profile_bits); |
@@ -771,7 +770,7 @@ ftrace_find_profiled_func(struct ftrace_profile_stat *stat, unsigned long ip) | |||
771 | if (hlist_empty(hhd)) | 770 | if (hlist_empty(hhd)) |
772 | return NULL; | 771 | return NULL; |
773 | 772 | ||
774 | hlist_for_each_entry_rcu(rec, n, hhd, node) { | 773 | hlist_for_each_entry_rcu(rec, hhd, node) { |
775 | if (rec->ip == ip) | 774 | if (rec->ip == ip) |
776 | return rec; | 775 | return rec; |
777 | } | 776 | } |
@@ -1133,7 +1132,6 @@ ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip) | |||
1133 | unsigned long key; | 1132 | unsigned long key; |
1134 | struct ftrace_func_entry *entry; | 1133 | struct ftrace_func_entry *entry; |
1135 | struct hlist_head *hhd; | 1134 | struct hlist_head *hhd; |
1136 | struct hlist_node *n; | ||
1137 | 1135 | ||
1138 | if (ftrace_hash_empty(hash)) | 1136 | if (ftrace_hash_empty(hash)) |
1139 | return NULL; | 1137 | return NULL; |
@@ -1145,7 +1143,7 @@ ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip) | |||
1145 | 1143 | ||
1146 | hhd = &hash->buckets[key]; | 1144 | hhd = &hash->buckets[key]; |
1147 | 1145 | ||
1148 | hlist_for_each_entry_rcu(entry, n, hhd, hlist) { | 1146 | hlist_for_each_entry_rcu(entry, hhd, hlist) { |
1149 | if (entry->ip == ip) | 1147 | if (entry->ip == ip) |
1150 | return entry; | 1148 | return entry; |
1151 | } | 1149 | } |
@@ -1202,7 +1200,7 @@ remove_hash_entry(struct ftrace_hash *hash, | |||
1202 | static void ftrace_hash_clear(struct ftrace_hash *hash) | 1200 | static void ftrace_hash_clear(struct ftrace_hash *hash) |
1203 | { | 1201 | { |
1204 | struct hlist_head *hhd; | 1202 | struct hlist_head *hhd; |
1205 | struct hlist_node *tp, *tn; | 1203 | struct hlist_node *tn; |
1206 | struct ftrace_func_entry *entry; | 1204 | struct ftrace_func_entry *entry; |
1207 | int size = 1 << hash->size_bits; | 1205 | int size = 1 << hash->size_bits; |
1208 | int i; | 1206 | int i; |
@@ -1212,7 +1210,7 @@ static void ftrace_hash_clear(struct ftrace_hash *hash) | |||
1212 | 1210 | ||
1213 | for (i = 0; i < size; i++) { | 1211 | for (i = 0; i < size; i++) { |
1214 | hhd = &hash->buckets[i]; | 1212 | hhd = &hash->buckets[i]; |
1215 | hlist_for_each_entry_safe(entry, tp, tn, hhd, hlist) | 1213 | hlist_for_each_entry_safe(entry, tn, hhd, hlist) |
1216 | free_hash_entry(hash, entry); | 1214 | free_hash_entry(hash, entry); |
1217 | } | 1215 | } |
1218 | FTRACE_WARN_ON(hash->count); | 1216 | FTRACE_WARN_ON(hash->count); |
@@ -1275,7 +1273,6 @@ alloc_and_copy_ftrace_hash(int size_bits, struct ftrace_hash *hash) | |||
1275 | { | 1273 | { |
1276 | struct ftrace_func_entry *entry; | 1274 | struct ftrace_func_entry *entry; |
1277 | struct ftrace_hash *new_hash; | 1275 | struct ftrace_hash *new_hash; |
1278 | struct hlist_node *tp; | ||
1279 | int size; | 1276 | int size; |
1280 | int ret; | 1277 | int ret; |
1281 | int i; | 1278 | int i; |
@@ -1290,7 +1287,7 @@ alloc_and_copy_ftrace_hash(int size_bits, struct ftrace_hash *hash) | |||
1290 | 1287 | ||
1291 | size = 1 << hash->size_bits; | 1288 | size = 1 << hash->size_bits; |
1292 | for (i = 0; i < size; i++) { | 1289 | for (i = 0; i < size; i++) { |
1293 | hlist_for_each_entry(entry, tp, &hash->buckets[i], hlist) { | 1290 | hlist_for_each_entry(entry, &hash->buckets[i], hlist) { |
1294 | ret = add_hash_entry(new_hash, entry->ip); | 1291 | ret = add_hash_entry(new_hash, entry->ip); |
1295 | if (ret < 0) | 1292 | if (ret < 0) |
1296 | goto free_hash; | 1293 | goto free_hash; |
@@ -1316,7 +1313,7 @@ ftrace_hash_move(struct ftrace_ops *ops, int enable, | |||
1316 | struct ftrace_hash **dst, struct ftrace_hash *src) | 1313 | struct ftrace_hash **dst, struct ftrace_hash *src) |
1317 | { | 1314 | { |
1318 | struct ftrace_func_entry *entry; | 1315 | struct ftrace_func_entry *entry; |
1319 | struct hlist_node *tp, *tn; | 1316 | struct hlist_node *tn; |
1320 | struct hlist_head *hhd; | 1317 | struct hlist_head *hhd; |
1321 | struct ftrace_hash *old_hash; | 1318 | struct ftrace_hash *old_hash; |
1322 | struct ftrace_hash *new_hash; | 1319 | struct ftrace_hash *new_hash; |
@@ -1362,7 +1359,7 @@ ftrace_hash_move(struct ftrace_ops *ops, int enable, | |||
1362 | size = 1 << src->size_bits; | 1359 | size = 1 << src->size_bits; |
1363 | for (i = 0; i < size; i++) { | 1360 | for (i = 0; i < size; i++) { |
1364 | hhd = &src->buckets[i]; | 1361 | hhd = &src->buckets[i]; |
1365 | hlist_for_each_entry_safe(entry, tp, tn, hhd, hlist) { | 1362 | hlist_for_each_entry_safe(entry, tn, hhd, hlist) { |
1366 | if (bits > 0) | 1363 | if (bits > 0) |
1367 | key = hash_long(entry->ip, bits); | 1364 | key = hash_long(entry->ip, bits); |
1368 | else | 1365 | else |
@@ -2901,7 +2898,6 @@ static void function_trace_probe_call(unsigned long ip, unsigned long parent_ip, | |||
2901 | { | 2898 | { |
2902 | struct ftrace_func_probe *entry; | 2899 | struct ftrace_func_probe *entry; |
2903 | struct hlist_head *hhd; | 2900 | struct hlist_head *hhd; |
2904 | struct hlist_node *n; | ||
2905 | unsigned long key; | 2901 | unsigned long key; |
2906 | 2902 | ||
2907 | key = hash_long(ip, FTRACE_HASH_BITS); | 2903 | key = hash_long(ip, FTRACE_HASH_BITS); |
@@ -2917,7 +2913,7 @@ static void function_trace_probe_call(unsigned long ip, unsigned long parent_ip, | |||
2917 | * on the hash. rcu_read_lock is too dangerous here. | 2913 | * on the hash. rcu_read_lock is too dangerous here. |
2918 | */ | 2914 | */ |
2919 | preempt_disable_notrace(); | 2915 | preempt_disable_notrace(); |
2920 | hlist_for_each_entry_rcu(entry, n, hhd, node) { | 2916 | hlist_for_each_entry_rcu(entry, hhd, node) { |
2921 | if (entry->ip == ip) | 2917 | if (entry->ip == ip) |
2922 | entry->ops->func(ip, parent_ip, &entry->data); | 2918 | entry->ops->func(ip, parent_ip, &entry->data); |
2923 | } | 2919 | } |
@@ -3068,7 +3064,7 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, | |||
3068 | void *data, int flags) | 3064 | void *data, int flags) |
3069 | { | 3065 | { |
3070 | struct ftrace_func_probe *entry; | 3066 | struct ftrace_func_probe *entry; |
3071 | struct hlist_node *n, *tmp; | 3067 | struct hlist_node *tmp; |
3072 | char str[KSYM_SYMBOL_LEN]; | 3068 | char str[KSYM_SYMBOL_LEN]; |
3073 | int type = MATCH_FULL; | 3069 | int type = MATCH_FULL; |
3074 | int i, len = 0; | 3070 | int i, len = 0; |
@@ -3091,7 +3087,7 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, | |||
3091 | for (i = 0; i < FTRACE_FUNC_HASHSIZE; i++) { | 3087 | for (i = 0; i < FTRACE_FUNC_HASHSIZE; i++) { |
3092 | struct hlist_head *hhd = &ftrace_func_hash[i]; | 3088 | struct hlist_head *hhd = &ftrace_func_hash[i]; |
3093 | 3089 | ||
3094 | hlist_for_each_entry_safe(entry, n, tmp, hhd, node) { | 3090 | hlist_for_each_entry_safe(entry, tmp, hhd, node) { |
3095 | 3091 | ||
3096 | /* break up if statements for readability */ | 3092 | /* break up if statements for readability */ |
3097 | if ((flags & PROBE_TEST_FUNC) && entry->ops != ops) | 3093 | if ((flags & PROBE_TEST_FUNC) && entry->ops != ops) |