* trace_exec_tb(tb, pc) does not have cpu index
@ 2023-08-21 19:32 Igor Lesik
2023-08-22 8:55 ` Alex Bennée
0 siblings, 1 reply; 3+ messages in thread
From: Igor Lesik @ 2023-08-21 19:32 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Hi.
I am wondering why trace events like trace_exec_tb(tb, pc) do not have cpu index, how to make sense of the trace in case of multiple vCPUs?
I have changed it to trace_exec_tb(tb, pc, cpu->cpu_index) to read my trace, and now wondering should not it be there by default? Am I missing something?
I am using "simple" trace backend.
Thanks,
Igor
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: trace_exec_tb(tb, pc) does not have cpu index
2023-08-21 19:32 trace_exec_tb(tb, pc) does not have cpu index Igor Lesik
@ 2023-08-22 8:55 ` Alex Bennée
2023-08-22 9:46 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Alex Bennée @ 2023-08-22 8:55 UTC (permalink / raw)
To: qemu-devel@nongnu.org, Igor Lesik
Igor Lesik <lesikigor@meta.com> writes:
> Hi.
>
> I am wondering why trace events like trace_exec_tb(tb, pc) do not have
> cpu index, how to make sense of the trace in case of multiple vCPUs?
> I have changed it to trace_exec_tb(tb, pc, cpu->cpu_index) to read my
> trace, and now wondering should not it be there by default? Am I
> missing something?
Not necessarily but be aware trace_exec_tb won't catch every execution
of a TB without -d nochain anyway. There are other trace points/logging
methods you could use (-d cpu) which follow the executed PC more closely
although without the TB associated with it, although again needing
nochain for completeness.
It really depends on what your overall aim is? If you really want to
closely follow what a guest is doing then build an experiment using TCG
plugins where you can flexibly instrument and trace execution. If you
are debugging TB execution does the vCPU it runs on really matter?
>
> I am using "simple" trace backend.
>
> Thanks,
> Igor
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: trace_exec_tb(tb, pc) does not have cpu index
2023-08-22 8:55 ` Alex Bennée
@ 2023-08-22 9:46 ` Peter Maydell
0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2023-08-22 9:46 UTC (permalink / raw)
To: Alex Bennée; +Cc: qemu-devel@nongnu.org, Igor Lesik
On Tue, 22 Aug 2023 at 10:01, Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Igor Lesik <lesikigor@meta.com> writes:
>
> > Hi.
> >
> > I am wondering why trace events like trace_exec_tb(tb, pc) do not have
> > cpu index, how to make sense of the trace in case of multiple vCPUs?
> > I have changed it to trace_exec_tb(tb, pc, cpu->cpu_index) to read my
> > trace, and now wondering should not it be there by default? Am I
> > missing something?
>
> Not necessarily but be aware trace_exec_tb won't catch every execution
> of a TB without -d nochain anyway. There are other trace points/logging
> methods you could use (-d cpu) which follow the executed PC more closely
> although without the TB associated with it, although again needing
> nochain for completeness.
Also odd is: why is the trace_exec_tb() tracepoint duplicated before
both calls to cpu_tb_exec() rather than just being once inside
the function itself, where the CPU_LOG_EXEC logging happens ?
(I suspect the answer partly here is "most people logging CPU
execution stuff use the -d logging, not the tracepoints", but
I could be wrong and maybe that's just the way I do it.
Certainly the -d logging gives more detail, including TB
flags and symbol information for the PC value.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-22 9:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-21 19:32 trace_exec_tb(tb, pc) does not have cpu index Igor Lesik
2023-08-22 8:55 ` Alex Bennée
2023-08-22 9:46 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.