• Home
  • Raw
  • Download

Lines Matching refs:hash

403 	struct hlist_head		*hash;  member
580 memset(stat->hash, 0, in ftrace_profile_reset()
647 if (stat->hash) { in ftrace_profile_init_cpu()
659 stat->hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); in ftrace_profile_init_cpu()
661 if (!stat->hash) in ftrace_profile_init_cpu()
666 kfree(stat->hash); in ftrace_profile_init_cpu()
667 stat->hash = NULL; in ftrace_profile_init_cpu()
697 hhd = &stat->hash[key]; in ftrace_find_profiled_func()
716 hlist_add_head_rcu(&rec->node, &stat->hash[key]); in ftrace_add_profile()
769 if (!stat->hash || !ftrace_profile_enabled) in function_profile_call()
819 if (!stat->hash || !ftrace_profile_enabled) in profile_graph_return()
1104 ftrace_hash_key(struct ftrace_hash *hash, unsigned long ip) in ftrace_hash_key() argument
1106 if (hash->size_bits > 0) in ftrace_hash_key()
1107 return hash_long(ip, hash->size_bits); in ftrace_hash_key()
1114 __ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip) in __ftrace_lookup_ip() argument
1120 key = ftrace_hash_key(hash, ip); in __ftrace_lookup_ip()
1121 hhd = &hash->buckets[key]; in __ftrace_lookup_ip()
1141 ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip) in ftrace_lookup_ip() argument
1143 if (ftrace_hash_empty(hash)) in ftrace_lookup_ip()
1146 return __ftrace_lookup_ip(hash, ip); in ftrace_lookup_ip()
1149 static void __add_hash_entry(struct ftrace_hash *hash, in __add_hash_entry() argument
1155 key = ftrace_hash_key(hash, entry->ip); in __add_hash_entry()
1156 hhd = &hash->buckets[key]; in __add_hash_entry()
1158 hash->count++; in __add_hash_entry()
1161 static int add_hash_entry(struct ftrace_hash *hash, unsigned long ip) in add_hash_entry() argument
1170 __add_hash_entry(hash, entry); in add_hash_entry()
1176 free_hash_entry(struct ftrace_hash *hash, in free_hash_entry() argument
1181 hash->count--; in free_hash_entry()
1185 remove_hash_entry(struct ftrace_hash *hash, in remove_hash_entry() argument
1189 hash->count--; in remove_hash_entry()
1192 static void ftrace_hash_clear(struct ftrace_hash *hash) in ftrace_hash_clear() argument
1197 int size = 1 << hash->size_bits; in ftrace_hash_clear()
1200 if (!hash->count) in ftrace_hash_clear()
1204 hhd = &hash->buckets[i]; in ftrace_hash_clear()
1206 free_hash_entry(hash, entry); in ftrace_hash_clear()
1208 FTRACE_WARN_ON(hash->count); in ftrace_hash_clear()
1233 static void free_ftrace_hash(struct ftrace_hash *hash) in free_ftrace_hash() argument
1235 if (!hash || hash == EMPTY_HASH) in free_ftrace_hash()
1237 ftrace_hash_clear(hash); in free_ftrace_hash()
1238 kfree(hash->buckets); in free_ftrace_hash()
1239 kfree(hash); in free_ftrace_hash()
1244 struct ftrace_hash *hash; in __free_ftrace_hash_rcu() local
1246 hash = container_of(rcu, struct ftrace_hash, rcu); in __free_ftrace_hash_rcu()
1247 free_ftrace_hash(hash); in __free_ftrace_hash_rcu()
1250 static void free_ftrace_hash_rcu(struct ftrace_hash *hash) in free_ftrace_hash_rcu() argument
1252 if (!hash || hash == EMPTY_HASH) in free_ftrace_hash_rcu()
1254 call_rcu(&hash->rcu, __free_ftrace_hash_rcu); in free_ftrace_hash_rcu()
1266 struct ftrace_hash *hash; in alloc_ftrace_hash() local
1269 hash = kzalloc(sizeof(*hash), GFP_KERNEL); in alloc_ftrace_hash()
1270 if (!hash) in alloc_ftrace_hash()
1274 hash->buckets = kcalloc(size, sizeof(*hash->buckets), GFP_KERNEL); in alloc_ftrace_hash()
1276 if (!hash->buckets) { in alloc_ftrace_hash()
1277 kfree(hash); in alloc_ftrace_hash()
1281 hash->size_bits = size_bits; in alloc_ftrace_hash()
1283 return hash; in alloc_ftrace_hash()
1317 alloc_and_copy_ftrace_hash(int size_bits, struct ftrace_hash *hash) in alloc_and_copy_ftrace_hash() argument
1329 if (hash) in alloc_and_copy_ftrace_hash()
1330 new_hash->flags = hash->flags; in alloc_and_copy_ftrace_hash()
1333 if (ftrace_hash_empty(hash)) in alloc_and_copy_ftrace_hash()
1336 size = 1 << hash->size_bits; in alloc_and_copy_ftrace_hash()
1338 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in alloc_and_copy_ftrace_hash()
1345 FTRACE_WARN_ON(new_hash->count != hash->count); in alloc_and_copy_ftrace_hash()
1451 struct ftrace_ops_hash *hash) in hash_contains_ip() argument
1459 return (ftrace_hash_empty(hash->filter_hash) || in hash_contains_ip()
1460 __ftrace_lookup_ip(hash->filter_hash, ip)) && in hash_contains_ip()
1461 (ftrace_hash_empty(hash->notrace_hash) || in hash_contains_ip()
1462 !__ftrace_lookup_ip(hash->notrace_hash, ip)); in hash_contains_ip()
1480 struct ftrace_ops_hash hash; in ftrace_ops_test() local
1493 rcu_assign_pointer(hash.filter_hash, ops->func_hash->filter_hash); in ftrace_ops_test()
1494 rcu_assign_pointer(hash.notrace_hash, ops->func_hash->notrace_hash); in ftrace_ops_test()
1496 if (hash_contains_ip(ip, &hash)) in ftrace_ops_test()
1642 struct ftrace_hash *hash; in __ftrace_hash_rec_update() local
1666 hash = ops->func_hash->filter_hash; in __ftrace_hash_rec_update()
1668 if (ftrace_hash_empty(hash)) in __ftrace_hash_rec_update()
1672 hash = ops->func_hash->notrace_hash; in __ftrace_hash_rec_update()
1678 if (ftrace_hash_empty(hash)) in __ftrace_hash_rec_update()
1698 in_hash = !!ftrace_lookup_ip(hash, rec->ip); in __ftrace_hash_rec_update()
1801 if (!all && count == hash->count) in __ftrace_hash_rec_update()
1938 struct ftrace_hash *hash = ops->func_hash->filter_hash; in ftrace_hash_ipmodify_enable() local
1940 if (ftrace_hash_empty(hash)) in ftrace_hash_ipmodify_enable()
1941 hash = NULL; in ftrace_hash_ipmodify_enable()
1943 return __ftrace_hash_update_ipmodify(ops, EMPTY_HASH, hash); in ftrace_hash_ipmodify_enable()
1949 struct ftrace_hash *hash = ops->func_hash->filter_hash; in ftrace_hash_ipmodify_disable() local
1951 if (ftrace_hash_empty(hash)) in ftrace_hash_ipmodify_disable()
1952 hash = NULL; in ftrace_hash_ipmodify_disable()
1954 __ftrace_hash_update_ipmodify(ops, hash, EMPTY_HASH); in ftrace_hash_ipmodify_disable()
3265 struct ftrace_hash *hash; member
3280 struct ftrace_hash *hash; in t_probe_next() local
3304 hash = iter->probe->ops.func_hash->filter_hash; in t_probe_next()
3310 if (!hash || hash == EMPTY_HASH) in t_probe_next()
3313 size = 1 << hash->size_bits; in t_probe_next()
3321 hash = iter->probe->ops.func_hash->filter_hash; in t_probe_next()
3322 size = 1 << hash->size_bits; in t_probe_next()
3326 hhd = &hash->buckets[iter->pidx]; in t_probe_next()
3499 !ftrace_lookup_ip(iter->hash, rec->ip)) || in t_func_next()
3578 ftrace_hash_empty(iter->hash)) { in t_start()
3769 struct ftrace_hash *hash; in ftrace_regex_open() local
3796 hash = ops->func_hash->notrace_hash; in ftrace_regex_open()
3799 hash = ops->func_hash->filter_hash; in ftrace_regex_open()
3809 iter->hash = alloc_ftrace_hash(size_bits); in ftrace_regex_open()
3812 iter->hash = alloc_and_copy_ftrace_hash(size_bits, hash); in ftrace_regex_open()
3815 if (!iter->hash) { in ftrace_regex_open()
3820 iter->hash = hash; in ftrace_regex_open()
3833 free_ftrace_hash(iter->hash); in ftrace_regex_open()
3926 enter_record(struct ftrace_hash *hash, struct dyn_ftrace *rec, int clear_filter) in enter_record() argument
3931 entry = ftrace_lookup_ip(hash, rec->ip); in enter_record()
3937 free_hash_entry(hash, entry); in enter_record()
3943 ret = add_hash_entry(hash, rec->ip); in enter_record()
3949 add_rec_by_index(struct ftrace_hash *hash, struct ftrace_glob *func_g, in add_rec_by_index() argument
3967 enter_record(hash, rec, clear_filter); in add_rec_by_index()
4012 match_records(struct ftrace_hash *hash, char *func, int len, char *mod) in match_records() argument
4042 found = add_rec_by_index(hash, &func_g, clear_filter); in match_records()
4052 ret = enter_record(hash, rec, clear_filter); in match_records()
4067 ftrace_match_records(struct ftrace_hash *hash, char *buff, int len) in ftrace_match_records() argument
4069 return match_records(hash, buff, len, NULL); in ftrace_match_records()
4105 struct ftrace_hash *hash, in ftrace_hash_move_and_update_ops() argument
4115 ret = ftrace_hash_move(ops, enable, orig_hash, hash); in ftrace_hash_move_and_update_ops()
4285 ftrace_mod_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_mod_callback() argument
4303 ret = match_records(hash, func, strlen(func), module); in ftrace_mod_callback()
4349 struct ftrace_hash hash; member
4359 struct ftrace_hash *hash; in allocate_ftrace_func_mapper() local
4366 hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS); in allocate_ftrace_func_mapper()
4367 return (struct ftrace_func_mapper *)hash; in allocate_ftrace_func_mapper()
4387 entry = ftrace_lookup_ip(&mapper->hash, ip); in ftrace_func_mapper_find_ip()
4409 entry = ftrace_lookup_ip(&mapper->hash, ip); in ftrace_func_mapper_add_ip()
4420 __add_hash_entry(&mapper->hash, &map->entry); in ftrace_func_mapper_add_ip()
4442 entry = ftrace_lookup_ip(&mapper->hash, ip); in ftrace_func_mapper_remove_ip()
4449 remove_hash_entry(&mapper->hash, entry); in ftrace_func_mapper_remove_ip()
4474 if (free_func && mapper->hash.count) { in free_ftrace_func_mapper()
4475 size = 1 << mapper->hash.size_bits; in free_ftrace_func_mapper()
4477 hhd = &mapper->hash.buckets[i]; in free_ftrace_func_mapper()
4484 free_ftrace_hash(&mapper->hash); in free_ftrace_func_mapper()
4530 struct ftrace_hash *hash; in register_ftrace_function_probe() local
4575 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, old_hash); in register_ftrace_function_probe()
4577 if (!hash) { in register_ftrace_function_probe()
4582 ret = ftrace_match_records(hash, glob, strlen(glob)); in register_ftrace_function_probe()
4591 size = 1 << hash->size_bits; in register_ftrace_function_probe()
4593 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in register_ftrace_function_probe()
4626 hash, 1); in register_ftrace_function_probe()
4643 free_ftrace_hash(hash); in register_ftrace_function_probe()
4655 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { in register_ftrace_function_probe()
4674 struct ftrace_hash *hash = NULL; in unregister_ftrace_function_probe_func() local
4726 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, old_hash); in unregister_ftrace_function_probe_func()
4727 if (!hash) in unregister_ftrace_function_probe_func()
4732 size = 1 << hash->size_bits; in unregister_ftrace_function_probe_func()
4734 hlist_for_each_entry_safe(entry, tmp, &hash->buckets[i], hlist) { in unregister_ftrace_function_probe_func()
4743 remove_hash_entry(hash, entry); in unregister_ftrace_function_probe_func()
4760 if (ftrace_hash_empty(hash)) in unregister_ftrace_function_probe_func()
4764 hash, 1); in unregister_ftrace_function_probe_func()
4767 if (ftrace_enabled && !ftrace_hash_empty(hash)) in unregister_ftrace_function_probe_func()
4782 free_ftrace_hash(hash); in unregister_ftrace_function_probe_func()
4853 struct ftrace_hash *hash = iter->hash; in ftrace_process_regex() local
4862 ret = ftrace_match_records(hash, func, len); in ftrace_process_regex()
4877 ret = p->func(tr, hash, func, command, next, enable); in ftrace_process_regex()
4941 ftrace_match_addr(struct ftrace_hash *hash, unsigned long ip, int remove) in ftrace_match_addr() argument
4949 entry = ftrace_lookup_ip(hash, ip); in ftrace_match_addr()
4952 free_hash_entry(hash, entry); in ftrace_match_addr()
4956 return add_hash_entry(hash, ip); in ftrace_match_addr()
4964 struct ftrace_hash *hash; in ftrace_set_hash() local
4978 hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS); in ftrace_set_hash()
4980 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash); in ftrace_set_hash()
4982 if (!hash) { in ftrace_set_hash()
4987 if (buf && !ftrace_match_records(hash, buf, len)) { in ftrace_set_hash()
4992 ret = ftrace_match_addr(hash, ip, remove); in ftrace_set_hash()
4998 ret = ftrace_hash_move_and_update_ops(ops, orig_hash, hash, enable); in ftrace_set_hash()
5004 free_ftrace_hash(hash); in ftrace_set_hash()
5549 static int ftrace_graph_set_hash(struct ftrace_hash *hash, char *buffer);
5578 struct ftrace_hash *hash; in set_ftrace_early_graph() local
5580 hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS); in set_ftrace_early_graph()
5581 if (MEM_FAIL(!hash, "Failed to allocate hash\n")) in set_ftrace_early_graph()
5587 ret = ftrace_graph_set_hash(hash, func); in set_ftrace_early_graph()
5594 ftrace_graph_hash = hash; in set_ftrace_early_graph()
5596 ftrace_graph_notrace_hash = hash; in set_ftrace_early_graph()
5660 iter->hash->flags &= ~FTRACE_HASH_FL_MOD; in ftrace_regex_release()
5662 iter->hash->flags |= FTRACE_HASH_FL_MOD; in ftrace_regex_release()
5669 iter->hash, filter_hash); in ftrace_regex_release()
5673 iter->hash = NULL; in ftrace_regex_release()
5677 free_ftrace_hash(iter->hash); in ftrace_regex_release()
5730 struct ftrace_hash *hash; member
5747 if (*pos >= fgd->hash->count) in __g_next()
5759 for (i = idx; i < 1 << fgd->hash->size_bits; i++) { in __g_next()
5760 head = &fgd->hash->buckets[i]; in __g_next()
5784 fgd->hash = rcu_dereference_protected(ftrace_graph_hash, in g_start()
5787 fgd->hash = rcu_dereference_protected(ftrace_graph_notrace_hash, in g_start()
5791 if (ftrace_hash_empty(fgd->hash) && !*pos) in g_start()
5854 fgd->hash); in __ftrace_graph_open()
5885 fgd->hash = NULL; in __ftrace_graph_open()
5905 fgd->hash = rcu_dereference_protected(ftrace_graph_hash, in ftrace_graph_open()
5933 fgd->hash = rcu_dereference_protected(ftrace_graph_notrace_hash, in ftrace_graph_notrace_open()
6017 ftrace_graph_set_hash(struct ftrace_hash *hash, char *buffer) in ftrace_graph_set_hash() argument
6045 entry = ftrace_lookup_ip(hash, rec->ip); in ftrace_graph_set_hash()
6052 if (add_hash_entry(hash, rec->ip) < 0) in ftrace_graph_set_hash()
6056 free_hash_entry(hash, entry); in ftrace_graph_set_hash()
6370 clear_mod_from_hash(struct ftrace_page *pg, struct ftrace_hash *hash) in clear_mod_from_hash() argument
6376 if (ftrace_hash_empty(hash)) in clear_mod_from_hash()
6381 entry = __ftrace_lookup_ip(hash, rec->ip); in clear_mod_from_hash()
6749 clear_func_from_hash(struct ftrace_init_func *func, struct ftrace_hash *hash) in clear_func_from_hash() argument
6753 entry = ftrace_lookup_ip(hash, func->ip); in clear_func_from_hash()