[RFCv1 1/4] arm64: Use static key for tracing PID in CONTEXTIDR
Leo Yan
leo.yan at linaro.org
Thu Oct 21 07:37:26 PDT 2021
Hi James,
On Thu, Oct 21, 2021 at 03:33:01PM +0100, James Clark wrote:
[...]
> > +static int __init contextidr_init(void)
> > +{
> > + if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR))
> > + static_branch_inc(&contextidr_in_use);
> > + return 0;
> > +}
> > +early_initcall(contextidr_init);
>
> Hi Leo,
>
> Can you skip this early_initcall() part if you do something like this:
>
> DECLARE_STATIC_KEY_MAYBE(CONFIG_PID_IN_CONTEXTIDR, contextidr_in_use)
>
> It seems like there is a way to conditionally initialise it to true.
Thanks for good point! Will test this way in next spin.
Leo
More information about the linux-arm-kernel
mailing list