Commit Graph
406 Commits
Author SHA1 Message Date
Sebastian Huber dca618404e Add low level event recording support
Add low level event recording infrastructure for system and user
defined events.  The infrastructure is able to record high frequency
events such as

 * SMP lock acquire/release,
 * interrupt entry/exit,
 * thread switches,
 * UMA zone allocate/free, and
 * Ethernet packet input/output, etc.

It allows post-mortem analysis in fatal error handlers, e.g. the last
events are in the record buffer, the newest event overwrites the oldest
event.  It is possible to detect record buffer overflows for consumers
that expect a continuous stream of events, e.g. to display the system
state in real-time.

The implementation supports high-end SMP machines (more than 1GHz
processor frequency, more than four processors).

Add a new API instead. The implementation uses per-processor data
structures and no atomic read-modify-write operations.  It is uses
per-processor ring buffers to record the events.

The CPU counter is used to get the time of events. It is combined with
periodic uptime events to synchronize it with CLOCK_REALTIME.

The existing capture engine tries to solve this problem also, but its
performance is not good enough for high-end production systems.  The
main issues are the variable-size buffers and the use of SMP locks for
synchronization.  To fix this, the API would change significantly.

Update #3665.
2019-01-29 13:51:33 +01:00
Sebastian Huber 926ed2b020 score: Remove unused _ISR_lock_Flash() 2019-01-18 13:33:18 +01:00
Sebastian Huber 41310c026c score: Improve debug support for ISR locks
Ensure that interrupts are disabled while acquiring an ISR lock.
2019-01-18 13:33:18 +01:00
Sebastian Huber 93e3b34161 score: Simplify _Addresses_Is_aligned()
The CPU_ALIGNMENT must not be zero, this is also checked via a static
assertion.  Fix formatting.
2019-01-18 11:49:09 +01:00
Sebastian Huber 7bde91bd5f Fix format warnings due to ino_t changes 2019-01-10 09:06:56 +01:00
Sebastian Huber 956d76ccaf score: Remove superfluous include from chainimpl.h 2019-01-07 09:36:47 +01:00
Sebastian Huber a7e89962df drvmgr: Improve LP64 compatibility 2018-12-27 09:00:59 +01:00
Sebastian Huber 7c19e50bdd score: Fix per-CPU data allocation
Allocate the per-CPU data for secondary processors directly from the
heap areas before heap initialization and not via
_Workspace_Allocate_aligned().  This avoids dependency on the workspace
allocator.  It fixes also a problem on some platforms (e.g. QorIQ) where
at this early point in the system initialization the top of the RAM is
used by low-level startup code on secondary processors (boot pages).

Update #3507.
2018-12-18 08:50:08 +01:00
Sebastian Huber e7b0a72566 config: Remove CONFIGURE_CONFDEFS_DEBUG
This configuration option was undocumented and not really helpful.  To
debug issues in <rtems/confdefs.h> it is better to save the
preprocessesd file (GCC "-save-temps" option) and use the GCC "-Wp,-dD"
pre-processor option.
2018-12-17 09:53:39 +01:00
Sebastian Huber 21275b58a5 score: Static Objects_Information initialization
Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>.  Provide default object
informations with zero objects via librtemscpu.a.  This greatly
simplifies the workspace size estimate.  RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.
2018-12-14 07:03:29 +01:00
Sebastian Huber 0f5b2c0906 rtems: Use object information to get config max
Use functions instead of macros.  Add missing
rtems_configuration_get_maximum_*() functions.

Update #3621.
2018-12-14 06:57:55 +01:00
Sebastian Huber 8b0e752fee score: Remove Objects_Information::auto_extend
Use Objects_Information::objects_per_block to provide this information.
Add and use _Objects_Is_auto_extend().

Update #3621.
2018-12-14 06:57:55 +01:00
Sebastian Huber f70079ca20 score: Remove Objects_Information::the_api
Remove Objects_Information::the_class.  This information is already
contained in Objects_Information::maximum_id.

Update #3621.
2018-12-07 14:22:02 +01:00
Sebastian Huber 1c2d178397 score: Remove Objects_Information::maximum
This information is already present in Objects_Information::maximum_id.
Add and use _Objects_Get_maximum_index().

Update #3621.
2018-12-07 14:22:02 +01:00
Sebastian Huber 3899bc1a4b score: Optimize object lookup
Use the maximum ID for the ID to object translation.  Using the maximum
ID gets rid of an additional load from the object information in
_Objects_Get().  In addition, object lookups fail for every ID in case
the object information is cleared to zero.  This makes it a bit more
robust during system startup (see new tests in spconfig02).

The local table no longer needs a NULL pointer entry at array index
zero.  Adjust all the object iteration loops accordingly.

Remove Objects_Information::minimum_id since it contains only redundant
information.  Add _Objects_Get_minimum_id() to get the minimum ID.

Update #3621.
2018-12-07 14:22:01 +01:00
Sebastian Huber 359a3a36ca score: Rename Objects_Information::allocation_size
Rename Objects_Information::allocation_size in
Objects_Information::objects_per_block.  Adjust integer types in
_Objects_Shrink_information() and _Objects_Free().

Update #3621.
2018-12-07 14:22:01 +01:00
Sebastian Huber 0da9d805cd score: Rename Objects_Information::size
Rename Objects_Information::size to Objects_Information::object_size.
Change its type from size_t to uint16_t and move it to reduce the size
of Objects_Information.

Update #3621.
2018-12-07 14:22:01 +01:00
Sebastian Huber 9c9c6a93b1 score: Remove Objects_Information::is_string
Use Objects_Information::name_length to store this information.

Update #3621.
2018-12-07 14:22:01 +01:00
Sebastian Huber 7ee64376ef rtems: Add rtems_scheduler_get_maximum_priority()
Update #3636.
2018-12-07 14:22:01 +01:00
Sebastian Huber ef23838543 score: Avoid sbintime_t in API headers
The sbintime_t is a non-POSIX type and not visible if strict standard
options are selected.

Move implementation details from <rtems/score/timestamp.h> to
<rtems/score/timestampimpl.h>.

Update #3598.
2018-12-07 14:22:01 +01:00
Sebastian Huber e50b4bd341 score: Use __typeof__ for strict ISO C compat
Enable the use of RTEMS_DEVOLATILE() and RTEMS_DECONST() in strict ISO C
environments.
2018-12-06 13:41:59 +01:00
Sebastian Huber 4e46ba8460 rtems: Fix rtems_task_restart() argument type
Close #3637.
2018-12-06 10:50:40 +01:00
Marçal Comajoan Cara 0446f68056 Spelling and grammar fixes in source code comments (GCI 2018) 2018-12-04 15:12:53 -06:00
Sebastian Huber b9ffb62467 Convert CPU counter ticks to/from sbintime_t
The sbintime_t is an efficient time format.  Add the ability to convert
CPU counter ticks to/from sbintime_t.
2018-12-03 09:45:37 +01:00
Sebastian Huber 0a75a4aa65 Remove rtems_cache_*_processor_set() functions
The following rtems_cache_*_processor_set() cache manager API functions
are exotic, complex, very hard to use correctly, not used in the RTEMS
code base, and apparently unused by applications.

Close #3622.
2018-11-26 14:09:43 +01:00
Sebastian Huber 5fc727fe77 score: <rtems/score/smplockstats.h>
Remove <rtems/score/chainimpl.h> include from
<rtems/score/smplockstats.h>.

Close #3598.
2018-11-26 08:29:33 +01:00
Sebastian Huber eaa5ea84ea score: Introduce <rtems/score/heapinfo.h>
Move Heap_Information_block to separate header file to hide heap
implementation details from <rtems.h>.

Update #3598.
2018-11-26 07:51:57 +01:00
Chris Johns 03139d5b1c libdl: Add object file dependencies to track references
Tracking references lets us manage when an object file can be
unloaded. If an object file has references to it, it cannot be
unloaded.

Modules that depend on each other cannot be unloaded.

Updates #3605
2018-11-22 12:43:31 +11:00
Chris Johns 8e7c72a7f5 libdl: Reindex unresolved names after removing used records.
Updates #3194
2018-11-22 12:43:27 +11:00
Chris Johns 803eac954e libdl: Manage the allocation of common uninitialised variables.
The use of separate text and data results in uninitialised variables
being placed in the common section. There is no section in ELF for
the common variables so the loader needs to create the section and
allocate the variables in that section. This patch does that.

The patch adds a second pass over the symbols.

The issue can also be seen as a section 65522 error.

Updates #3604
2018-11-22 12:43:21 +11:00
Sebastian Huber 59e7209fb3 score: Remove support for RTEMS_USE_16_BIT_OBJECT
The RTEMS_USE_16_BIT_OBJECT define is not set by an RTEMS port.  Remove
support for 16-bit object identifiers.  If someone really wants to use
RTEMS on a 16-bit target, then it is better to use self-contained
objects instead of playing around with object identifier optimizations.

Update #3603.
2018-11-21 08:06:27 +01:00
Sebastian Huber dc56355633 Include missing <sys/cpuset.h>
Update #3598.
2018-11-14 07:24:08 +01:00
Sebastian Huber 6efc831f0f Add rtems_malloc() and rtems_calloc()
Close #3583.
2018-11-12 13:26:22 +01:00
Sebastian Huber c1f3c2b88a score: Add and use malloc() family attributes
Update #3583.
2018-11-12 13:26:22 +01:00
Sebastian Huber b15b288179 score: Deprecate proc_ptr
Update #3585.
2018-11-12 13:25:42 +01:00
Sebastian Huber 963c6c2ac4 score: Move internal structures to userextdata.h
Update #3598.
2018-11-12 13:25:42 +01:00
Sebastian Huber 356b07e68f score: Includes in <rtems/score/smplockstats.h>
Include implementation header files only if necessary.

Update #3598.
2018-11-12 13:25:42 +01:00
Sebastian Huber 3b69a0e2e0 rtems: Simplify includes in <rtems/rtems/cache.h>
Update #3598.
2018-11-12 13:25:42 +01:00
Sebastian Huber a6e7d5e492 score: Move internal structures to objectdata.h
Update #3598.
2018-11-12 13:25:42 +01:00
Sebastian Huber e897c7dd76 rtems: Avoid include of <rtems/score/scheduler.h>
Update #3598.
2018-11-12 13:25:41 +01:00
Sebastian Huber 2fa014db14 rtems: Avoid include of <rtems/score/thread.h>
Update #3598.
2018-11-12 13:25:41 +01:00
Sebastian Huber 805f9c2626 score: Avoid complex include in heap.h
Update #3598.
2018-11-12 13:25:41 +01:00
Sebastian Huber 9763245eed rtems: Remove superfluous include
Update #3598.
2018-11-12 13:25:41 +01:00
Sebastian Huber ccc6695c84 score: Introduce <rtems/score/watchdogticks.h>
Separate the definitions related to watchdog ticks from the watchdog
structures.

Update #3598.
2018-11-12 13:25:41 +01:00
Sebastian Huber 98c01a53c8 rtems: Avoid <rtems/score/timecounter.h> in API
Use a real function for rtems_clock_get_uptime_seconds().

Update #3598.
2018-11-12 13:25:41 +01:00
Sebastian Huber a11b98c906 score: Avoid include of <rtems/score/thread.h>
Update #3598.
2018-11-12 13:25:41 +01:00
Sebastian Huber 742d6db125 score: Remove empty <rtems/score/tod.h>
Update #3598.
2018-11-12 13:25:41 +01:00
Sebastian Huber 5fc855d960 rtems: Move internal structures to extensiondata.h
Update #3598.
2018-11-12 13:25:40 +01:00
Sebastian Huber e1b7c18839 rtems: Move internal structures to timerdata.h
Update #3598.
2018-11-12 13:25:40 +01:00
Sebastian Huber b7af3e449a rtems: Move internal structures to tasksdata.h
Update #3598.
2018-11-12 13:25:40 +01:00