qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] Static instrumentation (aka guest code tracing)


From: Paul Brook
Subject: Re: [Qemu-devel] [RFC] Static instrumentation (aka guest code tracing)
Date: Fri, 26 Nov 2010 21:33:33 +0000
User-agent: KMail/1.13.5 (Linux/2.6.36-trunk-amd64; KDE/4.4.5; x86_64; ; )

> > Likewise requiring separate tracing hooks be added to the existing
> > decoders is extremely unlikely to be a feasible long-term
> > solution.
> 
> You mean having to modify each "translate.c"? The worst event to handle
> is instruction fetch on x86.

Instruction fetches are trivial, you just intercept calls to ld*_code.

> > I'd also posit that instrumenting changes in sate is of very limited use
> > if you don't know what the new value is.
> 
> I don't understand what you mean here.

Your proposed FETCH macro instrumented which registers are modified by an 
insn, but did not the actual values about to be written to those registers.
 
> > You almost certainly want to do this using the equivalent of a memory
> > watchpoint on the CPUState structure.
> 
> Sorry, do what?

All guest register values are held in the CPUState structure. So to instrument 
accesses to guest state you just need to intercept TCG accesses to this 
structure, either via explicit ld/st ops, or via a global_mem. To a first 
approximation you can probably get away with just the latter.

Paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]