From bc6e46cce9e2f6e4555a2c6cff1521a522156c6d Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Mon, 13 Jul 2009 16:56:36 +0200 Subject: *tools/trace: * Added the possibility to add a callback file containing the function to decode traces. See the example/trace.trc to use it, the file containing the callback must be provided using the -c option in the interpretor. --- tools/trace/example/__init__.py | 0 tools/trace/example/callback.py | 4 ++++ tools/trace/example/trace.trc | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tools/trace/example/__init__.py create mode 100644 tools/trace/example/callback.py (limited to 'tools/trace/example') diff --git a/tools/trace/example/__init__.py b/tools/trace/example/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tools/trace/example/callback.py b/tools/trace/example/callback.py new file mode 100644 index 00000000..84876016 --- /dev/null +++ b/tools/trace/example/callback.py @@ -0,0 +1,4 @@ +def ia (data): + string = "\"IA arg1: %d arg2: %d arg3: %d\"" + string = string % tuple (data) + return string diff --git a/tools/trace/example/trace.trc b/tools/trace/example/trace.trc index 58b9e19a..cb9e9bdb 100644 --- a/tools/trace/example/trace.trc +++ b/tools/trace/example/trace.trc @@ -1,3 +1,3 @@ EVENT asserv__right_motor speed 4 position 4 acceleration 2 "Right motor speed : %d, position : %d, acceleration : %d" EVENT asserv__left_motor speed 4 position 4 acceleration 2 "Left motor speed : %d, position : %d, acceleration : %d" -EVENT ia__ia_cmd arg1 2 arg2 2 arg3 4 "IA cmd, arg1 : %d, arg2 : %d, arg3 : %d" +EVENT ia__ia_cmd arg1 2 arg2 2 arg3 4 [ia] -- cgit v1.2.3