Messages in this thread | | | From | Namhyung Kim <> | Date | Wed, 29 Nov 2023 16:01:41 -0800 | Subject | Re: [PATCH 6/8] perf annotate: Ensure init/exit for global options |
| |
On Tue, Nov 28, 2023 at 11:21 AM Ian Rogers <irogers@google.com> wrote: > > On Tue, Nov 28, 2023 at 9:54 AM Namhyung Kim <namhyung@kernel.org> wrote: > > > > Now it only cares about the global options so it can just handle it > > without the argument. > > If annotate_opts were accessed by a function then you could > pthread_once the initialization on the first call to get > annotate_opts. Removing annotation_options__init/exit would remove > some potential for error.
Currently all call sites (perf annotate, report and top) initialize the options and check if it has conflicting options before running the commands. So I'm not sure if it needs pthread_once() for that.
Thanks, Namhyung
| |