| 1 | #include <profiling.h> |
|---|---|
| 2 | |
| 3 | struct scheduler_stats { |
| 4 | _Atomic uint64_t steals; |
| 5 | }; |
| 6 | |
| 7 | #ifdef PROFILING_SCHED |
| 8 | static struct scheduler_stats sched_stats = {0}; |
| 9 | |
| 10 | static inline void sched_profiling_record_steal(void) { |
| 11 | atomic_fetch_add(&sched_stats.steals, 1); |
| 12 | } |
| 13 | #else |
| 14 | static inline void sched_profiling_record_steal(void) { /* Nothing */ } |
| 15 | #endif |
| 16 |