Fix for SPROFILE == 0
- contributed by Antoine Leca
This commit is contained in:
parent
5582aae6d6
commit
423be1545c
@ -288,9 +288,10 @@ PUBLIC void context_stop_idle(void)
|
|||||||
|
|
||||||
if (is_idle)
|
if (is_idle)
|
||||||
restart_local_timer();
|
restart_local_timer();
|
||||||
|
#if SPROFILE
|
||||||
if (sprofiling)
|
if (sprofiling)
|
||||||
get_cpulocal_var(idle_interrupted) = 1;
|
get_cpulocal_var(idle_interrupted) = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PUBLIC u64_t ms_2_cpu_time(unsigned ms)
|
PUBLIC u64_t ms_2_cpu_time(unsigned ms)
|
||||||
|
@ -222,6 +222,9 @@ PRIVATE void idle(void)
|
|||||||
|
|
||||||
/* start accounting for the idle time */
|
/* start accounting for the idle time */
|
||||||
context_stop(proc_addr(KERNEL));
|
context_stop(proc_addr(KERNEL));
|
||||||
|
#if !SPROFILE
|
||||||
|
halt_cpu();
|
||||||
|
#else
|
||||||
if (!sprofiling)
|
if (!sprofiling)
|
||||||
halt_cpu();
|
halt_cpu();
|
||||||
else {
|
else {
|
||||||
@ -234,6 +237,7 @@ PRIVATE void idle(void)
|
|||||||
interrupts_disable();
|
interrupts_disable();
|
||||||
*v = 0;
|
*v = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* end of accounting for the idle task does not happen here, the kernel
|
* end of accounting for the idle task does not happen here, the kernel
|
||||||
* is handling stuff for quite a while before it gets back here!
|
* is handling stuff for quite a while before it gets back here!
|
||||||
|
@ -52,6 +52,7 @@ PRIVATE void lockup_check(struct nmi_frame * frame)
|
|||||||
|
|
||||||
PUBLIC void nmi_watchdog_handler(struct nmi_frame * frame)
|
PUBLIC void nmi_watchdog_handler(struct nmi_frame * frame)
|
||||||
{
|
{
|
||||||
|
#if SPROFILE
|
||||||
/*
|
/*
|
||||||
* Do not check for lockups while profiling, it is extremely likely that
|
* Do not check for lockups while profiling, it is extremely likely that
|
||||||
* a false positive is detected if the frequency is high
|
* a false positive is detected if the frequency is high
|
||||||
@ -63,6 +64,13 @@ PUBLIC void nmi_watchdog_handler(struct nmi_frame * frame)
|
|||||||
|
|
||||||
if ((watchdog_enabled || sprofiling) && watchdog->reinit)
|
if ((watchdog_enabled || sprofiling) && watchdog->reinit)
|
||||||
watchdog->reinit(cpuid);
|
watchdog->reinit(cpuid);
|
||||||
|
#else
|
||||||
|
if (watchdog_enabled) {
|
||||||
|
lockup_check(frame);
|
||||||
|
if (watchdog->reinit)
|
||||||
|
watchdog->reinit(cpuid);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int nmi_watchdog_start_profiling(const unsigned freq)
|
int nmi_watchdog_start_profiling(const unsigned freq)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user