60 Commits

Author SHA1 Message Date
Stockton Slack
36d89df0a7 Fix load monitoring inconsistency bug 2024-07-22 10:33:39 +02:00
Eric Katzfey
ae947513d7
add load_mon support for Qurt platform (#22883)
- Added check in commander to see if CPU load monitoring has been disabled before signalling overload
2024-03-13 21:33:58 -04:00
Daniel Agar
8cc39096cb
load_mon: NuttX cpuload use system times for calculation
- this is to minimize the impact of any load_mon scheduling jitter in the sampled load percentage
2022-10-05 14:21:38 -04:00
Jukka Laitinen
9449ed6e66 Add support for protected build in drivers, systemcmds and modules Kconfig
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-18 07:58:58 +01:00
Peter van der Perk
d5e3e9a7bc [Kconfig] Decompose Kconfig, now each module has its own Kconfig
Which is better for versioning and decomposability
2021-10-07 10:09:01 -04:00
David Sidrane
bb913ae11a system_load:Track Dynamic PID hash 2021-08-13 14:22:00 -04:00
David Sidrane
069130403d LoadMon:Support NuttX Dynamic FDs 2021-08-13 14:22:00 -04:00
SalimTerryLi
05f1efd1a4
load_mon: get mem_usage by reading /proc/meminfo on Linux 2020-10-27 18:49:25 -04:00
FengShun
eac9a6b68b Replace PublicationQueued with Publication to automatically configure ORB_QUEUE_LENGTH 2020-10-26 13:01:13 +01:00
David Sidrane
760f2ecb22 LoadMon:track upstream malloc changes 2020-09-16 21:32:04 -04:00
Daniel Agar
023f6d3983
NuttX cpuload monitoring optimization
- Nuttx only process all suspend & resume scheduling notes when top is running, otherwise only track IDLE
 - convert cpuload and print load to c++
 - delete unused fields from print_load struct
 - update hrt_store_absolute_time (previous unused)
2020-09-05 14:35:50 -04:00
SalimTerryLi
49e83b6ae4
load_mon: add linux support 2020-08-11 18:33:44 -04:00
Daniel Agar
ca33bb1c01
load_mon: slightly longer cpu average (300 -> 500 ms) 2020-07-28 13:41:50 -04:00
Daniel Agar
8020d6407f load_mon: remove obsolete rate comment in description 2020-07-16 15:11:53 -04:00
Daniel Agar
392eb123fc load_mon: split out header 2020-07-16 15:11:53 -04:00
Daniel Agar
fd66d42906 load_mon updates
- increase rate
 - cpu load calculation grab timestamp atomically
 - only check one task per cycle (but cycle at a higher rate)
 - decrease available FD threshold
 - minor cleanup
2020-07-16 15:11:53 -04:00
Daniel Agar
96a6b5c914 load_mon: decrease warning threshold for stack check builds
- enabling stack check increases stack usage and will assert if there's
any overflow
2020-07-06 11:13:15 -04:00
Daniel Agar
466b5db36f
uORB::Publication improvements and cleanup (#14784)
- create common uORB::PublicationBase
 - uORB::PublicationQueued types are now type aliases
 - ORB_PRIO use enum type everywhere to avoid accidental misuse
 - PX4Accelerometer/PX4Gyroscope/etc driver libs explicitly advertise on construction, unadvertise on destruction. This is a workaround for any potential issues that might appear when accel/gyro cdev and uORB indexing doesn't align.
2020-05-04 11:09:30 -04:00
Daniel Agar
22a005c9f4
delete module's redundant print_status()
- we can already get the running status from ModuleBase and the other misc information is already available through perf or uORB
2019-11-30 18:22:19 -05:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Daniel Agar
c284198bec clang-tidy: partially fix hicpp-use-override 2019-10-28 10:50:31 -04:00
Daniel Agar
6f1f5e0325 clang-tidy: partially fix readability-redundant-declaration 2019-10-28 10:50:31 -04:00
Daniel Agar
26364d44c9
px4_work_queue: command line status output and shutdown empty queues
* adds a work_queue systemcmd that will bring a tree view of all active work queues and work items
 * WorkQueues now track attached WorkItems and will shutdown when the last WorkItem is detached
2019-10-02 12:23:17 -04:00
Daniel Agar
c8f77d438d
load_mon: update orb_publish to uORB::Publication<> 2019-09-02 20:41:34 -04:00
Daniel Agar
78ef8aab2d STACK_MAIN increase default 1024 -> 2048 2019-08-30 19:11:51 -07:00
Beat Küng
f8e0441e7b src/platforms/common: move to platforms/common
Script to update include paths:
for i in $(grep -rl 'include <px4_work_queue' src platforms); do sed -i 's/#include <px4_work_queue/#include <px4_platform_common\/px4_work_queue/' $i; done
2019-08-30 07:59:44 +02:00
Daniel Agar
0e949a36ee task_stack_info increase task_name length to match NuttX CONFIG_TASK_NAME_SIZE 2019-07-30 10:47:10 -04:00
Daniel Agar
6627c60e5b
load_mon move from NuttX LPWORK to PX4 work queue lp_default 2019-05-28 09:40:36 -04:00
bresch
ecacf4de46 Parameter update - Rename variables in modules/load_mon
using parameter_update.py script
2019-04-03 15:38:50 +02:00
Beat Küng
481bfc6308 px4_module: use px4_atomic_t 2019-01-30 10:24:06 -05:00
Daniel Agar
6feee70570 move SYS_STCK_EN to src/modules/load_mon 2019-01-23 08:23:03 +01:00
Daniel Agar
49be26b6cf
load_mon improve cpuload calculation and cleanup (#9852) 2018-12-21 22:27:58 -08:00
Christian Rauch
8a2e3800d8 check CONFIG_SCHED_INSTRUMENTATION for print_load_nuttx 2018-12-21 05:43:21 -08:00
Daniel Agar
d73d20bcce systemlib delete unused systemlib.h 2018-06-12 09:06:30 +02:00
Daniel Agar
ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00
Beat Küng
f47d0c8f8c load_mon: reduce FDS_LOW_WARNING_THRESHOLD to 3
This bound can be quite tight, because:
- The system still behaves well, even if all FD's are used (as opposed to
  a stack overflow)
- The amount of used FD's is typically only increased one at a time
  (e.g. adding new logged topics, adding a mavlink stream, ...)
- reducing CONFIG_NFILE_DESCRIPTORS to the minimum frees up a considerable
  amount of RAM on systems that need it
2018-01-12 23:18:59 +01:00
Beat Küng
794c7a5a0f load_mon: fix tasks index & fds_free initialization
Makes sure that if CONFIG_NFILE_DESCRIPTORS == 0, no warning is printed.
2018-01-12 23:18:59 +01:00
Lorenz Meier
eb43b86a4b Load mon: Also monitor file descriptors
It is important that tasks do not run out of them and this addition will provide a warning and log evidence if it goes wrong.
2018-01-12 23:18:59 +01:00
Beat Küng
fa929322ab load_mon: remove usage of CONFIG_RAM_SIZE
The define should not be used, as it might be wrong.
This is the case on fmu-v5, which meant that the used RAM was always 1.
2017-12-07 20:28:17 +00:00
Beat Küng
8d7481f9ac load_mon: use ModuleBase & add documentation 2017-07-14 11:57:11 +02:00
Beat Küng
5c2fa034da load_mon: rename low_stack -> task_stack_info & always publish it
- use uorb queue to not drop any info, only do 2 tasks per cycle
- also print a warning on low stack (which will be added to ulog)

this allows to gather statistics of each task's stack usage over time.
2017-02-04 12:15:59 +01:00
Beat Küng
c02f1946eb load_mon: fix stack check: use up_check_tcbstack_remain()
The previous method did not work anymore since the NuttX upgrade.
2017-02-04 12:15:59 +01:00
David Sidrane
ff0e810b55 Nuttx changed CONFIG_DRAM_SIZE to CONFIG_RAM_SIZE 2016-12-21 08:34:21 +01:00
Lorenz Meier
4c714f0e46 Load mon: Be less verbose on boot 2016-12-12 16:11:21 +01:00
Andreas Antener
64778b9540 Load monitor: added parameter to disable stack check 2016-12-09 21:12:12 +01:00
Andreas Antener
72f52c920c Load monitor: reduce scope of scheduler locking 2016-12-09 21:12:12 +01:00
Andreas Antener
806b8d3a67 Load monitor: free counter 2016-12-09 21:12:12 +01:00
Andreas Antener
a0cf938ced Load monitor: lock scheduler for stack check and added performance counter for stack checking 2016-12-09 21:12:12 +01:00
Andreas Antener
dda0de09dd Load monitor: optimize performance of stack checking 2016-12-09 21:12:12 +01:00
Andreas Antener
62103be7ba Load monitor: report and log processes low on stack 2016-12-09 21:12:12 +01:00