• Home
  • Raw
  • Download

Lines Matching refs:iter

2688 	struct ftrace_rec_iter *iter = &ftrace_rec_iter;  in ftrace_rec_iter_start()  local
2690 iter->pg = ftrace_pages_start; in ftrace_rec_iter_start()
2691 iter->index = 0; in ftrace_rec_iter_start()
2694 while (iter->pg && !iter->pg->index) in ftrace_rec_iter_start()
2695 iter->pg = iter->pg->next; in ftrace_rec_iter_start()
2697 if (!iter->pg) in ftrace_rec_iter_start()
2700 return iter; in ftrace_rec_iter_start()
2709 struct ftrace_rec_iter *ftrace_rec_iter_next(struct ftrace_rec_iter *iter) in ftrace_rec_iter_next() argument
2711 iter->index++; in ftrace_rec_iter_next()
2713 if (iter->index >= iter->pg->index) { in ftrace_rec_iter_next()
2714 iter->pg = iter->pg->next; in ftrace_rec_iter_next()
2715 iter->index = 0; in ftrace_rec_iter_next()
2718 while (iter->pg && !iter->pg->index) in ftrace_rec_iter_next()
2719 iter->pg = iter->pg->next; in ftrace_rec_iter_next()
2722 if (!iter->pg) in ftrace_rec_iter_next()
2725 return iter; in ftrace_rec_iter_next()
2734 struct dyn_ftrace *ftrace_rec_iter_record(struct ftrace_rec_iter *iter) in ftrace_rec_iter_record() argument
2736 return &iter->pg->records[iter->index]; in ftrace_rec_iter_record()
3298 struct ftrace_iterator *iter = m->private; in t_probe_next() local
3299 struct trace_array *tr = iter->ops->private; in t_probe_next()
3308 iter->pos = *pos; in t_probe_next()
3317 if (!iter->probe) { in t_probe_next()
3319 iter->probe = list_entry(next, struct ftrace_func_probe, list); in t_probe_next()
3322 if (iter->probe_entry) in t_probe_next()
3323 hnd = &iter->probe_entry->hlist; in t_probe_next()
3325 hash = iter->probe->ops.func_hash->filter_hash; in t_probe_next()
3337 if (iter->pidx >= size) { in t_probe_next()
3338 if (iter->probe->list.next == func_probes) in t_probe_next()
3340 next = iter->probe->list.next; in t_probe_next()
3341 iter->probe = list_entry(next, struct ftrace_func_probe, list); in t_probe_next()
3342 hash = iter->probe->ops.func_hash->filter_hash; in t_probe_next()
3344 iter->pidx = 0; in t_probe_next()
3347 hhd = &hash->buckets[iter->pidx]; in t_probe_next()
3350 iter->pidx++; in t_probe_next()
3360 iter->pidx++; in t_probe_next()
3368 iter->probe_entry = hlist_entry(hnd, struct ftrace_func_entry, hlist); in t_probe_next()
3370 return iter; in t_probe_next()
3375 struct ftrace_iterator *iter = m->private; in t_probe_start() local
3379 if (!(iter->flags & FTRACE_ITER_DO_PROBES)) in t_probe_start()
3382 if (iter->mod_pos > *pos) in t_probe_start()
3385 iter->probe = NULL; in t_probe_start()
3386 iter->probe_entry = NULL; in t_probe_start()
3387 iter->pidx = 0; in t_probe_start()
3388 for (l = 0; l <= (*pos - iter->mod_pos); ) { in t_probe_start()
3397 iter->flags |= FTRACE_ITER_PROBE; in t_probe_start()
3399 return iter; in t_probe_start()
3403 t_probe_show(struct seq_file *m, struct ftrace_iterator *iter) in t_probe_show() argument
3409 probe = iter->probe; in t_probe_show()
3410 probe_entry = iter->probe_entry; in t_probe_show()
3429 struct ftrace_iterator *iter = m->private; in t_mod_next() local
3430 struct trace_array *tr = iter->tr; in t_mod_next()
3433 iter->pos = *pos; in t_mod_next()
3435 iter->mod_list = iter->mod_list->next; in t_mod_next()
3437 if (iter->mod_list == &tr->mod_trace || in t_mod_next()
3438 iter->mod_list == &tr->mod_notrace) { in t_mod_next()
3439 iter->flags &= ~FTRACE_ITER_MOD; in t_mod_next()
3443 iter->mod_pos = *pos; in t_mod_next()
3445 return iter; in t_mod_next()
3450 struct ftrace_iterator *iter = m->private; in t_mod_start() local
3454 if (iter->func_pos > *pos) in t_mod_start()
3457 iter->mod_pos = iter->func_pos; in t_mod_start()
3460 if (!iter->tr) in t_mod_start()
3463 for (l = 0; l <= (*pos - iter->func_pos); ) { in t_mod_start()
3469 iter->flags &= ~FTRACE_ITER_MOD; in t_mod_start()
3474 iter->flags |= FTRACE_ITER_MOD; in t_mod_start()
3476 return iter; in t_mod_start()
3480 t_mod_show(struct seq_file *m, struct ftrace_iterator *iter) in t_mod_show() argument
3483 struct trace_array *tr = iter->tr; in t_mod_show()
3485 if (WARN_ON_ONCE(!iter->mod_list) || in t_mod_show()
3486 iter->mod_list == &tr->mod_trace || in t_mod_show()
3487 iter->mod_list == &tr->mod_notrace) in t_mod_show()
3490 ftrace_mod = list_entry(iter->mod_list, struct ftrace_mod_load, list); in t_mod_show()
3505 struct ftrace_iterator *iter = m->private; in t_func_next() local
3511 if (iter->idx >= iter->pg->index) { in t_func_next()
3512 if (iter->pg->next) { in t_func_next()
3513 iter->pg = iter->pg->next; in t_func_next()
3514 iter->idx = 0; in t_func_next()
3518 rec = &iter->pg->records[iter->idx++]; in t_func_next()
3519 if (((iter->flags & (FTRACE_ITER_FILTER | FTRACE_ITER_NOTRACE)) && in t_func_next()
3520 !ftrace_lookup_ip(iter->hash, rec->ip)) || in t_func_next()
3522 ((iter->flags & FTRACE_ITER_ENABLED) && in t_func_next()
3533 iter->pos = iter->func_pos = *pos; in t_func_next()
3534 iter->func = rec; in t_func_next()
3536 return iter; in t_func_next()
3542 struct ftrace_iterator *iter = m->private; in t_next() local
3549 if (iter->flags & FTRACE_ITER_PROBE) in t_next()
3552 if (iter->flags & FTRACE_ITER_MOD) in t_next()
3555 if (iter->flags & FTRACE_ITER_PRINTALL) { in t_next()
3569 static void reset_iter_read(struct ftrace_iterator *iter) in reset_iter_read() argument
3571 iter->pos = 0; in reset_iter_read()
3572 iter->func_pos = 0; in reset_iter_read()
3573 iter->flags &= ~(FTRACE_ITER_PRINTALL | FTRACE_ITER_PROBE | FTRACE_ITER_MOD); in reset_iter_read()
3578 struct ftrace_iterator *iter = m->private; in t_start() local
3590 if (*pos < iter->pos) in t_start()
3591 reset_iter_read(iter); in t_start()
3598 if ((iter->flags & (FTRACE_ITER_FILTER | FTRACE_ITER_NOTRACE)) && in t_start()
3599 ftrace_hash_empty(iter->hash)) { in t_start()
3600 iter->func_pos = 1; /* Account for the message */ in t_start()
3603 iter->flags |= FTRACE_ITER_PRINTALL; in t_start()
3605 iter->flags &= ~FTRACE_ITER_PROBE; in t_start()
3606 return iter; in t_start()
3609 if (iter->flags & FTRACE_ITER_MOD) in t_start()
3617 iter->pg = ftrace_pages_start; in t_start()
3618 iter->idx = 0; in t_start()
3628 return iter; in t_start()
3753 struct ftrace_iterator *iter = m->private; in t_show() local
3756 if (iter->flags & FTRACE_ITER_PROBE) in t_show()
3757 return t_probe_show(m, iter); in t_show()
3759 if (iter->flags & FTRACE_ITER_MOD) in t_show()
3760 return t_mod_show(m, iter); in t_show()
3762 if (iter->flags & FTRACE_ITER_PRINTALL) { in t_show()
3763 if (iter->flags & FTRACE_ITER_NOTRACE) in t_show()
3770 rec = iter->func; in t_show()
3782 if (iter->flags & FTRACE_ITER_ENABLED) { in t_show()
3829 struct ftrace_iterator *iter; in ftrace_avail_open() local
3839 iter = __seq_open_private(file, &show_ftrace_seq_ops, sizeof(*iter)); in ftrace_avail_open()
3840 if (!iter) in ftrace_avail_open()
3843 iter->pg = ftrace_pages_start; in ftrace_avail_open()
3844 iter->ops = &global_ops; in ftrace_avail_open()
3852 struct ftrace_iterator *iter; in ftrace_enabled_open() local
3863 iter = __seq_open_private(file, &show_ftrace_seq_ops, sizeof(*iter)); in ftrace_enabled_open()
3864 if (!iter) in ftrace_enabled_open()
3867 iter->pg = ftrace_pages_start; in ftrace_enabled_open()
3868 iter->flags = FTRACE_ITER_ENABLED; in ftrace_enabled_open()
3869 iter->ops = &global_ops; in ftrace_enabled_open()
3894 struct ftrace_iterator *iter; in ftrace_regex_open() local
3908 iter = kzalloc(sizeof(*iter), GFP_KERNEL); in ftrace_regex_open()
3909 if (!iter) in ftrace_regex_open()
3912 if (trace_parser_get_init(&iter->parser, FTRACE_BUFF_MAX)) in ftrace_regex_open()
3915 iter->ops = ops; in ftrace_regex_open()
3916 iter->flags = flag; in ftrace_regex_open()
3917 iter->tr = tr; in ftrace_regex_open()
3929 iter->mod_list = mod_head; 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()
3942 trace_parser_put(&iter->parser); in ftrace_regex_open()
3946 iter->hash = hash; in ftrace_regex_open()
3951 iter->pg = ftrace_pages_start; in ftrace_regex_open()
3956 m->private = iter; in ftrace_regex_open()
3959 free_ftrace_hash(iter->hash); in ftrace_regex_open()
3960 trace_parser_put(&iter->parser); in ftrace_regex_open()
3963 file->private_data = iter; in ftrace_regex_open()
3970 kfree(iter); in ftrace_regex_open()
4675 struct ftrace_func_probe *probe = NULL, *iter; in register_ftrace_function_probe() local
4695 list_for_each_entry(iter, &tr->func_probes, list) { in register_ftrace_function_probe()
4696 if (iter->probe_ops == probe_ops) { in register_ftrace_function_probe()
4697 probe = iter; in register_ftrace_function_probe()
4819 struct ftrace_func_probe *probe = NULL, *iter; in unregister_ftrace_function_probe_func() local
4849 list_for_each_entry(iter, &tr->func_probes, list) { in unregister_ftrace_function_probe_func()
4850 if (iter->probe_ops == probe_ops) { in unregister_ftrace_function_probe_func()
4851 probe = iter; in unregister_ftrace_function_probe_func()
5003 static int ftrace_process_regex(struct ftrace_iterator *iter, in ftrace_process_regex() argument
5006 struct ftrace_hash *hash = iter->hash; in ftrace_process_regex()
5007 struct trace_array *tr = iter->ops->private; in ftrace_process_regex()
5044 struct ftrace_iterator *iter; in ftrace_regex_write() local
5053 iter = m->private; in ftrace_regex_write()
5055 iter = file->private_data; in ftrace_regex_write()
5062 parser = &iter->parser; in ftrace_regex_write()
5067 ret = ftrace_process_regex(iter, parser->buffer, in ftrace_regex_write()
5733 struct ftrace_func_entry *entry, *iter; in __modify_ftrace_direct_multi() local
5760 hlist_for_each_entry(iter, &hash->buckets[i], hlist) { in __modify_ftrace_direct_multi()
5761 entry = __ftrace_lookup_ip(direct_functions, iter->ip); in __modify_ftrace_direct_multi()
6091 struct ftrace_iterator *iter; in ftrace_regex_release() local
6097 iter = m->private; in ftrace_regex_release()
6100 iter = file->private_data; in ftrace_regex_release()
6102 parser = &iter->parser; in ftrace_regex_release()
6104 int enable = !(iter->flags & FTRACE_ITER_NOTRACE); in ftrace_regex_release()
6106 ftrace_process_regex(iter, parser->buffer, in ftrace_regex_release()
6112 mutex_lock(&iter->ops->func_hash->regex_lock); in ftrace_regex_release()
6115 filter_hash = !!(iter->flags & FTRACE_ITER_FILTER); in ftrace_regex_release()
6118 orig_hash = &iter->ops->func_hash->filter_hash; in ftrace_regex_release()
6119 if (iter->tr) { in ftrace_regex_release()
6120 if (list_empty(&iter->tr->mod_trace)) in ftrace_regex_release()
6121 iter->hash->flags &= ~FTRACE_HASH_FL_MOD; in ftrace_regex_release()
6123 iter->hash->flags |= FTRACE_HASH_FL_MOD; in ftrace_regex_release()
6126 orig_hash = &iter->ops->func_hash->notrace_hash; in ftrace_regex_release()
6129 ftrace_hash_move_and_update_ops(iter->ops, orig_hash, in ftrace_regex_release()
6130 iter->hash, filter_hash); in ftrace_regex_release()
6134 iter->hash = NULL; in ftrace_regex_release()
6137 mutex_unlock(&iter->ops->func_hash->regex_lock); in ftrace_regex_release()
6138 free_ftrace_hash(iter->hash); in ftrace_regex_release()
6139 if (iter->tr) in ftrace_regex_release()
6140 trace_array_put(iter->tr); in ftrace_regex_release()
6141 kfree(iter); in ftrace_regex_release()