From cf50e5776feb5bfcb0295ae8547679c738cd2623 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Sun, 21 Sep 2014 09:01:42 +1000 Subject: Add RTEMS trace support. --- hello/both_hello/hello.ini | 45 +++++++++++++++++++++++++++++++++++++++++++++ hello/both_hello/test.c | 18 +++++++++++++++++- hello/both_hello/wscript | 8 ++++++++ rtems_waf | 2 +- 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 hello/both_hello/hello.ini 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 " +header = "#include " +header = "#include " + +[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 #include -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 index 993d33b..db8c6f0 160000 --- a/rtems_waf +++ b/rtems_waf @@ -1 +1 @@ -Subproject commit 993d33b3fca2e3ddfe53b75fe6434438edd1c48d +Subproject commit db8c6f0c31efd09781e1804fcb2f3777d7904209 -- cgit v1.2.3