Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
sys_mon_rtos.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Gautier Hattenberger <gautier.hattenberger@enac.fr>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
29 #ifndef SYS_MON_RTOS_H
30 #define SYS_MON_RTOS_H
31 
32 #include "core/sys_mon.h"
33 
34 // Maximum number of threads
35 // The limit is related to the max size of the report message
36 #define RTOS_MON_MAX_THREADS 20
37 
38 // Maximun len of a thread name (including trailing semi-colon)
39 // Currently only the first 4 char + ';' at most
40 #define RTOS_MON_NAME_LEN 5
41 
42 // Names buffer size
43 #define RTOS_MON_THREAD_NAMES (RTOS_MON_MAX_THREADS * RTOS_MON_NAME_LEN)
44 
45 // RTOS structure
57  float cpu_time; // in secs since startup
58 };
59 
60 extern struct rtos_monitoring rtos_mon;
61 
62 // Init function
63 extern void rtos_mon_init_arch(void);
64 // Periodic report
65 extern void rtos_mon_periodic_arch(void);
66 
67 #endif /* SYS_MON_RTOS_H */
uint16_t
unsigned short uint16_t
Definition: types.h:16
rtos_monitoring
Definition: sys_mon_rtos.h:46
rtos_monitoring::thread_counter
uint8_t thread_counter
number of threads
Definition: sys_mon_rtos.h:52
rtos_monitoring::thread_load
uint16_t thread_load[RTOS_MON_MAX_THREADS]
individual thread load in centi-percent (10*%)
Definition: sys_mon_rtos.h:53
rtos_monitoring::heap_largest
uint32_t heap_largest
Largest free block in the heap.
Definition: sys_mon_rtos.h:50
sys_mon.h
uint32_t
unsigned long uint32_t
Definition: types.h:18
rtos_monitoring::thread_name_idx
uint8_t thread_name_idx
length of the string in thread_names buffer
Definition: sys_mon_rtos.h:56
rtos_monitoring::thread_names
char thread_names[RTOS_MON_THREAD_NAMES+1]
string of thread names / identifiers
Definition: sys_mon_rtos.h:55
RTOS_MON_THREAD_NAMES
#define RTOS_MON_THREAD_NAMES
Definition: sys_mon_rtos.h:43
uint8_t
unsigned char uint8_t
Definition: types.h:14
rtos_mon_init_arch
void rtos_mon_init_arch(void)
Definition: rtos_mon_arch.c:144
rtos_monitoring::thread_free_stack
uint16_t thread_free_stack[RTOS_MON_MAX_THREADS]
individual thread free stack in bytes
Definition: sys_mon_rtos.h:54
rtos_monitoring::cpu_time
float cpu_time
Definition: sys_mon_rtos.h:57
rtos_monitoring::heap_free_memory
uint32_t heap_free_memory
Total fragmented free memory in the heap.
Definition: sys_mon_rtos.h:48
rtos_mon_periodic_arch
void rtos_mon_periodic_arch(void)
Definition: rtos_mon_arch.c:156
rtos_monitoring::core_free_memory
uint32_t core_free_memory
core free memory in bytes
Definition: sys_mon_rtos.h:47
rtos_monitoring::heap_fragments
uint32_t heap_fragments
Number of fragments in the heap.
Definition: sys_mon_rtos.h:49
rtos_mon
struct rtos_monitoring rtos_mon
Definition: rtos_mon.c:30
rtos_monitoring::cpu_load
uint8_t cpu_load
global CPU/MCU load in %
Definition: sys_mon_rtos.h:51
RTOS_MON_MAX_THREADS
#define RTOS_MON_MAX_THREADS
Definition: sys_mon_rtos.h:36