Skip to content

Commit 00fb5d2

Browse files
committed
Merge: tracing: Fix bad hist from corrupting named_triggers list [rhel-10]
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/501 # Merge Request Required Information JIRA: https://issues.redhat.com/browse/RHEL-80060 ## Summary of Changes Re-order code in `event_hist_trigger_parse` so that `hist_trigger_enable` is called before `event_trigger_unregister`, enabling the latter to function correctly and remove a histogram with failed trigger parsing from the list. ## Approved Development Ticket(s) All submissions to CentOS Stream must reference a ticket in [Red Hat Jira](https://issues.redhat.com/). <details><summary>Click for formatting instructions</summary> Please follow the CentOS Stream [contribution documentation](https://docs.centos.org/en-US/stream-contrib/quickstart/) for how to file this ticket and have it approved. List tickets each on their own line of this description using the format "Resolves: RHEL-76229", "Related: RHEL-76229" or "Reverts: RHEL-76229", as appropriate. </details> Signed-off-by: Tomas Glozar <tglozar@redhat.com> Approved-by: Waiman Long <longman@redhat.com> Approved-by: Joe Lawrence <joe.lawrence@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents f155d83 + 387501f commit 00fb5d2

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

kernel/trace/trace_events_hist.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6652,27 +6652,27 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
66526652
if (existing_hist_update_only(glob, trigger_data, file))
66536653
goto out_free;
66546654

6655-
ret = event_trigger_register(cmd_ops, file, glob, trigger_data);
6656-
if (ret < 0)
6657-
goto out_free;
6655+
if (!get_named_trigger_data(trigger_data)) {
66586656

6659-
if (get_named_trigger_data(trigger_data))
6660-
goto enable;
6657+
ret = create_actions(hist_data);
6658+
if (ret)
6659+
goto out_free;
66616660

6662-
ret = create_actions(hist_data);
6663-
if (ret)
6664-
goto out_unreg;
6661+
if (has_hist_vars(hist_data) || hist_data->n_var_refs) {
6662+
ret = save_hist_vars(hist_data);
6663+
if (ret)
6664+
goto out_free;
6665+
}
66656666

6666-
if (has_hist_vars(hist_data) || hist_data->n_var_refs) {
6667-
ret = save_hist_vars(hist_data);
6667+
ret = tracing_map_init(hist_data->map);
66686668
if (ret)
6669-
goto out_unreg;
6669+
goto out_free;
66706670
}
66716671

6672-
ret = tracing_map_init(hist_data->map);
6673-
if (ret)
6674-
goto out_unreg;
6675-
enable:
6672+
ret = event_trigger_register(cmd_ops, file, glob, trigger_data);
6673+
if (ret < 0)
6674+
goto out_free;
6675+
66766676
ret = hist_trigger_enable(trigger_data, file);
66776677
if (ret)
66786678
goto out_unreg;

0 commit comments

Comments
 (0)