schedstatistics.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
3  * 2019 Inria
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
29 #ifndef SCHEDSTATISTICS_H
30 #define SCHEDSTATISTICS_H
31 
32 #include <stdint.h>
33 
34 #ifdef __cplusplus
35  extern "C" {
36 #endif
37 
41 typedef struct {
42  uint32_t laststart;
44  unsigned int schedules;
45  uint64_t runtime_us;
46 } schedstat_t;
47 
52 
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif /* SCHEDSTATISTICS_H */
#define KERNEL_PID_LAST
The last valid PID (inclusive).
Definition: sched.h:120
schedstat_t sched_pidlist[KERNEL_PID_LAST+1]
Thread statistics table.
void init_schedstatistics(void)
Registers the sched statistics callback and sets laststart for caller thread.
Scheduler statistics.
unsigned int schedules
How often the thread was scheduled to run.
uint64_t runtime_us
The total runtime of this thread in microseconds.
uint32_t laststart
Time stamp of the last time this thread was scheduled to run.