summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spprofiling01
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-10 14:39:49 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-14 08:46:49 +0100
commit4dad4b84112d57cf6e77409f8e267706db446ec0 (patch)
tree6af69b581cc801a3f8355b9188ae98012f85f4af /testsuites/sptests/spprofiling01
parentscore: Add --enable-profiling configure option (diff)
downloadrtems-4dad4b84112d57cf6e77409f8e267706db446ec0.tar.bz2
sapi: Add profiling application level support
Diffstat (limited to 'testsuites/sptests/spprofiling01')
-rw-r--r--testsuites/sptests/spprofiling01/Makefile.am19
-rw-r--r--testsuites/sptests/spprofiling01/init.c63
-rw-r--r--testsuites/sptests/spprofiling01/spprofiling01.doc11
-rw-r--r--testsuites/sptests/spprofiling01/spprofiling01.scn5
4 files changed, 98 insertions, 0 deletions
diff --git a/testsuites/sptests/spprofiling01/Makefile.am b/testsuites/sptests/spprofiling01/Makefile.am
new file mode 100644
index 0000000000..872e50a712
--- /dev/null
+++ b/testsuites/sptests/spprofiling01/Makefile.am
@@ -0,0 +1,19 @@
+rtems_tests_PROGRAMS = spprofiling01
+spprofiling01_SOURCES = init.c
+
+dist_rtems_tests_DATA = spprofiling01.scn spprofiling01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spprofiling01_OBJECTS)
+LINK_LIBS = $(spprofiling01_LDLIBS)
+
+spprofiling01$(EXEEXT): $(spprofiling01_OBJECTS) $(spprofiling01_DEPENDENCIES)
+ @rm -f spprofiling01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spprofiling01/init.c b/testsuites/sptests/spprofiling01/init.c
new file mode 100644
index 0000000000..a1af66bba2
--- /dev/null
+++ b/testsuites/sptests/spprofiling01/init.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <rtems/profiling.h>
+#include <rtems/bspIo.h>
+#include <rtems.h>
+
+#include <stdio.h>
+
+#include "tmacros.h"
+
+static void test(void)
+{
+ rtems_status_code sc;
+ int rv;
+
+ sc = rtems_task_wake_after(3);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ rv = rtems_profiling_report_xml("X", rtems_printf_plugin, NULL, 1, " ");
+ printf("characters produced by rtems_profiling_report_xml(): %i\n", rv);
+}
+
+static void Init(rtems_task_argument arg)
+{
+ puts("\n\n*** TEST SPPROFILING 1 ***");
+
+ test();
+
+ puts("*** END OF TEST SPPROFILING 1 ***");
+
+ rtems_test_exit(0);
+}
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
diff --git a/testsuites/sptests/spprofiling01/spprofiling01.doc b/testsuites/sptests/spprofiling01/spprofiling01.doc
new file mode 100644
index 0000000000..2614c645af
--- /dev/null
+++ b/testsuites/sptests/spprofiling01/spprofiling01.doc
@@ -0,0 +1,11 @@
+This file describes the directives and concepts tested by this test set.
+
+test set name: spprofiling01
+
+directives:
+
+ - rtems_profiling_report_xml()
+
+concepts:
+
+ - Ensure that rtems_profiling_report_xml() yields the expected output.
diff --git a/testsuites/sptests/spprofiling01/spprofiling01.scn b/testsuites/sptests/spprofiling01/spprofiling01.scn
new file mode 100644
index 0000000000..2c289db941
--- /dev/null
+++ b/testsuites/sptests/spprofiling01/spprofiling01.scn
@@ -0,0 +1,5 @@
+*** TEST SPPROFILING 1 ***
+ <ProfilingReport name="X">
+ </ProfilingReport>
+characters produced by rtems_profiling_report_xml(): 50
+*** END OF TEST SPPROFILING 1 ***