diff mbox series

[RFC,04/21] trace: enable the exec_tb trace events

Message ID 20181005154910.3099-5-alex.bennee@linaro.org
State New
Headers show
Series Trace updates and plugin RFC | expand

Commit Message

Alex Bennée Oct. 5, 2018, 3:48 p.m. UTC
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

Comments

Richard Henderson Oct. 6, 2018, 5:15 p.m. UTC | #1
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~
Emilio Cota Oct. 7, 2018, 1:42 a.m. UTC | #2
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.
Alex Bennée Oct. 8, 2018, 9:41 a.m. UTC | #3
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 mbox series

Patch

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"