[PATCH] Adding CPU usage statistics for usage in user code

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Dec 18 07:20:44 UTC 2014


Hello Олег Мороз,

this duplicates code of the standard report function.  I would instead 
do the following:

1. Add an argument to the visitor function in 
rtems_iterate_over_all_threads() and rename this function to 
rtems_task_iterate().

2. Use rtems_task_iterate() to implement the previous 
rtems_iterate_over_all_threads().

3. Implement a rtems_cpu_usage_report() based on 
rtems_cpu_usage_report_with_plugin() and rtems_task_iterate() that uses 
a visitor function with the following prototype void (*visitor)(XXX 
total, rtems_cpu_usage *cpu_usage, void *arg).  The rtems_cpu_usage is 
the CPU usage of one thread.

4. Implement rtems_cpu_usage_report_with_plugin() via 
rtems_cpu_usage_report().

5. Implement your new function via rtems_cpu_usage_report().

For everything we need new test cases in the testsuite.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list