Updates tracecut test cases to use tc_set_main_function().
authorJustin Seyster <jseyster@cs.sunysb.edu>
Fri, 8 Apr 2011 01:03:43 +0000 (21:03 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Fri, 8 Apr 2011 01:03:43 +0000 (21:03 -0400)
test/plugin-declare.c
test/plugin-tracecut.c
test/tracecut.xml

index f6081ae8d4f3b397c60d4bc64424be456bcc1954..62a47a4cfee28a3c4e9237dfb27027c02dff0938 100644 (file)
@@ -11,24 +11,6 @@ static struct tc_tracecut *tc_int;
 static struct tc_tracecut *tc_uint;
 static struct tc_tracecut *tc_fp;
 
-static void join_on_main(struct aop_joinpoint *jp, void *data)
-{
-  tc_insert_tracecut_init_advice(jp);
-}
-
-static unsigned int init_pass()
-{
-  struct aop_pointcut *pc;
-
-  pc = aop_match_function_entry();
-  aop_filter_entry_by_name(pc, "main");
-  aop_join_on(pc, join_on_main, NULL);
-
-  return 0;
-}
-
-#include <stdio.h>
-
 AOP_MAIN_PROTO aop_main()
 {
   enum tc_error tcerr;
@@ -115,7 +97,7 @@ AOP_MAIN_PROTO aop_main()
  
   aop_assert(tc_error_code(tc_fp) == TC_SUCCESS);
   
-  aop_register_pass("init_tracecut", init_pass);
+  tc_set_main_function("run_test");
   tc_register_tracecut_pass();
 }
 
index cb2f49c6f253888b2be3b5a6ef9a2668e512bdef..352b7f93a3bd626871d787f3a5465d181f3d54aa 100644 (file)
@@ -8,22 +8,6 @@ static struct tc_tracecut *tc_foo;
 static struct tc_tracecut *tc_bar;
 static struct tc_tracecut *tc_both;
 
-static void join_on_main(struct aop_joinpoint *jp, void *data)
-{
-  tc_insert_tracecut_init_advice(jp);
-}
-
-static unsigned int init_pass()
-{
-  struct aop_pointcut *pc;
-
-  pc = aop_match_function_entry();
-  aop_filter_entry_by_name(pc, "run_test");
-  aop_join_on(pc, join_on_main, NULL);
-
-  return 0;
-}
-
 AOP_MAIN_PROTO aop_main()
 {
   /* Tracecut for foo objects. */
@@ -76,7 +60,7 @@ AOP_MAIN_PROTO aop_main()
 
   aop_assert(tc_error_code(tc_both) == TC_SUCCESS);
 
-  aop_register_pass("init_tracecut", init_pass);
+  tc_set_main_function("run_test");
   tc_register_tracecut_pass();
 }
 
index 4f3231c88b9d7e26f6b70a3b5e401060d943af32..31a32c61c3a3eea280b37824ff9d9330cceb8266 100644 (file)
   <run name="Tracecut declare" target="tracecut-target.c" hooks="tracecut-hooks.c">
     <using plugin="plugin-declare" />
     <output>
+      Init -- n: 6
+      New tracecut -- tc: 0, params: 1, symbols: 1
+      Name symbol -- tc: 0, symbol: 1, name: dec_fp
+      Name symbol -- tc: 0, symbol: 0, name: inc_fp
+      Name param -- tc: 0, param: 0, name: fp_val
+      Compile -- tc: 0, 0, inc_fp* dec_fp
+      New tracecut -- tc: 1, params: 1, symbols: 1
+      Name symbol -- tc: 1, symbol: 1, name: dec_uint
+      Name symbol -- tc: 1, symbol: 0, name: inc_uint
+      Name param -- tc: 1, param: 0, name: uint_val
+      Compile -- tc: 1, 0, inc_uint* dec_uint
+      New tracecut -- tc: 2, params: 1, symbols: 1
+      Name symbol -- tc: 2, symbol: 1, name: dec_int
+      Name symbol -- tc: 2, symbol: 0, name: inc_int
+      Name param -- tc: 2, param: 0, name: int_val
+      Compile -- tc: 2, 0, inc_int* dec_int
+      New tracecut -- tc: 3, params: 2, symbols: 2
+      Name symbol -- tc: 3, symbol: 0, name: transfer
+      Name param -- tc: 3, param: 1, name: bar
+      Name param -- tc: 3, param: 0, name: foo
+      Compile -- tc: 3, 0, transfer transfer
+      New tracecut -- tc: 4, params: 1, symbols: 1
+      Name symbol -- tc: 4, symbol: 2, name: half
+      Name symbol -- tc: 4, symbol: 1, name: double
+      Name symbol -- tc: 4, symbol: 0, name: get
+      Name param -- tc: 4, param: 0, name: bar
+      Compile -- tc: 4, 0, get double* half
+      New tracecut -- tc: 5, params: 1, symbols: 1
+      Name symbol -- tc: 5, symbol: 2, name: dec
+      Name symbol -- tc: 5, symbol: 1, name: inc
+      Name symbol -- tc: 5, symbol: 0, name: get
+      Name param -- tc: 5, param: 0, name: foo
+      Compile -- tc: 5, 0, inc* dec
       Beginning event -- tc: 5
       Param -- tc: 5, symbol: 0, param: 0, value: 0x8
       Transition event -- tc: 5, symbol: 0