[Qemu-devel] How to speed up the CPU logging?

2012-06-09 Thread Yue Chen
Hi, Guy,

When I use *log cpu* or *log exec* in the system *-monitor stdio*
mode, it's extremely slow(lose my mouse/keyboard control). I used a buffer
instead of directly writing log to disk, but even slower. When I give a
large memory (-m 4G) to VM, or set the process priority(chrt -f 99) of
QEMU,  the situation is the same. Any approach to speed up logging? (let me
be able to control the VM when logging.) Thanks.


Re: [Qemu-devel] How to speed up the CPU logging?

2012-06-09 Thread Yue Chen
Thanks for replying. Do you know any easy way to do that?

On Sat, Jun 9, 2012 at 11:02 AM, Blue Swirl blauwir...@gmail.com wrote:

 On Sat, Jun 9, 2012 at 2:37 PM, Yue Chen ycyc...@gmail.com wrote:
  Hi, Guy,
 
  When I use log cpu or log exec in the system -monitor stdio mode,
 it's
  extremely slow(lose my mouse/keyboard control). I used a buffer instead
 of
  directly writing log to disk, but even slower. When I give a large memory
  (-m 4G) to VM, or set the process priority(chrt -f 99) of QEMU,  the
  situation is the same. Any approach to speed up logging? (let me be able
 to
  control the VM when logging.) Thanks.

 The performance is slow because logging is text based and therefore
 there is a lot of processing and I/O.

 Log users should be converted to trace points which use binary data,
 that would be much faster and more efficient.



Re: [Qemu-devel] Any approach to log the file read/write (I/O data flow) like the -d in_asm option?

2012-06-03 Thread Yue Chen
I'm doing something like a *simple and lightweight* REPLAY program out of
QEMU, only including CPU, MEMORY, and DISK. I'm implementing it with a
shadow CPU (register state), shadow memory(from *pmemsave*) and shadow *
.img* file (disk).

When I get the *log exec,op*(preferred) or *log
exec,in_asm*instruction traces from monitor in whole-system emulation
mode, the final
step to replay read/write a file to/from the disk seems the *in/ins* and *
out/outs* instructions(translated into a *CALL* instruction in
Intermediate Representation of QEMU), which can set DMA and transfer data.

But from the instruction traces, I don't know which location in the
*.img*file (disk) has been accessed. (It's also hard to find out
which file has
been read/written in higher semantics.) Any easy approach to do this?
Thanks so much.


On Fri, Jun 1, 2012 at 4:09 AM, Stefan Hajnoczi stefa...@gmail.com wrote:

 On Fri, Jun 1, 2012 at 4:11 AM, Yue Chen ycyc...@gmail.com wrote:
  Any approach to log all the file read/write (I/O data flow) in order,
  together with the instruction traces in QEMU? Thanks.

 It sounds like you may be running a *-user target because softmmu
 (system emulation) has no knowledge of file I/O inside the guest.
 Please give more details of what you're trying to do if this is
 incorrect.

 It sounds like you want strace together with -d in_asm output.  Have
 you seen linux-user/strace.c?

 Stefan



[Qemu-devel] Any approach to log the file read/write (I/O data flow) like the -d in_asm option?

2012-05-31 Thread Yue Chen
Hi,

Any approach to log all the file read/write (I/O data flow) in order,
together with the instruction traces in QEMU? Thanks.


Re: [Qemu-devel] Lack of codes in logging

2012-05-28 Thread Yue Chen
Do you know how to use that? When I use* log(-d) exec and log(-d) pcall*,
the qemu.log is always empty.

On Mon, May 28, 2012 at 10:47 PM, 陳韋任 (Wei-Ren Chen) 
che...@iis.sinica.edu.tw wrote:

 On Mon, May 28, 2012 at 10:37:47PM -0400, Yue Chen wrote:
  What's the helper function? Thanks.

   How QEMU translation works is as below,

  guest binary - TCG IR - host binary

 To express complicated operations is not easy for TCG IR. Therefore, you
 can
 write normal C function (helper_function), then use TCG IR call to call
 that
 C function (call helper_function). But I note what you are talking about is
 in_asm, not op, so Peter should be right. Try -d exec instead.

 Regards,
 chenwj

 --
 Wei-Ren Chen (陳韋任)
 Computer Systems Lab, Institute of Information Science,
 Academia Sinica, Taiwan (R.O.C.)
 Tel:886-2-2788-3799 #1667
 Homepage: http://people.cs.nctu.edu.tw/~chenwj



[Qemu-devel] To run (replay) the intermediate micro-ops directly

2012-04-30 Thread Yue Chen
Hi,

Does anyone know, how to run(replay) the intermediate micro-ops directly?

For example, I have traced some micro-op instructions, and want to see what
happens with these instructions(after being translated into host code and
then run). Probably with Graphic User Interface.

Any approach to do this in QEMU? Thanks.


Re: [Qemu-devel] Debug single program in QEMU

2012-04-05 Thread Yue Chen
Hi, thanks again for your reply.

It seems that, from the instruction log, we can find out *which
instructions   belong to   which process(task)*  according to CR3 register.


2012/3/15 陳韋任 che...@iis.sinica.edu.tw

  O.K., then. You must specify which mode you're running, user mode or
 system
 mode? User mode shouldn't have the issue you described. For system mode, I
 have
 no good idea on how to track a specific program running on the guest OS.

 On Thu, Mar 15, 2012 at 09:40:48AM -0400, Yue Chen wrote:
  But it is hard to localize a specific program instead of lots of logs.
  On Mar 15, 2012 4:14 AM, 陳韋任 che...@iis.sinica.edu.tw wrote:
 
   On Thu, Mar 15, 2012 at 01:26:44PM +0700, Mulyadi Santosa wrote:
On Thu, Mar 15, 2012 at 09:12, Yue Chen ycyc...@gmail.com wrote:
 Hi!~

 Now I'd like to see what the micro-ops (intermediate operations
   generated by
 TCG) of a single Linux or Windows program, any approach to do this
   under
 QEMU? Thanks.
   
are you referring to you Qemu system emulation or Qemu user mode?
  
Does that matter? I think -d op should be enough, right?

 Regards,
 chenwj

 --
 Wei-Ren Chen (陳韋任)
 Computer Systems Lab, Institute of Information Science,
 Academia Sinica, Taiwan (R.O.C.)
 Tel:886-2-2788-3799 #1667
 Homepage: http://people.cs.nctu.edu.tw/~chenwj



Re: [Qemu-devel] Debug single program in QEMU

2012-04-03 Thread Yue Chen
Hi,

Could you tell me what kind of programs can be emulated in user-mode of
QEMU ?

It seems that only limited programs can be emulated in user-mode, like
/bin/ls, and with warning. A lot of other programs cannot be emulated, like
GUI programs, browser, etc.

Additionally, why so many instructions come out when I use   -d in_asm 
to log? It's hard to find the real instructions of that single program...
Thanks.

2012/3/15 陳韋任 che...@iis.sinica.edu.tw

  http://qemu.weilnetz.de/qemu-doc.html#QEMU-User-space-emulator

 On Thu, Mar 15, 2012 at 10:42:02PM -0400, Yue Chen wrote:
  So how to run a Windows program or Linux program under user mode ? I
 cannot
  find useful documentations. Many thanks.

  --
 Wei-Ren Chen (陳韋任)
 Computer Systems Lab, Institute of Information Science,
 Academia Sinica, Taiwan (R.O.C.)
 Tel:886-2-2788-3799 #1667
 Homepage: http://people.cs.nctu.edu.tw/~chenwj



Re: [Qemu-devel] Debug single program in QEMU

2012-03-15 Thread Yue Chen
But it is hard to localize a specific program instead of lots of logs.
On Mar 15, 2012 4:14 AM, 陳韋任 che...@iis.sinica.edu.tw wrote:

 On Thu, Mar 15, 2012 at 01:26:44PM +0700, Mulyadi Santosa wrote:
  On Thu, Mar 15, 2012 at 09:12, Yue Chen ycyc...@gmail.com wrote:
   Hi!~
  
   Now I'd like to see what the micro-ops (intermediate operations
 generated by
   TCG) of a single Linux or Windows program, any approach to do this
 under
   QEMU? Thanks.
 
  are you referring to you Qemu system emulation or Qemu user mode?

  Does that matter? I think -d op should be enough, right?

 Regards,
 chenwj

 --
 Wei-Ren Chen (陳韋任)
 Computer Systems Lab, Institute of Information Science,
 Academia Sinica, Taiwan (R.O.C.)
 Tel:886-2-2788-3799 #1667
 Homepage: http://people.cs.nctu.edu.tw/~chenwj



Re: [Qemu-devel] Debug single program in QEMU

2012-03-15 Thread Yue Chen
So how to run a Windows program or Linux program under user mode ? I cannot
find useful documentations. Many thanks.

2012/3/15 陳韋任 che...@iis.sinica.edu.tw

  O.K., then. You must specify which mode you're running, user mode or
 system
 mode? User mode shouldn't have the issue you described. For system mode, I
 have
 no good idea on how to track a specific program running on the guest OS.

 On Thu, Mar 15, 2012 at 09:40:48AM -0400, Yue Chen wrote:
  But it is hard to localize a specific program instead of lots of logs.
  On Mar 15, 2012 4:14 AM, 陳韋任 che...@iis.sinica.edu.tw wrote:
 
   On Thu, Mar 15, 2012 at 01:26:44PM +0700, Mulyadi Santosa wrote:
On Thu, Mar 15, 2012 at 09:12, Yue Chen ycyc...@gmail.com wrote:
 Hi!~

 Now I'd like to see what the micro-ops (intermediate operations
   generated by
 TCG) of a single Linux or Windows program, any approach to do this
   under
 QEMU? Thanks.
   
are you referring to you Qemu system emulation or Qemu user mode?
  
Does that matter? I think -d op should be enough, right?

 Regards,
 chenwj

 --
 Wei-Ren Chen (陳韋任)
 Computer Systems Lab, Institute of Information Science,
 Academia Sinica, Taiwan (R.O.C.)
 Tel:886-2-2788-3799 #1667
 Homepage: http://people.cs.nctu.edu.tw/~chenwj



[Qemu-devel] Debug single program in QEMU

2012-03-14 Thread Yue Chen
Hi!~

Now I'd like to see what the micro-ops (intermediate operations generated
by TCG) of a single Linux or Windows program, any approach to do this under
QEMU? Thanks.


Re: [Qemu-devel] How to trace all the guest OS instructions and the micro-ops

2012-03-12 Thread Yue Chen
Thanks a lot. So any approach to get the dynamic or static whole memory
information of the guest OS ? Not the memory of each process.

Sorry for the confusion. I do use version 1.0.1.  I mention not in 0.9.1
because someone has already implemented the dynamic tracing in 0.9.1, but
not in the latest version.




On Mon, Mar 12, 2012 at 2:20 AM, Chen Yufei cyfde...@gmail.com wrote:

 On Mon, Mar 12, 2012 at 5:43 AM, Mulyadi Santosa
 mulyadi.sant...@gmail.com wrote:
  Hi
 
  On Sun, Mar 11, 2012 at 10:12, Yue Chen ycyc...@gmail.com wrote:
  I am doing some research based on the QEMU. Does anyone know how to get
  (trace) all the instructions of the guest OS, and get all the
 intermediate
  micro-ops ?  (Not in the 0.9.1 version)

 QEMU has release version 1.0.1. Why are you still using 0.9.1?

 
  I believe it's -d option you're looking for. Please read qemu manual
  for further clarification and info.

 -d can only give a static view of what instruction is translated,
 but can't get a dynamic instruction execution trace.

 
  Additionally, how to get the whole memory or each process' memory data
 of
  the guest OS?
 
  you wanna do that simply from Qemu's monitor? I don't think that's
  doable...or at least easily. Qemu sees guest RAM like your physical
  RAM. It doesn't differentiate which pages belongs to which process.
  You need to hook or go straight inside the guest OS, maybe using gdb
  or other tool to get the core dump of those processes.
 
  I really appreciate your help.
 
  Hope it helps...
 
  --
  regards,
 
  Mulyadi Santosa
  Freelance Linux trainer and consultant
 
  blog: the-hydra.blogspot.com
  training: mulyaditraining.blogspot.com
 



 --
 Best regards,
 Chen Yufei



[Qemu-devel] How to trace all the guest OS instructions and the micro-ops

2012-03-11 Thread Yue Chen
Hi!

I am doing some research based on the QEMU. Does anyone know how to get
(trace) all the instructions of the guest OS, and get all the intermediate
micro-ops ?  (Not in the 0.9.1 version)

Additionally, how to get the whole memory or each process' memory data of
the guest OS?

I really appreciate your help.