From: Justin Seyster Date: Fri, 8 Apr 2011 01:03:43 +0000 (-0400) Subject: Updates tracecut test cases to use tc_set_main_function(). X-Git-Tag: release-v1.1~9^2~4 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=0b9f23a26fd3e883da1559e6a8341ffdf5cb491a;p=interaspect.git Updates tracecut test cases to use tc_set_main_function(). --- diff --git a/test/plugin-declare.c b/test/plugin-declare.c index f6081ae..62a47a4 100644 --- a/test/plugin-declare.c +++ b/test/plugin-declare.c @@ -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 - 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(); } diff --git a/test/plugin-tracecut.c b/test/plugin-tracecut.c index cb2f49c..352b7f9 100644 --- a/test/plugin-tracecut.c +++ b/test/plugin-tracecut.c @@ -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(); } diff --git a/test/tracecut.xml b/test/tracecut.xml index 4f3231c..31a32c6 100644 --- a/test/tracecut.xml +++ b/test/tracecut.xml @@ -51,6 +51,39 @@ + 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