Lines Matching refs:data
584 struct action_data *data, u64 *var_ref_vals);
724 struct track_data *data = kzalloc(sizeof(*data), GFP_KERNEL); in track_data_alloc() local
727 if (!data) in track_data_alloc()
730 data->key = kzalloc(key_len, GFP_KERNEL); in track_data_alloc()
731 if (!data->key) { in track_data_alloc()
732 track_data_free(data); in track_data_alloc()
736 data->key_len = key_len; in track_data_alloc()
737 data->action_data = action_data; in track_data_alloc()
738 data->hist_data = hist_data; in track_data_alloc()
742 track_data_free(data); in track_data_alloc()
746 data->elt.private_data = elt_data; in track_data_alloc()
750 track_data_free(data); in track_data_alloc()
754 return data; in track_data_alloc()
841 __data = probe_func_ptr->data; in trace_synth()
852 struct action_data *data, u64 *var_ref_vals) in action_trace() argument
854 struct synth_event *event = data->synth_event; in action_trace()
856 trace_synth(event, var_ref_vals, data->var_ref_idx); in action_trace()
1212 struct action_data *data = hist_data->actions[i]; in find_match_var() local
1214 if (data->handler == HANDLER_ONMATCH) { in find_match_var()
1215 char *system = data->match_data.event_system; in find_match_var()
1216 char *event_name = data->match_data.event; in find_match_var()
3139 struct action_data *data, u64 *var_ref_vals) in save_track_data_vars() argument
3297 struct action_data *data) in get_track_val() argument
3299 unsigned int track_var_idx = data->track_data.track_var->var.idx; in get_track_val()
3309 struct action_data *data, u64 var_val) in save_track_val() argument
3311 unsigned int track_var_idx = data->track_data.track_var->var.idx; in save_track_val()
3320 struct action_data *data, u64 *var_ref_vals) in save_track_data() argument
3322 if (data->track_data.save_data) in save_track_data()
3323 data->track_data.save_data(hist_data, elt, buffer, rec, rbe, in save_track_data()
3324 key, data, var_ref_vals); in save_track_data()
3328 struct action_data *data, in check_track_val() argument
3334 hist_data = data->track_data.track_var->hist_data; in check_track_val()
3335 track_val = get_track_val(hist_data, elt, data); in check_track_val()
3337 return data->track_data.check_val(track_val, var_val); in check_track_val()
3378 struct action_data *data, in save_track_data_snapshot() argument
3403 struct action_data *data = hist_data->actions[i]; in snapshot_action() local
3405 if (data->action == ACTION_SNAPSHOT) in snapshot_action()
3406 return data; in snapshot_action()
3448 struct action_data *data, in save_track_data_snapshot() argument
3457 struct action_data *data) in track_data_print() argument
3459 u64 track_val = get_track_val(hist_data, elt, data); in track_data_print()
3462 if (data->handler == HANDLER_ONMAX) in track_data_print()
3464 else if (data->handler == HANDLER_ONCHANGE) in track_data_print()
3467 if (data->action == ACTION_SNAPSHOT) in track_data_print()
3491 struct action_data *data, u64 *var_ref_vals) in ontrack_action() argument
3493 u64 var_val = var_ref_vals[data->track_data.var_ref->var_ref_idx]; in ontrack_action()
3495 if (check_track_val(elt, data, var_val)) { in ontrack_action()
3496 save_track_val(hist_data, elt, data, var_val); in ontrack_action()
3498 key, data, var_ref_vals); in ontrack_action()
3502 static void action_data_destroy(struct action_data *data) in action_data_destroy() argument
3508 kfree(data->action_name); in action_data_destroy()
3510 for (i = 0; i < data->n_params; i++) in action_data_destroy()
3511 kfree(data->params[i]); in action_data_destroy()
3513 if (data->synth_event) in action_data_destroy()
3514 data->synth_event->ref--; in action_data_destroy()
3516 kfree(data->synth_event_name); in action_data_destroy()
3518 kfree(data); in action_data_destroy()
3522 struct action_data *data) in track_data_destroy() argument
3526 destroy_hist_field(data->track_data.track_var, 0); in track_data_destroy()
3528 if (data->action == ACTION_SNAPSHOT) { in track_data_destroy()
3538 kfree(data->track_data.var_str); in track_data_destroy()
3540 action_data_destroy(data); in track_data_destroy()
3544 struct action_data *data);
3547 struct action_data *data) in track_data_create() argument
3555 track_data_var_str = data->track_data.var_str; in track_data_create()
3572 data->track_data.var_ref = ref_field; in track_data_create()
3574 if (data->handler == HANDLER_ONMAX) in track_data_create()
3582 if (data->handler == HANDLER_ONCHANGE) in track_data_create()
3589 data->track_data.track_var = track_var; in track_data_create()
3591 ret = action_create(hist_data, data); in track_data_create()
3597 struct action_data *data) in parse_action_params() argument
3604 if (data->n_params >= SYNTH_FIELDS_MAX) { in parse_action_params()
3630 if (first_param && data->use_trace_keyword) { in parse_action_params()
3631 data->synth_event_name = saved_param; in parse_action_params()
3637 data->params[data->n_params++] = saved_param; in parse_action_params()
3643 static int action_parse(struct trace_array *tr, char *str, struct action_data *data, in action_parse() argument
3672 ret = parse_action_params(tr, params, data); in action_parse()
3677 data->track_data.check_val = check_track_val_max; in action_parse()
3679 data->track_data.check_val = check_track_val_changed; in action_parse()
3686 data->track_data.save_data = save_track_data_vars; in action_parse()
3687 data->fn = ontrack_action; in action_parse()
3688 data->action = ACTION_SAVE; in action_parse()
3699 data->track_data.check_val = check_track_val_max; in action_parse()
3701 data->track_data.check_val = check_track_val_changed; in action_parse()
3708 data->track_data.save_data = save_track_data_snapshot; in action_parse()
3709 data->fn = ontrack_action; in action_parse()
3710 data->action = ACTION_SNAPSHOT; in action_parse()
3715 data->use_trace_keyword = true; in action_parse()
3718 ret = parse_action_params(tr, params, data); in action_parse()
3724 data->track_data.check_val = check_track_val_max; in action_parse()
3726 data->track_data.check_val = check_track_val_changed; in action_parse()
3729 data->track_data.save_data = action_trace; in action_parse()
3730 data->fn = ontrack_action; in action_parse()
3732 data->fn = action_trace; in action_parse()
3734 data->action = ACTION_TRACE; in action_parse()
3737 data->action_name = kstrdup(action_name, GFP_KERNEL); in action_parse()
3738 if (!data->action_name) { in action_parse()
3743 data->handler = handler; in action_parse()
3751 struct action_data *data; in track_data_parse() local
3755 data = kzalloc(sizeof(*data), GFP_KERNEL); in track_data_parse()
3756 if (!data) in track_data_parse()
3765 data->track_data.var_str = kstrdup(var_str, GFP_KERNEL); in track_data_parse()
3766 if (!data->track_data.var_str) { in track_data_parse()
3771 ret = action_parse(hist_data->event_file->tr, str, data, handler); in track_data_parse()
3775 return data; in track_data_parse()
3777 track_data_destroy(hist_data, data); in track_data_parse()
3778 data = ERR_PTR(ret); in track_data_parse()
3782 static void onmatch_destroy(struct action_data *data) in onmatch_destroy() argument
3784 kfree(data->match_data.event); in onmatch_destroy()
3785 kfree(data->match_data.event_system); in onmatch_destroy()
3787 action_data_destroy(data); in onmatch_destroy()
3856 struct action_data *data, in trace_action_find_var() argument
3866 if (!system && data->handler == HANDLER_ONMATCH) { in trace_action_find_var()
3867 system = data->match_data.event_system; in trace_action_find_var()
3868 event = data->match_data.event; in trace_action_find_var()
3882 struct action_data *data, char *system, in trace_action_create_field_var() argument
3906 if (!system && data->handler == HANDLER_ONMATCH) { in trace_action_create_field_var()
3907 system = data->match_data.event_system; in trace_action_create_field_var()
3908 event = data->match_data.event; in trace_action_create_field_var()
3933 struct action_data *data) in trace_action_create() argument
3947 if (data->n_params > SYNTH_FIELDS_MAX) in trace_action_create()
3950 if (data->use_trace_keyword) in trace_action_create()
3951 synth_event_name = data->synth_event_name; in trace_action_create()
3953 synth_event_name = data->action_name; in trace_action_create()
3963 for (i = 0; i < data->n_params; i++) { in trace_action_create()
3966 p = param = kstrdup(data->params[i], GFP_KERNEL); in trace_action_create()
3986 hist_field = trace_action_find_var(hist_data, data, in trace_action_create()
3991 data, in trace_action_create()
4018 data->var_ref_idx[i] = var_ref_idx; in trace_action_create()
4037 data->synth_event = event; in trace_action_create()
4047 struct action_data *data) in action_create() argument
4057 if (data->action == ACTION_TRACE) in action_create()
4058 return trace_action_create(hist_data, data); in action_create()
4060 if (data->action == ACTION_SNAPSHOT) { in action_create()
4061 track_data = track_data_alloc(hist_data->key_size, data, hist_data); in action_create()
4075 if (data->action == ACTION_SAVE) { in action_create()
4082 for (i = 0; i < data->n_params; i++) { in action_create()
4083 param = kstrdup(data->params[i], GFP_KERNEL); in action_create()
4109 struct action_data *data) in onmatch_create() argument
4111 return action_create(hist_data, data); in onmatch_create()
4117 struct action_data *data; in onmatch_parse() local
4120 data = kzalloc(sizeof(*data), GFP_KERNEL); in onmatch_parse()
4121 if (!data) in onmatch_parse()
4141 data->match_data.event = kstrdup(match_event, GFP_KERNEL); in onmatch_parse()
4142 if (!data->match_data.event) { in onmatch_parse()
4147 data->match_data.event_system = kstrdup(match_event_system, GFP_KERNEL); in onmatch_parse()
4148 if (!data->match_data.event_system) { in onmatch_parse()
4153 ret = action_parse(tr, str, data, HANDLER_ONMATCH); in onmatch_parse()
4157 return data; in onmatch_parse()
4159 onmatch_destroy(data); in onmatch_parse()
4160 data = ERR_PTR(ret); in onmatch_parse()
4719 struct action_data *data = hist_data->actions[i]; in destroy_actions() local
4721 if (data->handler == HANDLER_ONMATCH) in destroy_actions()
4722 onmatch_destroy(data); in destroy_actions()
4723 else if (data->handler == HANDLER_ONMAX || in destroy_actions()
4724 data->handler == HANDLER_ONCHANGE) in destroy_actions()
4725 track_data_destroy(hist_data, data); in destroy_actions()
4727 kfree(data); in destroy_actions()
4734 struct action_data *data; in parse_actions() local
4746 data = onmatch_parse(tr, action_str); in parse_actions()
4747 if (IS_ERR(data)) { in parse_actions()
4748 ret = PTR_ERR(data); in parse_actions()
4754 data = track_data_parse(hist_data, action_str, in parse_actions()
4756 if (IS_ERR(data)) { in parse_actions()
4757 ret = PTR_ERR(data); in parse_actions()
4763 data = track_data_parse(hist_data, action_str, in parse_actions()
4765 if (IS_ERR(data)) { in parse_actions()
4766 ret = PTR_ERR(data); in parse_actions()
4774 hist_data->actions[hist_data->n_actions++] = data; in parse_actions()
4782 struct action_data *data; in create_actions() local
4787 data = hist_data->actions[i]; in create_actions()
4789 if (data->handler == HANDLER_ONMATCH) { in create_actions()
4790 ret = onmatch_create(hist_data, data); in create_actions()
4793 } else if (data->handler == HANDLER_ONMAX || in create_actions()
4794 data->handler == HANDLER_ONCHANGE) { in create_actions()
4795 ret = track_data_create(hist_data, data); in create_actions()
4814 struct action_data *data = hist_data->actions[i]; in print_actions() local
4816 if (data->action == ACTION_SNAPSHOT) in print_actions()
4819 if (data->handler == HANDLER_ONMAX || in print_actions()
4820 data->handler == HANDLER_ONCHANGE) in print_actions()
4821 track_data_print(m, hist_data, elt, data); in print_actions()
4827 struct action_data *data) in print_action_spec() argument
4831 if (data->action == ACTION_SAVE) { in print_action_spec()
4837 } else if (data->action == ACTION_TRACE) { in print_action_spec()
4838 if (data->use_trace_keyword) in print_action_spec()
4839 seq_printf(m, "%s", data->synth_event_name); in print_action_spec()
4840 for (i = 0; i < data->n_params; i++) { in print_action_spec()
4841 if (i || data->use_trace_keyword) in print_action_spec()
4843 seq_printf(m, "%s", data->params[i]); in print_action_spec()
4850 struct action_data *data) in print_track_data_spec() argument
4852 if (data->handler == HANDLER_ONMAX) in print_track_data_spec()
4854 else if (data->handler == HANDLER_ONCHANGE) in print_track_data_spec()
4856 seq_printf(m, "%s", data->track_data.var_str); in print_track_data_spec()
4857 seq_printf(m, ").%s(", data->action_name); in print_track_data_spec()
4859 print_action_spec(m, hist_data, data); in print_track_data_spec()
4866 struct action_data *data) in print_onmatch_spec() argument
4868 seq_printf(m, ":onmatch(%s.%s).", data->match_data.event_system, in print_onmatch_spec()
4869 data->match_data.event); in print_onmatch_spec()
4871 seq_printf(m, "%s(", data->action_name); in print_onmatch_spec()
4873 print_action_spec(m, hist_data, data); in print_onmatch_spec()
4887 struct action_data *data = hist_data->actions[i]; in actions_match() local
4891 if (data->handler != data_test->handler) in actions_match()
4893 if (data->action != data_test->action) in actions_match()
4896 if (data->n_params != data_test->n_params) in actions_match()
4899 for (j = 0; j < data->n_params; j++) { in actions_match()
4900 if (strcmp(data->params[j], data_test->params[j]) != 0) in actions_match()
4904 if (data->use_trace_keyword) in actions_match()
4905 action_name = data->synth_event_name; in actions_match()
4907 action_name = data->action_name; in actions_match()
4917 if (data->handler == HANDLER_ONMATCH) { in actions_match()
4918 if (strcmp(data->match_data.event_system, in actions_match()
4921 if (strcmp(data->match_data.event, in actions_match()
4924 } else if (data->handler == HANDLER_ONMAX || in actions_match()
4925 data->handler == HANDLER_ONCHANGE) { in actions_match()
4926 if (strcmp(data->track_data.var_str, in actions_match()
4942 struct action_data *data = hist_data->actions[i]; in print_actions_spec() local
4944 if (data->handler == HANDLER_ONMATCH) in print_actions_spec()
4945 print_onmatch_spec(m, hist_data, data); in print_actions_spec()
4946 else if (data->handler == HANDLER_ONMAX || in print_actions_spec()
4947 data->handler == HANDLER_ONCHANGE) in print_actions_spec()
4948 print_track_data_spec(m, hist_data, data); in print_actions_spec()
5165 struct action_data *data; in hist_trigger_actions() local
5169 data = hist_data->actions[i]; in hist_trigger_actions()
5170 data->fn(hist_data, elt, buffer, rec, rbe, key, data, var_ref_vals); in hist_trigger_actions()
5174 static void event_hist_trigger(struct event_trigger_data *data, in event_hist_trigger() argument
5178 struct hist_trigger_data *hist_data = data->private_data; in event_hist_trigger()
5482 struct event_trigger_data *data, int n) in hist_trigger_show() argument
5491 data->ops->print(m, data); in hist_trigger_show()
5494 hist_data = data->private_data; in hist_trigger_show()
5508 struct event_trigger_data *data; in hist_show() local
5520 list_for_each_entry(data, &event_file->triggers, list) { in hist_show()
5521 if (data->cmd_ops->trigger_type == ETT_EVENT_HIST) in hist_show()
5522 hist_trigger_show(m, data, n++); in hist_show()
5658 struct action_data *data, int i) in hist_action_debug_show() argument
5662 if (data->handler == HANDLER_ONMAX || in hist_action_debug_show()
5663 data->handler == HANDLER_ONCHANGE) { in hist_action_debug_show()
5665 ret = hist_field_debug_show(m, data->track_data.var_ref, in hist_action_debug_show()
5671 ret = hist_field_debug_show(m, data->track_data.track_var, in hist_action_debug_show()
5677 if (data->handler == HANDLER_ONMATCH) { in hist_action_debug_show()
5679 i, data->match_data.event_system); in hist_action_debug_show()
5681 i, data->match_data.event); in hist_action_debug_show()
5716 struct event_trigger_data *data, int n) in hist_trigger_debug_show() argument
5725 data->ops->print(m, data); in hist_trigger_debug_show()
5728 hist_data = data->private_data; in hist_trigger_debug_show()
5787 struct event_trigger_data *data; in hist_debug_show() local
5799 list_for_each_entry(data, &event_file->triggers, list) { in hist_debug_show()
5800 if (data->cmd_ops->trigger_type == ETT_EVENT_HIST) in hist_debug_show()
5801 hist_trigger_debug_show(m, data, n++); in hist_debug_show()
5864 struct event_trigger_data *data) in event_hist_trigger_print() argument
5866 struct hist_trigger_data *hist_data = data->private_data; in event_hist_trigger_print()
5873 if (data->name) in event_hist_trigger_print()
5874 seq_printf(m, "%s:", data->name); in event_hist_trigger_print()
5958 if (data->filter_str) in event_hist_trigger_print()
5959 seq_printf(m, " if %s", data->filter_str); in event_hist_trigger_print()
5961 if (data->paused) in event_hist_trigger_print()
5971 static int event_hist_trigger_init(struct event_trigger_data *data) in event_hist_trigger_init() argument
5973 struct hist_trigger_data *hist_data = data->private_data; in event_hist_trigger_init()
5975 if (!data->ref && hist_data->attrs->name) in event_hist_trigger_init()
5976 save_named_trigger(hist_data->attrs->name, data); in event_hist_trigger_init()
5978 data->ref++; in event_hist_trigger_init()
5999 static void event_hist_trigger_free(struct event_trigger_data *data) in event_hist_trigger_free() argument
6001 struct hist_trigger_data *hist_data = data->private_data; in event_hist_trigger_free()
6003 if (WARN_ON_ONCE(data->ref <= 0)) in event_hist_trigger_free()
6006 data->ref--; in event_hist_trigger_free()
6007 if (!data->ref) { in event_hist_trigger_free()
6008 if (data->name) in event_hist_trigger_free()
6009 del_named_trigger(data); in event_hist_trigger_free()
6011 trigger_data_free(data); in event_hist_trigger_free()
6028 static int event_hist_trigger_named_init(struct event_trigger_data *data) in event_hist_trigger_named_init() argument
6030 data->ref++; in event_hist_trigger_named_init()
6032 save_named_trigger(data->named_data->name, data); in event_hist_trigger_named_init()
6034 event_hist_trigger_init(data->named_data); in event_hist_trigger_named_init()
6039 static void event_hist_trigger_named_free(struct event_trigger_data *data) in event_hist_trigger_named_free() argument
6041 if (WARN_ON_ONCE(data->ref <= 0)) in event_hist_trigger_named_free()
6044 event_hist_trigger_free(data->named_data); in event_hist_trigger_named_free()
6046 data->ref--; in event_hist_trigger_named_free()
6047 if (!data->ref) { in event_hist_trigger_named_free()
6048 del_named_trigger(data); in event_hist_trigger_named_free()
6049 trigger_data_free(data); in event_hist_trigger_named_free()
6066 static void hist_clear(struct event_trigger_data *data) in hist_clear() argument
6068 struct hist_trigger_data *hist_data = data->private_data; in hist_clear()
6070 if (data->name) in hist_clear()
6071 pause_named_trigger(data); in hist_clear()
6077 if (data->name) in hist_clear()
6078 unpause_named_trigger(data); in hist_clear()
6100 static bool hist_trigger_match(struct event_trigger_data *data, in hist_trigger_match() argument
6117 hist_data = data->private_data; in hist_trigger_match()
6126 if ((data->filter_str && !data_test->filter_str) || in hist_trigger_match()
6127 (!data->filter_str && data_test->filter_str)) in hist_trigger_match()
6161 if (!ignore_filter && data->filter_str && in hist_trigger_match()
6162 (strcmp(data->filter_str, data_test->filter_str) != 0)) in hist_trigger_match()
6172 struct event_trigger_data *data, in existing_hist_update_only() argument
6175 struct hist_trigger_data *hist_data = data->private_data; in existing_hist_update_only()
6186 if (!hist_trigger_match(data, named_data, named_data, in existing_hist_update_only()
6197 if (!hist_trigger_match(data, test, named_data, false)) in existing_hist_update_only()
6214 struct event_trigger_data *data, in hist_register_trigger() argument
6217 struct hist_trigger_data *hist_data = data->private_data; in hist_register_trigger()
6225 if (!hist_trigger_match(data, named_data, named_data, in hist_register_trigger()
6241 if (hist_trigger_match(data, test, named_data, false)) { in hist_register_trigger()
6256 data->paused = true; in hist_register_trigger()
6259 data->private_data = named_data->private_data; in hist_register_trigger()
6260 set_named_trigger_data(data, named_data); in hist_register_trigger()
6261 data->ops = &event_hist_trigger_named_ops; in hist_register_trigger()
6264 if (data->ops->init) { in hist_register_trigger()
6265 ret = data->ops->init(data); in hist_register_trigger()
6288 static int hist_trigger_enable(struct event_trigger_data *data, in hist_trigger_enable() argument
6293 list_add_tail_rcu(&data->list, &file->triggers); in hist_trigger_enable()
6298 list_del_rcu(&data->list); in hist_trigger_enable()
6306 static bool have_hist_trigger_match(struct event_trigger_data *data, in have_hist_trigger_match() argument
6309 struct hist_trigger_data *hist_data = data->private_data; in have_hist_trigger_match()
6320 if (hist_trigger_match(data, test, named_data, false)) { in have_hist_trigger_match()
6330 static bool hist_trigger_check_refs(struct event_trigger_data *data, in hist_trigger_check_refs() argument
6333 struct hist_trigger_data *hist_data = data->private_data; in hist_trigger_check_refs()
6343 if (!hist_trigger_match(data, test, named_data, false)) in hist_trigger_check_refs()
6356 struct event_trigger_data *data, in hist_unregister_trigger() argument
6360 struct hist_trigger_data *hist_data = data->private_data; in hist_unregister_trigger()
6369 if (!hist_trigger_match(data, iter, named_data, false)) in hist_unregister_trigger()
6624 hist_enable_trigger(struct event_trigger_data *data, in hist_enable_trigger() argument
6628 struct enable_trigger_data *enable_data = data->private_data; in hist_enable_trigger()
6643 hist_enable_count_trigger(struct event_trigger_data *data, in hist_enable_count_trigger() argument
6647 if (!data->count) in hist_enable_count_trigger()
6650 if (data->count != -1) in hist_enable_count_trigger()
6651 (data->count)--; in hist_enable_count_trigger()
6653 hist_enable_trigger(data, buffer, rec, event); in hist_enable_count_trigger()