ANDROID: 16K: Update sysctl_perf_event_mlock if PERF_EVENTS enabled

If the kernel is build with CONFIG_PERF_EVENTS disabled then the build
will fail since the definition of sysctl_perf_event_mlock is compiled
out.

Fix this by only attempting to reinitialize it if CONFIG_PERF_EVENTS
is enabled.

Bug: 383389337
Bug: 374141783
Bug: 374005105
Bug: 366098040
Change-Id: Idfad9a93841bcc94a17365e468736bc14c52eee4
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
Kalesh Singh
2024-10-16 23:05:16 -07:00
committed by Carlos Llamas
parent 13ba0aec9c
commit c94c31e526

View File

@@ -317,6 +317,7 @@ free_magic:
return error;
}
#if IS_ENABLED(CONFIG_PERF_EVENTS)
static int __init init_sysctl_perf_event_mlock(void)
{
if (!static_branch_unlikely(&page_shift_compat_enabled))
@@ -328,3 +329,4 @@ static int __init init_sysctl_perf_event_mlock(void)
return 0;
}
core_initcall(init_sysctl_perf_event_mlock);
#endif