Commit Graph

27 Commits

Author SHA1 Message Date
Sebastian Huber
f9219db2a9 rtems: Add rtems_scheduler_get_processor_maximum()
Add rtems_scheduler_get_processor_maximum() as a replacement for
rtems_get_processor_count(). The rtems_get_processor_count() is a bit
orphaned. Adopt it by the Scheduler Manager. The count is also
misleading, since the processor set may have gaps and the actual count
of online processors may be less than the value returned by
rtems_get_processor_count().

Update #3732.
2019-04-09 08:06:46 +02:00
Sebastian Huber
2dd098a635 score: Introduce Thread_Scheduler_control::home
Replace Thread_Scheduler_control::control and
Thread_Scheduler_control::own_control with new
Thread_Scheduler_control::home.

Update #2556.
2016-11-02 10:05:45 +01:00
Sebastian Huber
d271c3bb78 rtems: Add rtems_task_iterate()
Update #2423.
2016-11-02 08:46:47 +01:00
Sebastian Huber
5e072f6d35 cpuuse: Hide implementation details 2016-05-31 10:10:36 +02:00
Sebastian Huber
bd12dda405 score: Use thread state lock for current state
In addition protect scheduler of thread by thread state lock.  Enables
use of scheduler per-instance locks.

Update #2555.
2016-05-12 13:24:41 +02:00
Sebastian Huber
d37adfe5dd score: Fix CPU time used by executing threads
The CPU time used of a thread was previously maintained per-processor
mostly during _Thread_Dispatch().  However, on SMP configurations the
actual processor of a thread is difficult to figure out since thread
dispatching is a highly asynchronous process (e.g. via inter-processor
interrupts).  Only the intended processor of a thread is known to the
scheduler easily.  Do the CPU usage accounting during thread heir
updates in the context of the scheduler operations.  Provide the
function _Thread_Get_CPU_time_used() to get the CPU usage of a thread
using proper locks to get a consistent value.

Close #2627.
2016-03-17 08:27:47 +01:00
Sebastian Huber
48fed9a56e score: Simplify <rtems/system.h>
Drop the <rtems/score/percpu.h> include since this file exposes a lot of
implementation details.
2015-06-26 09:16:25 +02:00
Joel Sherrill
e6b31b27fb Remove use ticks for statistics configure option.
This was obsolete and broken based upon recent time keeping changes.

Thie build option was previously enabled by adding
USE_TICKS_FOR_STATISTICS=1 to the configure command line.

This propagated into the code as preprocessor conditionals
using the __RTEMS_USE_TICKS_FOR_STATISTICS__ conditional.
2015-06-15 13:20:17 -05:00
Sebastian Huber
3380ee8194 score: Use common names for per-CPU variables
Use "cpu" for an arbitrary Per_CPU_Control variable.

Use "cpu_self" for the Per_CPU_Control of the current processor.

Use "cpu_index" for an arbitrary processor index.

Use "cpu_index_self" for the processor index of the current processor.

Use "cpu_count" for the processor count obtained via
_SMP_Get_processor_count().

Use "cpu_max" for the processor maximum obtained by
rtems_configuration_get_maximum_processors().
2014-04-22 08:34:45 +02:00
Sebastian Huber
4bc8d2e717 rtems: Rename rtems_smp_get_processor_count()
Rename rtems_smp_get_processor_count() in rtems_get_processor_count().
Make rtems_get_processor_count() a function in uni-processor
configurations to enable ABI compatibility with SMP configurations.
2014-04-11 08:52:54 +02:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
f031df0e63 score: Rename tod.h to todimpl.h 2013-08-01 16:45:45 +02:00
Sebastian Huber
fe52e7c07c smp: Add and use _Per_CPU_Get()
Add and use _Per_CPU_Get_by_index() and _Per_CPU_Get_index().  Add
_Per_CPU_Send_interrupt().  This avoids direct access of
_Per_CPU_Information.
2013-07-30 09:53:23 +02:00
Sebastian Huber
88c74ab115 score: Merge tod implementation into one file
Delete TOD_MICROSECONDS_PER_SECOND, TOD_MICROSECONDS_TO_TICKS() and
TOD_MILLISECONDS_TO_TICKS().
2013-07-26 11:55:47 +02:00
Sebastian Huber
4b48ece07d score: Create watchdog implementation header
Move implementation specific parts of watchdog.h and watchdog.inl into
new header file watchdogimpl.h.  The watchdog.h contains now only the
application visible API.
2013-07-22 16:57:25 +02:00
Sebastian Huber
a951572290 cpuuse: Add SMP support 2013-07-22 16:57:22 +02:00
Mathew Kallada
f5f2676824 libmisc: Doxygen Enhancement Task #1 2012-12-21 11:13:06 -06:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Sebastian Huber
baef67712f 2011-09-15 Sebastian Huber <sebastian.huber@embedded-brains.de>
* cpukit/libmisc/cpuuse/cpuuse.h,
	cpukit/libmisc/cpuuse/cpuusagedata.c,
	cpukit/libmisc/cpuuse/cpuusagereport.c,
	cpukit/libmisc/cpuuse/cpuusagereset.c: Fixed timestamp usage.
2011-09-15 14:34:21 +00:00
Glenn Humphrey
dca9a825e4 2009-12-02 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* libcsupport/src/__times.c, libmisc/cpuuse/cpuusagedata.c,
	libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c,
	rtems/include/rtems/rtems/types.h, rtems/src/ratemongetstatistics.c,
	rtems/src/ratemonreportstatistics.c, score/src/threaddispatch.c,
	score/src/threadinitialize.c, score/src/threadtickletimeslice.c:
	Updated copyright line.
2009-12-02 18:22:19 +00:00
Glenn Humphrey
c6f7e060ea 2009-12-02 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* configure.ac, libcsupport/src/__times.c,
	libmisc/cpuuse/cpuusagedata.c, libmisc/cpuuse/cpuusagereport.c,
	libmisc/cpuuse/cpuusagereset.c, rtems/include/rtems/rtems/ratemon.h,
	rtems/include/rtems/rtems/types.h, rtems/src/ratemongetstatistics.c,
	rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c,
	rtems/src/ratemonreportstatistics.c,
	score/include/rtems/score/thread.h, score/src/threaddispatch.c,
	score/src/threadinitialize.c, score/src/threadtickletimeslice.c:
	Changed the configuration of statistics granularity to use just one
	define.
2009-12-02 18:15:16 +00:00
Joel Sherrill
c16bcc009b 2008-12-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/__times.c, libmisc/cpuuse/cpuusagereport.c,
	libmisc/cpuuse/cpuusagereset.c, posix/src/clockgettime.c,
	posix/src/pthread.c, posix/src/timersettime.c,
	rtems/include/rtems/rtems/ratemon.h,
	rtems/src/clockgetsecondssinceepoch.c, rtems/src/clockgetuptime.c,
	rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c,
	rtems/src/ratemonreportstatistics.c, rtems/src/taskwakewhen.c,
	rtems/src/timerfirewhen.c, rtems/src/timerserver.c,
	rtems/src/timerserverfirewhen.c, score/Makefile.am,
	score/preinstall.am, score/include/rtems/score/thread.h,
	score/include/rtems/score/tod.h, score/src/coretod.c,
	score/src/coretodget.c, score/src/coretodgetuptime.c,
	score/src/coretodset.c, score/src/coretodtickle.c,
	score/src/threaddispatch.c, score/src/threadinitialize.c: Add
	SuperCore handler Timestamp to provide an opaque class for the
	representation and manipulation of uptime, time of day, and the
	difference between two timestamps. By using SuperCore Timestamp, it
	is clear which methods and APIs really have to be struct timespec and
	which can be in an optimized native format.
	* score/include/rtems/score/timestamp.h,
	score/src/coretodgetuptimetimespec.c: New files.
2008-12-08 19:41:31 +00:00
Joel Sherrill
1487880d2c 2008-08-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/include/rtems/libcsupport.h, libcsupport/src/scandir.c,
	libmisc/cpuuse/cpuusagereset.c, libmisc/monitor/mon-monitor.c,
	libmisc/serdbg/serdbg.c, libmisc/serdbg/serdbg.h,
	libnetworking/netinet/in_cksum_powerpc.h, shttpd/compat_rtems.h: Fix
	warnings.
2008-08-18 21:16:42 +00:00
Joel Sherrill
5fa5185324 2008-06-06 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/__times.c, libmisc/cpuuse/cpuusagereport.c,
	libmisc/cpuuse/cpuusagereset.c, libmisc/monitor/mon-task.c,
	rtems/include/rtems/rtems/ratemon.h, rtems/src/ratemongetstatus.c,
	rtems/src/ratemonperiod.c, score/include/rtems/score/thread.h,
	score/src/threaddispatch.c, score/src/threadinitialize.c,
	score/src/threadtickletimeslice.c: Add typedefs for cpu usage and
	period timing statistics. Also renamed related variables and
	structure members so they are the same whether you are using
	nanosecond (e.g. struct timespec) or ticks (e.g. uint32_t)
	granularity. This lays the groundwork for future cleanup.
2008-06-06 15:44:11 +00:00
Joel Sherrill
3462c34326 2007-07-24 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c,
	score/src/timespecdivide.c: Fix various math and reporting bugs. Now
	the time appears to be reported correctly and add up to what is
	expected.
2007-07-24 21:37:39 +00:00
Joel Sherrill
793dd46d64 2007-07-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/Makefile.am, libmisc/cpuuse/cpuusagereport.c,
	libmisc/cpuuse/cpuusagereset.c: Fix bug where cpu usage calculation
	was always using uptime not time since last cpu usage reset when
	using nanoseconds granularity.
	* libmisc/cpuuse/cpuusagedata.c: New file.
2007-07-18 21:31:49 +00:00
Joel Sherrill
e49e84c9ab 2007-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/Makefile.am, libmisc/cpuuse/README: Split remaining CPU Usage
	functionality into multiple files to eliminate unnecessary cohesion.
	Update README.
	* libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c:
	New files.
	* libmisc/cpuuse/cpuuse.c: Removed.
2007-05-21 20:28:02 +00:00