From 621533bbd3427764d986fda02d27989fd2e15493 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Tue, 26 Nov 2019 09:15:05 +0900 Subject: [PATCH] Add ENABLE_PERF macros so that perf support can be toggled Change-Id: Ic50c8b329af63e63579b6a60b9557344100eaac4 --- arch/x86_64/kernel/cpu.c | 2 ++ arch/x86_64/kernel/include/syscall_list.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/x86_64/kernel/cpu.c b/arch/x86_64/kernel/cpu.c index 69853205..71d9b277 100644 --- a/arch/x86_64/kernel/cpu.c +++ b/arch/x86_64/kernel/cpu.c @@ -1634,6 +1634,7 @@ struct thread *arch_switch_context(struct thread *prev, struct thread *next) /* Set up new TLS.. */ ihk_mc_init_user_tlsbase(next->uctx, next->tlsblock_base); +#ifdef ENABLE_PERF /* Performance monitoring inherit */ if(next->proc->monitoring_event) { if(next->proc->perf_status == PP_RESET) @@ -1643,6 +1644,7 @@ struct thread *arch_switch_context(struct thread *prev, struct thread *next) perf_start(next->proc->monitoring_event); } } +#endif #ifdef PROFILE_ENABLE if (prev && prev->profile && prev->profile_start_ts != 0) { diff --git a/arch/x86_64/kernel/include/syscall_list.h b/arch/x86_64/kernel/include/syscall_list.h index 8ef9bd04..c27cbbb2 100644 --- a/arch/x86_64/kernel/include/syscall_list.h +++ b/arch/x86_64/kernel/include/syscall_list.h @@ -154,7 +154,9 @@ SYSCALL_HANDLED(279, move_pages) SYSCALL_DELEGATED(281, epoll_pwait) SYSCALL_HANDLED(282, signalfd) SYSCALL_HANDLED(289, signalfd4) +#ifdef ENABLE_PERF SYSCALL_HANDLED(298, perf_event_open) +#endif #ifdef DCFA_KMOD SYSCALL_HANDLED(303, mod_call) #endif