@@ -5361,6 +5361,7 @@ static int trace__config(const char *var, const char *value, void *arg)
53615361
53625362static void trace__exit (struct trace * trace )
53635363{
5364+ thread__zput (trace -> current );
53645365 strlist__delete (trace -> ev_qualifier );
53655366 zfree (& trace -> ev_qualifier_ids .entries );
53665367 if (trace -> syscalls .table ) {
@@ -5371,6 +5372,7 @@ static void trace__exit(struct trace *trace)
53715372 zfree (& trace -> perfconfig_events );
53725373 evlist__delete (trace -> evlist );
53735374 trace -> evlist = NULL ;
5375+ ordered_events__free (& trace -> oe .data );
53745376#ifdef HAVE_LIBBPF_SUPPORT
53755377 btf__free (trace -> btf );
53765378 trace -> btf = NULL ;
@@ -5520,6 +5522,9 @@ int cmd_trace(int argc, const char **argv)
55205522 sigchld_act .sa_sigaction = sighandler_chld ;
55215523 sigaction (SIGCHLD , & sigchld_act , NULL );
55225524
5525+ ordered_events__init (& trace .oe .data , ordered_events__deliver_event , & trace );
5526+ ordered_events__set_copy_on_queue (& trace .oe .data , true);
5527+
55235528 trace .evlist = evlist__new ();
55245529
55255530 if (trace .evlist == NULL ) {
@@ -5678,11 +5683,6 @@ int cmd_trace(int argc, const char **argv)
56785683 trace__load_vmlinux_btf (& trace );
56795684 }
56805685
5681- if (trace .sort_events ) {
5682- ordered_events__init (& trace .oe .data , ordered_events__deliver_event , & trace );
5683- ordered_events__set_copy_on_queue (& trace .oe .data , true);
5684- }
5685-
56865686 /*
56875687 * If we are augmenting syscalls, then combine what we put in the
56885688 * __augmented_syscalls__ BPF map with what is in the
0 commit comments