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;
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();
}
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. */
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();
}
<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