• Home
  • Raw
  • Download

Lines Matching refs:hash

400 	struct hlist_head		*hash;  member
577 memset(stat->hash, 0, in ftrace_profile_reset()
644 if (stat->hash) { in ftrace_profile_init_cpu()
656 stat->hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); in ftrace_profile_init_cpu()
658 if (!stat->hash) in ftrace_profile_init_cpu()
663 kfree(stat->hash); in ftrace_profile_init_cpu()
664 stat->hash = NULL; in ftrace_profile_init_cpu()
694 hhd = &stat->hash[key]; in ftrace_find_profiled_func()
713 hlist_add_head_rcu(&rec->node, &stat->hash[key]); in ftrace_add_profile()
766 if (!stat->hash || !ftrace_profile_enabled) in function_profile_call()
816 if (!stat->hash || !ftrace_profile_enabled) in profile_graph_return()
1098 ftrace_hash_key(struct ftrace_hash *hash, unsigned long ip) in ftrace_hash_key() argument
1100 if (hash->size_bits > 0) in ftrace_hash_key()
1101 return hash_long(ip, hash->size_bits); in ftrace_hash_key()
1108 __ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip) in __ftrace_lookup_ip() argument
1114 key = ftrace_hash_key(hash, ip); in __ftrace_lookup_ip()
1115 hhd = &hash->buckets[key]; in __ftrace_lookup_ip()
1135 ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip) in ftrace_lookup_ip() argument
1137 if (ftrace_hash_empty(hash)) in ftrace_lookup_ip()
1140 return __ftrace_lookup_ip(hash, ip); in ftrace_lookup_ip()
1143 static void __add_hash_entry(struct ftrace_hash *hash, in __add_hash_entry() argument
1149 key = ftrace_hash_key(hash, entry->ip); in __add_hash_entry()
1150 hhd = &hash->buckets[key]; in __add_hash_entry()
1152 hash->count++; in __add_hash_entry()
1155 static int add_hash_entry(struct ftrace_hash *hash, unsigned long ip) in add_hash_entry() argument
1164 __add_hash_entry(hash, entry); in add_hash_entry()
1170 free_hash_entry(struct ftrace_hash *hash, in free_hash_entry() argument
1175 hash->count--; in free_hash_entry()
1179 remove_hash_entry(struct ftrace_hash *hash, in remove_hash_entry() argument
1183 hash->count--; in remove_hash_entry()
1186 static void ftrace_hash_clear(struct ftrace_hash *hash) in ftrace_hash_clear() argument
1191 int size = 1 << hash->size_bits; in ftrace_hash_clear()
1194 if (!hash->count) in ftrace_hash_clear()
1198 hhd = &hash->buckets[i]; in ftrace_hash_clear()
1200 free_hash_entry(hash, entry); in ftrace_hash_clear()
1202 FTRACE_WARN_ON(hash->count); in ftrace_hash_clear()
1227 static void free_ftrace_hash(struct ftrace_hash *hash) in free_ftrace_hash() argument
1229 if (!hash || hash == EMPTY_HASH) in free_ftrace_hash()
1231 ftrace_hash_clear(hash); in free_ftrace_hash()
1232 kfree(hash->buckets); in free_ftrace_hash()
1233 kfree(hash); in free_ftrace_hash()
1238 struct ftrace_hash *hash; in __free_ftrace_hash_rcu() local
1240 hash = container_of(rcu, struct ftrace_hash, rcu); in __free_ftrace_hash_rcu()
1241 free_ftrace_hash(hash); in __free_ftrace_hash_rcu()
1244 static void free_ftrace_hash_rcu(struct ftrace_hash *hash) in free_ftrace_hash_rcu() argument
1246 if (!hash || hash == EMPTY_HASH) in free_ftrace_hash_rcu()
1248 call_rcu(&hash->rcu, __free_ftrace_hash_rcu); in free_ftrace_hash_rcu()
1265 struct ftrace_hash *hash; in alloc_ftrace_hash() local
1268 hash = kzalloc(sizeof(*hash), GFP_KERNEL); in alloc_ftrace_hash()
1269 if (!hash) in alloc_ftrace_hash()
1273 hash->buckets = kcalloc(size, sizeof(*hash->buckets), GFP_KERNEL); in alloc_ftrace_hash()
1275 if (!hash->buckets) { in alloc_ftrace_hash()
1276 kfree(hash); in alloc_ftrace_hash()
1280 hash->size_bits = size_bits; in alloc_ftrace_hash()
1282 return hash; in alloc_ftrace_hash()
1316 alloc_and_copy_ftrace_hash(int size_bits, struct ftrace_hash *hash) in alloc_and_copy_ftrace_hash() argument
1328 if (hash) in alloc_and_copy_ftrace_hash()
1329 new_hash->flags = hash->flags; in alloc_and_copy_ftrace_hash()
1332 if (ftrace_hash_empty(hash)) in alloc_and_copy_ftrace_hash()
1335 size = 1 << hash->size_bits; in alloc_and_copy_ftrace_hash()
1337 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in alloc_and_copy_ftrace_hash()
1344 FTRACE_WARN_ON(new_hash->count != hash->count); in alloc_and_copy_ftrace_hash()
1450 struct ftrace_ops_hash *hash) in hash_contains_ip() argument
1458 return (ftrace_hash_empty(hash->filter_hash) || in hash_contains_ip()
1459 __ftrace_lookup_ip(hash->filter_hash, ip)) && in hash_contains_ip()
1460 (ftrace_hash_empty(hash->notrace_hash) || in hash_contains_ip()
1461 !__ftrace_lookup_ip(hash->notrace_hash, ip)); in hash_contains_ip()
1479 struct ftrace_ops_hash hash; in ftrace_ops_test() local
1492 rcu_assign_pointer(hash.filter_hash, ops->func_hash->filter_hash); in ftrace_ops_test()
1493 rcu_assign_pointer(hash.notrace_hash, ops->func_hash->notrace_hash); in ftrace_ops_test()
1495 if (hash_contains_ip(ip, &hash)) in ftrace_ops_test()
1670 struct ftrace_hash *hash; in __ftrace_hash_rec_update() local
1694 hash = ops->func_hash->filter_hash; in __ftrace_hash_rec_update()
1696 if (ftrace_hash_empty(hash)) in __ftrace_hash_rec_update()
1700 hash = ops->func_hash->notrace_hash; in __ftrace_hash_rec_update()
1706 if (ftrace_hash_empty(hash)) in __ftrace_hash_rec_update()
1726 in_hash = !!ftrace_lookup_ip(hash, rec->ip); in __ftrace_hash_rec_update()
1829 if (!all && count == hash->count) in __ftrace_hash_rec_update()
2002 struct ftrace_hash *hash = ops->func_hash->filter_hash; in ftrace_hash_ipmodify_enable() local
2004 if (ftrace_hash_empty(hash)) in ftrace_hash_ipmodify_enable()
2005 hash = NULL; in ftrace_hash_ipmodify_enable()
2007 return __ftrace_hash_update_ipmodify(ops, EMPTY_HASH, hash); in ftrace_hash_ipmodify_enable()
2013 struct ftrace_hash *hash = ops->func_hash->filter_hash; in ftrace_hash_ipmodify_disable() local
2015 if (ftrace_hash_empty(hash)) in ftrace_hash_ipmodify_disable()
2016 hash = NULL; in ftrace_hash_ipmodify_disable()
2018 __ftrace_hash_update_ipmodify(ops, hash, EMPTY_HASH); in ftrace_hash_ipmodify_disable()
3286 struct ftrace_hash *hash; member
3301 struct ftrace_hash *hash; in t_probe_next() local
3325 hash = iter->probe->ops.func_hash->filter_hash; in t_probe_next()
3331 if (!hash || hash == EMPTY_HASH) in t_probe_next()
3334 size = 1 << hash->size_bits; in t_probe_next()
3342 hash = iter->probe->ops.func_hash->filter_hash; in t_probe_next()
3343 size = 1 << hash->size_bits; in t_probe_next()
3347 hhd = &hash->buckets[iter->pidx]; in t_probe_next()
3520 !ftrace_lookup_ip(iter->hash, rec->ip)) || in t_func_next()
3599 ftrace_hash_empty(iter->hash)) { in t_start()
3895 struct ftrace_hash *hash; in ftrace_regex_open() local
3922 hash = ops->func_hash->notrace_hash; in ftrace_regex_open()
3925 hash = ops->func_hash->filter_hash; in ftrace_regex_open()
3935 iter->hash = alloc_ftrace_hash(size_bits); in ftrace_regex_open()
3938 iter->hash = alloc_and_copy_ftrace_hash(size_bits, hash); in ftrace_regex_open()
3941 if (!iter->hash) { in ftrace_regex_open()
3946 iter->hash = hash; in ftrace_regex_open()
3959 free_ftrace_hash(iter->hash); in ftrace_regex_open()
4052 enter_record(struct ftrace_hash *hash, struct dyn_ftrace *rec, int clear_filter) in enter_record() argument
4057 entry = ftrace_lookup_ip(hash, rec->ip); in enter_record()
4063 free_hash_entry(hash, entry); in enter_record()
4069 ret = add_hash_entry(hash, rec->ip); in enter_record()
4075 add_rec_by_index(struct ftrace_hash *hash, struct ftrace_glob *func_g, in add_rec_by_index() argument
4093 enter_record(hash, rec, clear_filter); in add_rec_by_index()
4161 match_records(struct ftrace_hash *hash, char *func, int len, char *mod) in match_records() argument
4191 found = add_rec_by_index(hash, &func_g, clear_filter); in match_records()
4201 ret = enter_record(hash, rec, clear_filter); in match_records()
4216 ftrace_match_records(struct ftrace_hash *hash, char *buff, int len) in ftrace_match_records() argument
4218 return match_records(hash, buff, len, NULL); in ftrace_match_records()
4254 struct ftrace_hash *hash, in ftrace_hash_move_and_update_ops() argument
4264 ret = ftrace_hash_move(ops, enable, orig_hash, hash); in ftrace_hash_move_and_update_ops()
4434 ftrace_mod_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_mod_callback() argument
4452 ret = match_records(hash, func, strlen(func), module); in ftrace_mod_callback()
4498 struct ftrace_hash hash; member
4508 struct ftrace_hash *hash; in allocate_ftrace_func_mapper() local
4515 hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS); in allocate_ftrace_func_mapper()
4516 return (struct ftrace_func_mapper *)hash; in allocate_ftrace_func_mapper()
4536 entry = ftrace_lookup_ip(&mapper->hash, ip); in ftrace_func_mapper_find_ip()
4558 entry = ftrace_lookup_ip(&mapper->hash, ip); in ftrace_func_mapper_add_ip()
4569 __add_hash_entry(&mapper->hash, &map->entry); in ftrace_func_mapper_add_ip()
4591 entry = ftrace_lookup_ip(&mapper->hash, ip); in ftrace_func_mapper_remove_ip()
4598 remove_hash_entry(&mapper->hash, entry); in ftrace_func_mapper_remove_ip()
4623 if (free_func && mapper->hash.count) { in free_ftrace_func_mapper()
4624 size = 1 << mapper->hash.size_bits; in free_ftrace_func_mapper()
4626 hhd = &mapper->hash.buckets[i]; in free_ftrace_func_mapper()
4633 free_ftrace_hash(&mapper->hash); in free_ftrace_func_mapper()
4679 struct ftrace_hash *hash; in register_ftrace_function_probe() local
4726 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, old_hash); in register_ftrace_function_probe()
4728 if (!hash) { in register_ftrace_function_probe()
4733 ret = ftrace_match_records(hash, glob, strlen(glob)); in register_ftrace_function_probe()
4742 size = 1 << hash->size_bits; in register_ftrace_function_probe()
4744 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in register_ftrace_function_probe()
4777 hash, 1); in register_ftrace_function_probe()
4794 free_ftrace_hash(hash); in register_ftrace_function_probe()
4806 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in register_ftrace_function_probe()
4825 struct ftrace_hash *hash = NULL; in unregister_ftrace_function_probe_func() local
4879 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, old_hash); in unregister_ftrace_function_probe_func()
4880 if (!hash) in unregister_ftrace_function_probe_func()
4885 size = 1 << hash->size_bits; in unregister_ftrace_function_probe_func()
4887 hlist_for_each_entry_safe(entry, tmp, &hash->buckets[i], hlist) { in unregister_ftrace_function_probe_func()
4896 remove_hash_entry(hash, entry); in unregister_ftrace_function_probe_func()
4913 if (ftrace_hash_empty(hash)) in unregister_ftrace_function_probe_func()
4917 hash, 1); in unregister_ftrace_function_probe_func()
4920 if (ftrace_enabled && !ftrace_hash_empty(hash)) in unregister_ftrace_function_probe_func()
4935 free_ftrace_hash(hash); in unregister_ftrace_function_probe_func()
5006 struct ftrace_hash *hash = iter->hash; in ftrace_process_regex() local
5015 ret = ftrace_match_records(hash, func, len); in ftrace_process_regex()
5030 ret = p->func(tr, hash, func, command, next, enable); in ftrace_process_regex()
5094 __ftrace_match_addr(struct ftrace_hash *hash, unsigned long ip, int remove) in __ftrace_match_addr() argument
5103 entry = ftrace_lookup_ip(hash, ip); in __ftrace_match_addr()
5106 free_hash_entry(hash, entry); in __ftrace_match_addr()
5110 return add_hash_entry(hash, ip); in __ftrace_match_addr()
5114 ftrace_match_addr(struct ftrace_hash *hash, unsigned long *ips, in ftrace_match_addr() argument
5121 err = __ftrace_match_addr(hash, ips[i], remove); in ftrace_match_addr()
5139 struct ftrace_hash *hash; in ftrace_set_hash() local
5153 hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS); in ftrace_set_hash()
5155 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash); in ftrace_set_hash()
5157 if (!hash) { in ftrace_set_hash()
5162 if (buf && !ftrace_match_records(hash, buf, len)) { in ftrace_set_hash()
5167 ret = ftrace_match_addr(hash, ips, cnt, remove); in ftrace_set_hash()
5173 ret = ftrace_hash_move_and_update_ops(ops, orig_hash, hash, enable); in ftrace_set_hash()
5179 free_ftrace_hash(hash); in ftrace_set_hash()
5381 struct ftrace_hash *hash; in unregister_ftrace_direct() local
5394 hash = direct_ops.func_hash->filter_hash; in unregister_ftrace_direct()
5395 if (hash->count == 1) in unregister_ftrace_direct()
5595 static void remove_direct_functions_hash(struct ftrace_hash *hash, unsigned long addr) in remove_direct_functions_hash() argument
5600 size = 1 << hash->size_bits; in remove_direct_functions_hash()
5602 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in remove_direct_functions_hash()
5636 struct ftrace_hash *hash, *free_hash = NULL; in register_ftrace_direct_multi() local
5647 hash = ops->func_hash->filter_hash; in register_ftrace_direct_multi()
5648 if (ftrace_hash_empty(hash)) in register_ftrace_direct_multi()
5654 size = 1 << hash->size_bits; in register_ftrace_direct_multi()
5656 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in register_ftrace_direct_multi()
5665 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in register_ftrace_direct_multi()
5681 remove_direct_functions_hash(hash, addr); in register_ftrace_direct_multi()
5709 struct ftrace_hash *hash = ops->func_hash->filter_hash; in unregister_ftrace_direct_multi() local
5719 remove_direct_functions_hash(hash, addr); in unregister_ftrace_direct_multi()
5732 struct ftrace_hash *hash; in __modify_ftrace_direct_multi() local
5757 hash = ops->func_hash->filter_hash; in __modify_ftrace_direct_multi()
5758 size = 1 << hash->size_bits; in __modify_ftrace_direct_multi()
5760 hlist_for_each_entry(iter, &hash->buckets[i], hlist) { in __modify_ftrace_direct_multi()
6010 static int ftrace_graph_set_hash(struct ftrace_hash *hash, char *buffer);
6039 struct ftrace_hash *hash; in set_ftrace_early_graph() local
6041 hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS); in set_ftrace_early_graph()
6042 if (MEM_FAIL(!hash, "Failed to allocate hash\n")) in set_ftrace_early_graph()
6048 ret = ftrace_graph_set_hash(hash, func); in set_ftrace_early_graph()
6055 ftrace_graph_hash = hash; in set_ftrace_early_graph()
6057 ftrace_graph_notrace_hash = hash; in set_ftrace_early_graph()
6121 iter->hash->flags &= ~FTRACE_HASH_FL_MOD; in ftrace_regex_release()
6123 iter->hash->flags |= FTRACE_HASH_FL_MOD; in ftrace_regex_release()
6130 iter->hash, filter_hash); in ftrace_regex_release()
6134 iter->hash = NULL; in ftrace_regex_release()
6138 free_ftrace_hash(iter->hash); in ftrace_regex_release()
6191 struct ftrace_hash *hash; member
6208 if (*pos >= fgd->hash->count) in __g_next()
6220 for (i = idx; i < 1 << fgd->hash->size_bits; i++) { in __g_next()
6221 head = &fgd->hash->buckets[i]; in __g_next()
6245 fgd->hash = rcu_dereference_protected(ftrace_graph_hash, in g_start()
6248 fgd->hash = rcu_dereference_protected(ftrace_graph_notrace_hash, in g_start()
6252 if (ftrace_hash_empty(fgd->hash) && !*pos) in g_start()
6315 fgd->hash); in __ftrace_graph_open()
6346 fgd->hash = NULL; in __ftrace_graph_open()
6366 fgd->hash = rcu_dereference_protected(ftrace_graph_hash, in ftrace_graph_open()
6394 fgd->hash = rcu_dereference_protected(ftrace_graph_notrace_hash, in ftrace_graph_notrace_open()
6478 ftrace_graph_set_hash(struct ftrace_hash *hash, char *buffer) in ftrace_graph_set_hash() argument
6506 entry = ftrace_lookup_ip(hash, rec->ip); in ftrace_graph_set_hash()
6513 if (add_hash_entry(hash, rec->ip) < 0) in ftrace_graph_set_hash()
6517 free_hash_entry(hash, entry); in ftrace_graph_set_hash()
6893 clear_mod_from_hash(struct ftrace_page *pg, struct ftrace_hash *hash) in clear_mod_from_hash() argument
6899 if (ftrace_hash_empty(hash)) in clear_mod_from_hash()
6904 entry = __ftrace_lookup_ip(hash, rec->ip); in clear_mod_from_hash()
7284 clear_func_from_hash(struct ftrace_init_func *func, struct ftrace_hash *hash) in clear_func_from_hash() argument
7288 entry = ftrace_lookup_ip(hash, func->ip); in clear_func_from_hash()
8120 struct ftrace_hash *hash; in prepare_direct_functions_for_ipmodify() local
8129 hash = ops->func_hash->filter_hash; in prepare_direct_functions_for_ipmodify()
8130 size = 1 << hash->size_bits; in prepare_direct_functions_for_ipmodify()
8132 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in prepare_direct_functions_for_ipmodify()
8169 struct ftrace_hash *hash; in cleanup_direct_functions_after_ipmodify() local
8178 hash = ops->func_hash->filter_hash; in cleanup_direct_functions_after_ipmodify()
8179 size = 1 << hash->size_bits; in cleanup_direct_functions_after_ipmodify()
8181 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in cleanup_direct_functions_after_ipmodify()