source: rtems/cpukit/libmisc/testsupport/testextension.c @ 6a9282d

Last change on this file since 6a9282d was 6a9282d, checked in by Sebastian Huber <sebastian.huber@…>, on Dec 9, 2016 at 9:49:49 AM

Rename is_internal to always_set_to_false

Update #2825.

  • Property mode set to 100644
File size: 1.4 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
22#if defined(RTEMS_PROFILING)
23static bool report_done;
24
25RTEMS_INTERRUPT_LOCK_DEFINE( static, report_lock, "test report" )
26#endif
27
28void rtems_test_fatal_extension(
29  rtems_fatal_source source,
30  bool always_set_to_false,
31  rtems_fatal_code code
32)
33{
34#if defined(RTEMS_PROFILING)
35  rtems_interrupt_lock_context lock_context;
36  rtems_printer printer;
37
38  rtems_print_printer_printk( &printer );
39
40  /*
41   * Ensures to report only once on SMP machines and ensures that the report is
42   * output completely.
43   */
44  rtems_interrupt_lock_acquire( &report_lock, &lock_context );
45
46  if ( !report_done ) {
47    report_done = true;
48
49    printk(
50      "\n*** PROFILING REPORT BEGIN %s ***\n",
51      rtems_test_name
52    );
53
54    rtems_profiling_report_xml(
55      rtems_test_name,
56      &printer,
57      1,
58      "  "
59    );
60
61    printk(
62      "*** PROFILING REPORT END %s ***\n",
63      rtems_test_name
64    );
65  }
66
67  rtems_interrupt_lock_release( &report_lock, &lock_context );
68#endif
69
70  (void) source;
71  (void) always_set_to_false;
72  (void) code;
73}
Note: See TracBrowser for help on using the repository browser.