summaryrefslogtreecommitdiffstats
path: root/testsuites
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
parentscore: Add --enable-profiling configure option (diff)
downloadrtems-4dad4b84112d57cf6e77409f8e267706db446ec0.tar.bz2
sapi: Add profiling application level support
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/Makefile.am1
-rw-r--r--testsuites/sptests/configure.ac1
-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
6 files changed, 100 insertions, 0 deletions
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 3aa133072c..d57ae69488 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -30,6 +30,7 @@ SUBDIRS = \
spsimplesched03 spnsext01 spedfsched01 spedfsched02 spedfsched03 \
spcbssched01 spcbssched02 spcbssched03 spqreslib sptimespec01 \
spregion_err01 sppartition_err01
+SUBDIRS += spprofiling01
SUBDIRS += spcache01
SUBDIRS += sptls03
SUBDIRS += spcpucounter01
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index fe9f81651c..5f98ba7573 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -36,6 +36,7 @@ AM_CONDITIONAL(HAS_CPUSET,test x"${ac_cv_header_sys_cpuset_h}" = x"yes")
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
+spprofiling01/Makefile
spcache01/Makefile
sptls03/Makefile
spcpucounter01/Makefile
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 ***