Protect more code by #ifdef PERF_ENABLE
Change-Id: I20a67c56c4d7817fdb87cc6a2aa47d68fe3eae8d
This commit is contained in:
committed by
Dominique Martinet
parent
240a23a21b
commit
a6a9bac5b7
@ -1315,6 +1315,7 @@ struct thread *arch_switch_context(struct thread *prev, struct thread *next)
|
||||
dkprintf("[%d] arch_switch_context: tlsblock_base: 0x%lX\n",
|
||||
ihk_mc_get_processor_id(), next->tlsblock_base);
|
||||
|
||||
#ifdef ENABLE_PERF
|
||||
/* Performance monitoring inherit */
|
||||
if(next->proc->monitoring_event) {
|
||||
if(next->proc->perf_status == PP_RESET)
|
||||
@ -1324,6 +1325,7 @@ struct thread *arch_switch_context(struct thread *prev, struct thread *next)
|
||||
perf_start(next->proc->monitoring_event);
|
||||
}
|
||||
}
|
||||
#endif /*ENABLE_PERF*/
|
||||
if (likely(prev)) {
|
||||
tls_thread_switch(prev, next);
|
||||
|
||||
|
||||
@ -114,14 +114,18 @@ SYSCALL_HANDLED(236, get_mempolicy)
|
||||
SYSCALL_HANDLED(237, set_mempolicy)
|
||||
SYSCALL_HANDLED(238, migrate_pages)
|
||||
SYSCALL_HANDLED(239, move_pages)
|
||||
#ifdef PERF_ENABLE
|
||||
SYSCALL_HANDLED(241, perf_event_open)
|
||||
#endif // PERF_ENABLE
|
||||
SYSCALL_HANDLED(260, wait4)
|
||||
SYSCALL_HANDLED(270, process_vm_readv)
|
||||
SYSCALL_HANDLED(271, process_vm_writev)
|
||||
#ifdef PERF_ENABLE
|
||||
SYSCALL_HANDLED(601, pmc_init)
|
||||
SYSCALL_HANDLED(602, pmc_start)
|
||||
SYSCALL_HANDLED(603, pmc_stop)
|
||||
SYSCALL_HANDLED(604, pmc_reset)
|
||||
#endif // PERF_ENABLE
|
||||
SYSCALL_HANDLED(700, get_cpu_id)
|
||||
#ifdef PROFILE_ENABLE
|
||||
SYSCALL_HANDLED(__NR_profile, profile)
|
||||
|
||||
@ -3431,7 +3431,8 @@ SYSCALL_DECLARE(signalfd4)
|
||||
return sfd->fd;
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef ENABLE_PERF
|
||||
int
|
||||
perf_counter_alloc(struct thread *thread)
|
||||
{
|
||||
int ret = -1;
|
||||
@ -3766,6 +3767,7 @@ perf_mmap(struct mckfd *sfd, ihk_mc_user_context_t *ctx)
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif /*ENABLE_PERF*/
|
||||
|
||||
struct vm_range_numa_policy *vm_range_policy_search(struct process_vm *vm, uintptr_t addr)
|
||||
{
|
||||
@ -3817,7 +3819,7 @@ static int vm_policy_insert(struct process_vm *vm, struct vm_range_numa_policy *
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_PERF
|
||||
struct mc_perf_event*
|
||||
mc_perf_event_alloc(struct perf_event_attr *attr)
|
||||
{
|
||||
@ -3993,6 +3995,7 @@ SYSCALL_DECLARE(perf_event_open)
|
||||
ihk_mc_spinlock_unlock(&proc->mckfd_lock, irqstate);
|
||||
return sfd->fd;
|
||||
}
|
||||
#endif /* ENABLE_PERF */
|
||||
|
||||
SYSCALL_DECLARE(rt_sigtimedwait)
|
||||
{
|
||||
@ -8911,6 +8914,7 @@ static void do_mod_exit(int status){
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PERF
|
||||
/* select counter type */
|
||||
SYSCALL_DECLARE(pmc_init)
|
||||
{
|
||||
@ -8957,6 +8961,7 @@ SYSCALL_DECLARE(pmc_reset)
|
||||
int counter = ihk_mc_syscall_arg0(ctx);
|
||||
return ihk_mc_perfctr_reset(counter);
|
||||
}
|
||||
#endif /*ENABLE_PERF*/
|
||||
|
||||
extern void save_uctx(void *, void *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user