Commit Graph

36 Commits

Author SHA1 Message Date
Sebastian Huber
bcef89f236 Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2023-05-20 11:05:26 +02:00
Vijay Kumar Banerjee
f0f8c111c5 getgrent.c, record-client.c: Add missing includes for assert.h 2021-02-27 08:51:53 -07:00
Ryan Long
be3b87d471 record-client.c: Fix Unchecked return value (CID #1456677)
CID 1456677: Unchecked return value in resolve_hold_back().

Closes #4260
2021-02-26 16:56:07 -06:00
Sebastian Huber
7f0379c8dd libtrace: Move _Record_Stream_header_initialize()
This fixes the build if no function sections are used.
2020-11-09 08:10:57 +01:00
Sebastian Huber
80cf60efec Canonicalize config.h include
Use the following variant which was already used by most source files:

  #ifdef HAVE_CONFIG_H
  #include "config.h"
  #endif
2020-04-16 07:30:00 +02:00
Sebastian Huber
ab42b3e100 record: Add rtems_record_dump()
Add rtems_record_dump_base64() and rtems_record_dump_base64_zlib().

Add CONFIGURE_RECORD_FATAL_DUMP_BASE64 and
CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB configuration options.

Update #3904.
2020-03-18 07:20:52 +01:00
Sebastian Huber
c344e5828c Use RTEMS_SYSINIT_ORDER_LAST_BUT_5
Use RTEMS_SYSINIT_ORDER_LAST_BUT_5 instead of RTEMS_SYSINIT_ORDER_LAST
to allow applications and support functions to place system
initialization handlers behind the standard handlers.

Update #3838.
2020-02-04 06:06:42 +01:00
Sebastian Huber
6ae25220d6 Revert "record: Add wrappers for malloc() functions"
It was accidentally committed.

This reverts commit a314544a27.
2019-10-02 06:40:30 +02:00
Sebastian Huber
a314544a27 record: Add wrappers for malloc() functions
Introduce new library librtemsrecordwrap.a which contains wrappers for
operating system functions which produce entry/exit events.

The wrappers can be selected during link time via the GNU ld --wrap
option.

Update #3665.
2019-10-01 09:55:07 +02:00
Sebastian Huber
e41e9961df record: Add system events
Update #3665.
2019-09-02 07:47:48 +02:00
Sebastian Huber
1c72ad73ae record: Add system events
Add system events for memory allocation/free.

Update #3665.
2019-08-30 15:03:14 +02:00
Sebastian Huber
8ace7eada4 record: Add system events
Add system events to identify the target system.  Add system events to
transfer blocks of memory and register sets.

Update #3665.
2019-08-30 11:18:47 +02:00
Sebastian Huber
11f196d646 record: Simplify configuration
Update #3665.
2019-08-30 08:57:28 +02:00
Sebastian Huber
d78082ce76 record: Introduce _Record_Drain()
This allows its use in crash dump procedures.

Update #3665.
2019-08-30 08:46:17 +02:00
Sebastian Huber
58bd67bb35 record: Add more system events
Reduce the system dependencies to allow tracing of very low level
functions, for example the interrupt disable/enable.

Introduce general purpose RTEMS_RECORD_CALLER and RTEMS_RECORD_LINE
events.

Update #3665.
2019-08-29 10:07:02 +02:00
Sebastian Huber
3eb8d78369 record: Introduce <rtems/recordserver.h>
This helps to get rid of the <rtems/rtems/tasks.h> dependency in
<rtems/record.h>.

Update #3665.
2019-08-28 15:22:06 +02:00
Sebastian Huber
a2684c2b8d record: Use BSS section instead of per-CPU data
The .rtemsrwset section is used for the per-CPU data.  This section has
loadable content.  Place the ring buffers in the BSS section to avoid
large executable image sizes.

Not using the per-CPU data makes it possible to initialize the record
support earlier.

Update #3665.
2019-08-28 08:58:14 +02:00
Sebastian Huber
e273e7a9a8 record: Add data size to client
This is necessary to get the thread names properly on 32-bit and 64-bit
targets.

Update #3665.
2019-08-27 08:46:38 +02:00
Sebastian Huber
a8af7a14ec record: Fix thread names on 64-bit targets
Also fixes the thread names on signed char targets.

Update #3665.
2019-08-27 08:46:33 +02:00
Sebastian Huber
dfdc3faa91 record: Improve overflow handling
Signal the accumulated item overflow count with the time of the first
new item.
2019-08-26 08:01:46 +02:00
Sebastian Huber
45d4ea3141 record: Fix off by one error 2019-08-26 08:01:46 +02:00
Sebastian Huber
c91f6f5f4e record: Pass bintime to client handlers
This is a minor optimization.
2019-08-17 19:01:14 +02:00
Sebastian Huber
17331028e5 record: Simplify client visit() 2019-08-17 19:01:14 +02:00
Sebastian Huber
5c37f03f6f record: Remove superfluous cast 2019-08-17 19:01:14 +02:00
Sebastian Huber
2ef2c14f8a record: Increase client robustness
Do nothing after errors.
2019-08-17 19:01:14 +02:00
Sebastian Huber
52c8ac7b69 record: Improve overflow handling
In case of a ring buffer overflow, the rtems_record_drain() will push
the complete ring buffer content to the client.  While the items are
processed by the client, new items may overwrite some items being
processed.  The overwritten items can be detected in the following
iteration once the next tail/head information is pushed to the client.
2019-08-17 19:01:10 +02:00
Sebastian Huber
b2c060a507 record: Detect also large overflows 2019-08-16 22:54:32 +02:00
Sebastian Huber
d3c4d48da2 record: Simplify rtems_record_client_context 2019-08-16 22:53:47 +02:00
Sebastian Huber
cc91fae43a record: Change thread name encoding
This scheme is easier to decode.
2019-08-06 07:51:42 +02:00
Sebastian Huber
036717eda4 record: Add support for thread names 2019-07-30 07:25:10 +02:00
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
01a5ced5e6 record: Add more system events
Update #3665.
2019-03-12 13:59:15 +01:00
Sebastian Huber
ebb8c28ee9 record: Add system call entry/exit events
This corresponds to the Linux syscall_entry_* and syscall_exit_* events.

Update #3665.
2019-03-12 13:59:11 +01:00
Sebastian Huber
d91951fbc0 record: Rename internal per-CPU events
Update #3665.
2019-03-12 13:44:24 +01:00
Sebastian Huber
03cdd5eab8 record: Add enum value for each event
Update #3665.
2019-01-30 09:46:35 +01:00
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