Changeset ab42b3e in rtems


Ignore:
Timestamp:
Mar 12, 2020, 5:29:48 PM (4 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
37e7cc5
Parents:
c584d4e
git-author:
Sebastian Huber <sebastian.huber@…> (03/12/20 17:29:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/18/20 06:20:52)
Message:

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.

Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • cpukit/Makefile.am

    rc584d4e rab42b3e  
    472472librtemscpu_a_SOURCES += libtrace/record/record.c
    473473librtemscpu_a_SOURCES += libtrace/record/record-client.c
     474librtemscpu_a_SOURCES += libtrace/record/record-dump.c
     475librtemscpu_a_SOURCES += libtrace/record/record-dump-fatal.c
     476librtemscpu_a_SOURCES += libtrace/record/record-dump-zfatal.c
     477librtemscpu_a_SOURCES += libtrace/record/record-dump-base64.c
     478librtemscpu_a_SOURCES += libtrace/record/record-dump-zbase64.c
    474479librtemscpu_a_SOURCES += libtrace/record/record-server.c
    475480librtemscpu_a_SOURCES += libtrace/record/record-sysinit.c
  • cpukit/headers.am

    rc584d4e rab42b3e  
    140140include_rtems_HEADERS += include/rtems/recordclient.h
    141141include_rtems_HEADERS += include/rtems/recorddata.h
     142include_rtems_HEADERS += include/rtems/recorddump.h
    142143include_rtems_HEADERS += include/rtems/recordserver.h
    143144include_rtems_HEADERS += include/rtems/ringbuf.h
  • cpukit/include/rtems/confdefs/extensions.h

    rc584d4e rab42b3e  
    8080    #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0 \
    8181      && defined(CONFIGURE_RECORD_EXTENSIONS_ENABLED)
    82       RECORD_EXTENSION,
     82      {
     83        _Record_Thread_create,
     84        _Record_Thread_start,
     85        _Record_Thread_restart,
     86        _Record_Thread_delete,
     87        _Record_Thread_switch,
     88        _Record_Thread_begin,
     89        _Record_Thread_exitted,
     90        #ifdef CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB
     91          _Record_Fatal_dump_base64_zlib,
     92        #elif defined(CONFIGURE_RECORD_FATAL_DUMP_BASE64)
     93          _Record_Fatal_dump_base64,
     94        #else
     95          NULL,
     96        #endif
     97        _Record_Thread_terminate
     98      },
    8399    #endif
    84100    #ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
  • cpukit/include/rtems/record.h

    rc584d4e rab42b3e  
     1/* SPDX-License-Identifier: BSD-2-Clause */
     2
    13/*
    2  * SPDX-License-Identifier: BSD-2-Clause
    3  *
    4  * Copyright (C) 2018, 2019 embedded brains GmbH
     4 * Copyright (C) 2018, 2020 embedded brains GmbH (http://www.embedded-brains.de)
    55 *
    66 * Redistribution and use in source and binary forms, with or without
     
    3333#include <rtems/score/atomic.h>
    3434#include <rtems/score/cpu.h>
     35#include <rtems/score/interr.h>
    3536#include <rtems/score/percpu.h>
    3637#include <rtems/score/watchdog.h>
     
    9697void _Record_Thread_exitted( struct _Thread_Control *executing );
    9798
     99void _Record_Fatal_dump_base64(
     100  Internal_errors_Source source,
     101  bool                   always_set_to_false,
     102  Internal_errors_t      code
     103);
     104
     105void _Record_Fatal_dump_base64_zlib(
     106  Internal_errors_Source source,
     107  bool                   always_set_to_false,
     108  Internal_errors_t      code
     109);
     110
    98111void _Record_Thread_terminate(
    99112  struct _Thread_Control *executing
    100113);
    101 
    102 #define RECORD_EXTENSION \
    103   { \
    104     _Record_Thread_create, \
    105     _Record_Thread_start, \
    106     _Record_Thread_restart, \
    107     _Record_Thread_delete, \
    108     _Record_Thread_switch, \
    109     _Record_Thread_begin, \
    110     _Record_Thread_exitted, \
    111     NULL, \
    112     _Record_Thread_terminate \
    113   }
    114114
    115115RTEMS_INLINE_ROUTINE unsigned int _Record_Index(
  • testsuites/libtests/Makefile.am

    rc584d4e rab42b3e  
    11251125record02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_record02) \
    11261126        $(support_includes)
     1127record02_LDADD = $(RTEMS_ROOT)cpukit/librtemscpu.a $(RTEMS_ROOT)cpukit/libz.a $(LDADD)
    11271128endif
    11281129
  • testsuites/libtests/record02/init.c

    rc584d4e rab42b3e  
     1/* SPDX-License-Identifier: BSD-2-Clause */
     2
    13/*
    2  * SPDX-License-Identifier: BSD-2-Clause
    3  *
    4  * Copyright (C) 2018, 2019 embedded brains GmbH
     4 * Copyright (C) 2018, 2020 embedded brains GmbH (http://www.embedded-brains.de)
    55 *
    66 * Redistribution and use in source and binary forms, with or without
     
    9595}
    9696
    97 static void Init(rtems_task_argument arg)
    98 {
    99   test_context *ctx;
    100   Record_Stream_header header;
    101   size_t size;
    102   rtems_record_client_status cs;
     97static void generate_events(void)
     98{
    10399  int i;
    104100  uint32_t level;
    105 
    106   TEST_BEGIN();
    107   ctx = &test_instance;
    108101
    109102  for (i = 0; i < 10; ++i) {
     
    161154  level = rtems_record_interrupt_disable();
    162155  rtems_record_interrupt_enable(level);
     156}
     157
     158static void Init(rtems_task_argument arg)
     159{
     160  test_context *ctx;
     161  Record_Stream_header header;
     162  size_t size;
     163  rtems_record_client_status cs;
     164
     165  TEST_BEGIN();
     166  ctx = &test_instance;
     167
     168  generate_events();
    163169
    164170  rtems_record_client_init(&ctx->client, client_handler, NULL);
     
    169175  rtems_record_client_destroy(&ctx->client);
    170176
     177  generate_events();
     178
     179  _Record_Fatal_dump_base64(RTEMS_FATAL_SOURCE_APPLICATION, false, 123);
     180
     181  generate_events();
     182
    171183  TEST_END();
    172184  rtems_test_exit(0);
     
    183195#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    184196
    185 #define CONFIGURE_RECORD_PER_PROCESSOR_ITEMS 256
     197#define CONFIGURE_RECORD_PER_PROCESSOR_ITEMS 512
    186198
    187199#define CONFIGURE_RECORD_EXTENSIONS_ENABLED
    188200
     201#define CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB
     202
    189203#define CONFIGURE_INIT
    190204
Note: See TracChangeset for help on using the changeset viewer.