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 
10 #pragma once
11 
31 #include <stdint.h>
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
40 typedef struct {
41  uint32_t laststart;
43  unsigned int schedules;
44  uint64_t runtime_us;
45 } schedstat_t;
46 
51 
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
#define KERNEL_PID_LAST
The last valid PID (inclusive).
Definition: sched.h:119
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.