[rtems commit] sapi: Report only if not an SMP shutdown response

Sebastian Huber sebh at rtems.org
Thu Oct 23 13:31:31 UTC 2014


Module:    rtems
Branch:    master
Commit:    a420327390f920167524219cc85eb22175ea177b
Changeset: http://git.rtems.org/rtems/commit/?id=a420327390f920167524219cc85eb22175ea177b

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Oct 23 15:39:28 2014 +0200

sapi: Report only if not an SMP shutdown response

---

 cpukit/sapi/src/testextension.c |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/cpukit/sapi/src/testextension.c b/cpukit/sapi/src/testextension.c
index 5221aaf..814f1bd 100644
--- a/cpukit/sapi/src/testextension.c
+++ b/cpukit/sapi/src/testextension.c
@@ -19,18 +19,38 @@
 #include <rtems/test.h>
 #include <rtems/profiling.h>
 
+#if defined(RTEMS_SMP)
+#include <rtems/score/smpimpl.h>
+#endif
+
+#if defined(RTEMS_PROFILING)
+static bool should_report(
+  rtems_fatal_source source,
+  rtems_fatal_code code
+)
+{
+#if defined(RTEMS_SMP)
+  return source != RTEMS_FATAL_SOURCE_SMP
+    || code != SMP_FATAL_SHUTDOWN_RESPONSE;
+#else
+  (void) source;
+  (void) code;
+
+  return true;
+#endif
+}
+#endif
+
 void rtems_test_fatal_extension(
   rtems_fatal_source source,
   bool is_internal,
   rtems_fatal_code code
 )
 {
-  (void) source;
   (void) is_internal;
-  (void) code;
 
 #if defined(RTEMS_PROFILING)
-  if ( rtems_get_current_processor() == 0 ) {
+  if ( should_report( source, code ) ) {
     printk(
       "\n*** PROFILING REPORT BEGIN %s ***\n",
       rtems_test_name



More information about the vc mailing list