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:
@@ -495,6 +495,8 @@ reschedule(int32 nextState)
|
|||||||
|
|
||||||
modeLocker.Unlock();
|
modeLocker.Unlock();
|
||||||
|
|
||||||
|
SCHEDULER_EXIT_FUNCTION();
|
||||||
|
|
||||||
if (nextThread != oldThread)
|
if (nextThread != oldThread)
|
||||||
switch_thread(oldThread, nextThread);
|
switch_thread(oldThread, nextThread);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
#define SCHEDULER_ENTER_FUNCTION() \
|
#define SCHEDULER_ENTER_FUNCTION() \
|
||||||
Scheduler::Profiling::Function schedulerProfiler(__PRETTY_FUNCTION__)
|
Scheduler::Profiling::Function schedulerProfiler(__PRETTY_FUNCTION__)
|
||||||
|
|
||||||
|
#define SCHEDULER_EXIT_FUNCTION() \
|
||||||
|
schedulerProfiler.Exit()
|
||||||
|
|
||||||
|
|
||||||
namespace Scheduler {
|
namespace Scheduler {
|
||||||
|
|
||||||
@@ -124,6 +127,7 @@ Function::Exit()
|
|||||||
#else // SCHEDULER_PROFILING
|
#else // SCHEDULER_PROFILING
|
||||||
|
|
||||||
#define SCHEDULER_ENTER_FUNCTION() (void)0
|
#define SCHEDULER_ENTER_FUNCTION() (void)0
|
||||||
|
#define SCHEDULER_EXIT_FUNCTION() (void)0
|
||||||
|
|
||||||
#endif // !SCHEDULER_PROFILING
|
#endif // !SCHEDULER_PROFILING
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user