Revert "scheduler: SCHEDULER_EXIT_FUNCTION() is not needed"
This reverts commit 667617ad043a4587d8d366d5192d9ad291cfa37a. Scheduler profiler uses CPU local data to store function information, hence arch_thread_context_switch() usually is not a problem. However, when we switch to a new thread we end up scheduler_new_thread_entry() instead of scheduler_reschedule() what may corrupt data collected by the profiler.
This commit is contained in:
parent
3dce49af0e
commit
0269dd284e
|
@ -495,6 +495,8 @@ reschedule(int32 nextState)
|
|||
|
||||
modeLocker.Unlock();
|
||||
|
||||
SCHEDULER_EXIT_FUNCTION();
|
||||
|
||||
if (nextThread != oldThread)
|
||||
switch_thread(oldThread, nextThread);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
#define SCHEDULER_ENTER_FUNCTION() \
|
||||
Scheduler::Profiling::Function schedulerProfiler(__PRETTY_FUNCTION__)
|
||||
|
||||
#define SCHEDULER_EXIT_FUNCTION() \
|
||||
schedulerProfiler.Exit()
|
||||
|
||||
|
||||
namespace Scheduler {
|
||||
|
||||
|
@ -124,6 +127,7 @@ Function::Exit()
|
|||
#else // SCHEDULER_PROFILING
|
||||
|
||||
#define SCHEDULER_ENTER_FUNCTION() (void)0
|
||||
#define SCHEDULER_EXIT_FUNCTION() (void)0
|
||||
|
||||
#endif // !SCHEDULER_PROFILING
|
||||
|
||||
|
|
Loading…
Reference in New Issue