source: rtems/cpukit/libmisc/testsupport/testextension.c @ 577d9a5

Last change on this file since 577d9a5 was 577d9a5, checked in by Sebastian Huber <sebastian.huber@…>, on Dec 3, 2018 at 12:34:28 PM

testsupport: Include missing <rtems/bspIo.h>

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/test.h>
20#include <rtems/profiling.h>
21#include <rtems/bspIo.h>
22
23#if defined(RTEMS_PROFILING)
24static bool report_done;
25
26RTEMS_INTERRUPT_LOCK_DEFINE( static, report_lock, "test report" )
27#endif
28
29void rtems_test_fatal_extension(
30  rtems_fatal_source source,
31  bool always_set_to_false,
32  rtems_fatal_code code
33)
34{
35#if defined(RTEMS_PROFILING)
36  rtems_interrupt_lock_context lock_context;
37  rtems_printer printer;
38
39  rtems_print_printer_printk( &printer );
40
41  /*
42   * Ensures to report only once on SMP machines and ensures that the report is
43   * output completely.
44   */
45  rtems_interrupt_lock_acquire( &report_lock, &lock_context );
46
47  if ( !report_done ) {
48    report_done = true;
49
50    printk(
51      "\n*** PROFILING REPORT BEGIN %s ***\n",
52      rtems_test_name
53    );
54
55    rtems_profiling_report_xml(
56      rtems_test_name,
57      &printer,
58      1,
59      "  "
60    );
61
62    printk(
63      "*** PROFILING REPORT END %s ***\n",
64      rtems_test_name
65    );
66  }
67
68  rtems_interrupt_lock_release( &report_lock, &lock_context );
69#endif
70
71  (void) source;
72  (void) always_set_to_false;
73  (void) code;
74}
Note: See TracBrowser for help on using the repository browser.