Message ID | 20181005154910.3099-5-alex.bennee@linaro.org |
---|---|
State | New |
Headers | show |
Series | Trace updates and plugin RFC | expand |
On 10/5/18 8:48 AM, Alex Bennée wrote: > Our performance isn't so critical that we can't spare a simple flag > check when we exec a TB considering everything else we check in the > outer loop. > > Signed-off-by: Alex Bennée <alex.bennee@linaro.org> > --- > accel/tcg/trace-events | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
On Fri, Oct 05, 2018 at 16:48:53 +0100, Alex Bennée wrote: > Our performance isn't so critical that we can't spare a simple flag > check when we exec a TB considering everything else we check in the > outer loop. [I know this is just done to illustrate how function names in plugins can bind to tracing calls, but someone might get confused by expecting more from "exec_tb" than it actually does.] This flag check costs nothing because "exec_tb" is almost never called. The way it works right now, we need -d nochain for "exec_tb" to actually generate an event every time a TB executes. IMO an eventual plugin API should let plugins decide whether to subscribe to the execution of a particular TB, when said TB is being translated, instead of providing an all-or-nothing switch. Thanks, E.
Emilio G. Cota <cota@braap.org> writes: > On Fri, Oct 05, 2018 at 16:48:53 +0100, Alex Bennée wrote: >> Our performance isn't so critical that we can't spare a simple flag >> check when we exec a TB considering everything else we check in the >> outer loop. > > [I know this is just done to illustrate how function names > in plugins can bind to tracing calls, but someone might > get confused by expecting more from "exec_tb" than it > actually does.] > > This flag check costs nothing because "exec_tb" is > almost never called. The way it works right now, we > need -d nochain for "exec_tb" to actually generate > an event every time a TB executes. I'll reword the commit a bit. > IMO an eventual plugin API should let plugins decide whether > to subscribe to the execution of a particular TB, when > said TB is being translated, instead of providing > an all-or-nothing switch. Well we will want pre/post instruction translation hooks which would be the obvious place to add this. Using -d nochain is a useful enough hack for now. > > Thanks, > > E. -- Alex Bennée
diff --git a/accel/tcg/trace-events b/accel/tcg/trace-events index c22ad60af7..618cc07738 100644 --- a/accel/tcg/trace-events +++ b/accel/tcg/trace-events @@ -1,10 +1,11 @@ # Trace events for debugging and performance instrumentation -# TCG related tracing (mostly disabled by default) +# TCG related tracing (you still need -d nochain to get a full picture +# as otherwise you'll only see the first TB executed in a chain) # cpu-exec.c -disable exec_tb(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR -disable exec_tb_nocache(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR -disable exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=0x%x" +exec_tb(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR +exec_tb_nocache(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR +exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=0x%x" # translate-all.c translate_block(void *tb, uintptr_t pc, uint8_t *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p"
Our performance isn't so critical that we can't spare a simple flag check when we exec a TB considering everything else we check in the outer loop. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- accel/tcg/trace-events | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.17.1