summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-09-21 09:01:42 +1000
committerChris Johns <chrisj@rtems.org>2014-09-21 09:01:42 +1000
commitcf50e5776feb5bfcb0295ae8547679c738cd2623 (patch)
tree9975ae0574237a138cec2bdbad53b12af0298f62
parentClean up warnings. (diff)
downloadrtems-examples-cf50e5776feb5bfcb0295ae8547679c738cd2623.tar.bz2
Add RTEMS trace support.
-rw-r--r--hello/both_hello/hello.ini45
-rw-r--r--hello/both_hello/test.c18
-rw-r--r--hello/both_hello/wscript8
m---------rtems_waf0
4 files changed, 70 insertions, 1 deletions
diff --git a/hello/both_hello/hello.ini b/hello/both_hello/hello.ini
new file mode 100644
index 0000000..6790d74
--- /dev/null
+++ b/hello/both_hello/hello.ini
@@ -0,0 +1,45 @@
+;
+; RTEMS Trace Linker Configuration: hello
+;
+; This script configure the both hello example to perform some
+; tracing via the printf trace generator.
+;
+[tracer]
+;
+; Name of the trace.
+;
+name = Hello RTEMS Tracer
+;
+; Options can be defined here or on the command line.
+;
+options = all-funcs, verbose
+;
+; Functions to trace.
+;
+traces = hello-trace
+;
+; Define the function sets. These are the function's that can be
+; added to the trace lists.
+;
+functions = hello-trace
+;
+; Include RTEMS Trace support.
+;
+include = rtems.ini, rtld-base.ini
+
+;
+; User application trace example.
+;
+[hello-trace]
+generator = printk-generator
+signatures = hello-signatures
+trace = exit, Init, POSIX_Init, _Thread_Initialize
+header = "#include <rtems.h>"
+header = "#include <rtems/score/objectimpl.h>"
+header = "#include <rtems/score/scheduler.h>"
+
+[hello-signatures]
+exit=void, int
+Init = void, rtems_task_argument
+POSIX_Init = void*, void*
+_Thread_Initialize = bool, Objects_Information*, Thread_Control*, const Scheduler_Control*, void*, size_t, bool, Priority_Control, bool, Thread_CPU_budget_algorithms, Thread_CPU_budget_algorithm_callout, uint32_t, Objects_Name
diff --git a/hello/both_hello/test.c b/hello/both_hello/test.c
index 0b6af11..69dfb1a 100644
--- a/hello/both_hello/test.c
+++ b/hello/both_hello/test.c
@@ -7,20 +7,36 @@
#include <stdlib.h>
#include <unistd.h>
-rtems_task Init(
+long trace_test(int a, unsigned long b, long long c)
+{
+ printf ("int a=%i, unsigned long b=%u, long long c=%lli\n",
+ a, b, c);
+ return (long) (a + b);
+}
+
+rtems_task hello_init(
rtems_task_argument ignored
)
{
printf( "Classic -- Hello World\n" );
+ //trace_test(1, 2, 3);
rtems_task_delete( RTEMS_SELF );
}
+#define CONFIGURE_INIT_TASK_ENTRY_POINT hello_init
+
+int main(int argc, char** argv)
+{
+ hello_init(0);
+}
+
void *POSIX_Init(
void *argument
)
{
printf( "POSIX -- Hello World\n" );
sleep( 1 );
+ //trace_test(1, 2, 3);
exit( 0 );
}
diff --git a/hello/both_hello/wscript b/hello/both_hello/wscript
index 45c4c49..33187c4 100644
--- a/hello/both_hello/wscript
+++ b/hello/both_hello/wscript
@@ -1,4 +1,5 @@
# Copyright 2013 Gedare Bloom (gedare@rtems.org)
+# Copyright 2014 Chris Johns (chrisj@rtems.org)
#
# This file's license is 2-clause BSD as in this distribution's LICENSE.2 file.
#
@@ -9,6 +10,13 @@ import rtems_waf.rtems as rtems
def build(bld):
rtems.build(bld)
+ if rtems.check_env(bld, 'RTEMS_TLD'):
+ bld(features = 'c rtrace',
+ target = 'both_hello.texe',
+ source = ['test.c'],
+ rtrace_cfg = '../../hello/both_hello/hello.ini',
+ rtrace_wrapper = 'hello-test')
+
bld(features = 'c cprogram',
target = 'both_hello.exe',
source = ['test.c'])
diff --git a/rtems_waf b/rtems_waf
-Subproject 993d33b3fca2e3ddfe53b75fe6434438edd1c48
+Subproject db8c6f0c31efd09781e1804fcb2f3777d790420