Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
rtos_mon.c
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, see
18 * <http://www.gnu.org/licenses/>.
19 */
25
29
31
32void init_sysmon(void)
33{
34 // zero structure
35 memset(&rtos_mon, 0, sizeof(struct rtos_monitoring));
36 // arch init
38}
39
40
41// Periodic report of RTOS parameters
42// This function is actually arch dependent
44{
45 // update struct
47
48 // update cpu time
49 rtos_mon.cpu_time = get_sys_time_float();
50
51 // send report
52 DOWNLINK_SEND_RTOS_MON(DefaultChannel, DefaultDevice,
53 &rtos_mon.thread_counter,
54 &rtos_mon.cpu_load,
55 &rtos_mon.core_free_memory,
56 &rtos_mon.heap_free_memory,
57 &rtos_mon.heap_fragments,
58 &rtos_mon.heap_largest,
59 &rtos_mon.cpu_time);
60
61}
62
63void periodic_sysmon(void) {}
64
65void event_sysmon(void) {}
void rtos_mon_periodic_arch(void)
void rtos_mon_init_arch(void)
struct rtos_monitoring rtos_mon
Definition rtos_mon.c:30
void event_sysmon(void)
Analyse event calls.
Definition rtos_mon.c:65
void periodic_sysmon(void)
Analyse periodic calls Should be run at the highest frequency.
Definition rtos_mon.c:63
void periodic_report_sysmon(void)
Report system status.
Definition rtos_mon.c:43
void init_sysmon(void)
Init system monitoring.
Definition rtos_mon.c:32
System monitoring common header return cpu load, average exec time, ...
System monitoring for RTOS targets return cpu load, average exec time, ...
static float get_sys_time_float(void)
Get the time in seconds since startup.
Definition sys_time.h:241