Re: [Qemu-devel] [Question] Static probe Qemu for CPU operation on KVM mode

2015-08-06 Thread Ady Wahyudi Paundu
Hi Stefan,

It was just as you explain, the CPU utilization profile of a VM.
Previously I thought there are any relevant trace events to it inside
Qemu with KVM mode. (There are obviously some when using Qemu with
TCG, since there are translation operations at work)
Thank you for the direction.

~Ady

On 8/6/15, Stefan Hajnoczi  wrote:
> On Thu, Aug 06, 2015 at 04:58:02AM +0900, Ady Wahyudi Paundu wrote:
>> If I want to profile a VM's CPU load when running Qemu with KVM mode
>> using static probe instrumentation, where (which file/function) should
>> I put my trace points?
>
> What are you trying to measure?
>
> Linux tools on the host will report CPU utilization for the QEMU process
> but also for the individual vcpus (they are threads and you can query
> their tids using the 'query-cpus' QMP command).  Plain old ps(1) and
> pidstat(1) will do the trick.
>
> Or you might want to look at "sudo perf list | grep kvm" for the
> KVM-specific host kernel trace events.  The most relevant trace events
> are probably kvm:kvm_entry and kvm:kvm_exit.  These events tell you when
> guest code starts/stops executing.
>
> Stefan
>



[Qemu-devel] [Question] Static probe Qemu for CPU operation on KVM mode

2015-08-05 Thread Ady Wahyudi Paundu
Dear Qemu Masters,
Please help.

If I want to profile a VM's CPU load when running Qemu with KVM mode
using static probe instrumentation, where (which file/function) should
I put my trace points?

I have tried to use the default trace-points (trace-events file)
without any success.
I have googling the web, but the best information I got is information
on TCG mode code flow.
Can anyone give the same information on KVM mode?

Thank you in advance

Best regards,
Ady



Re: [Qemu-devel] Help for beginner

2015-01-25 Thread Ady Wahyudi Paundu
Hi again, I am sorry for multiple reply, but i forget to mention one
other thing.

I also use lttng-ust method, and like my printf() attempt, I put my
new defined trace points into all function within net/net.c, net/tap.c
and hw/net/virtio-net.c.  Using this approach, i also cannot capture
my new trace points when doing 'ping'.  I am sure that i added my new
trace points correctly because i can list them using 'lttng list -u'

what did i do wrong?

~Ady

On 1/26/15, Ady Wahyudi Paundu  wrote:
> Hi Stefan, thank you for the tips.
>
> I was trying the way you suggested to add printfs.
> For starter I try to put them into all function within net/net.c,
> net/tap.c and hw/net/virtio-net.c (I run qemu using virtio netcard).
> However, there were no printf message showed up (when i started a qemu
> process and when i tried ping from within the guest OS of that qemu
> process). As if those functions were not used.
> Do you think I put those trace points in a wrong functions?
>
> Thanks in advance
> ~Ady
>
> On 1/16/15, Stefan Hajnoczi  wrote:
>
>>
>> Assuming you run qemu-system-x86_64 the default network card is an
>> emulated Intel e1000 NIC.
>>
>> See hw/net/e1000.c:start_xmit() for the function that emulates packet
>> transmission.  It loops over the transmit descriptor ring and send off
>> each packet that the guest has enqueued using qemu_send_packet().
>>
>> qemu_send_packet() is a QEMU network subsystem API that passes the
>> packet to a host network device (for example, -netdev tap).  What
>> happens next depends on which netdev the user launched QEMU with (the
>> default is 'user').
>>
>> The most popular netdev in production is tap.  Look at
>> net/tap.c:tap_receive() to see how QEMU writes the guest's packet to the
>> tap device on the host.
>>
>> The tap driver in the host kernel will then "receive" the packet from
>> the guest and process it further (often the user has configured a
>> software bridge device so the packet will be forwarded onto the host's
>> physical NIC).
>>
>> Just to recap the structure is:
>>
>>  guest <-> emulated e1000 NIC <-> tap netdev <-> host kernel
>>
>> Use tcpdump in the guest or host, or add printfs to QEMU if you want to
>> follow traffic further.
>>
>> Good luck,
>> Stefan
>>
>



Re: [Qemu-devel] Help for beginner

2015-01-25 Thread Ady Wahyudi Paundu
Hi Stefan, thank you for the tips.

I was trying the way you suggested to add printfs.
For starter I try to put them into all function within net/net.c,
net/tap.c and hw/net/virtio-net.c (I run qemu using virtio netcard).
However, there were no printf message showed up (when i started a qemu
process and when i tried ping from within the guest OS of that qemu
process). As if those functions were not used.
Do you think I put those trace points in a wrong functions?

Thanks in advance
~Ady

On 1/16/15, Stefan Hajnoczi  wrote:

>
> Assuming you run qemu-system-x86_64 the default network card is an
> emulated Intel e1000 NIC.
>
> See hw/net/e1000.c:start_xmit() for the function that emulates packet
> transmission.  It loops over the transmit descriptor ring and send off
> each packet that the guest has enqueued using qemu_send_packet().
>
> qemu_send_packet() is a QEMU network subsystem API that passes the
> packet to a host network device (for example, -netdev tap).  What
> happens next depends on which netdev the user launched QEMU with (the
> default is 'user').
>
> The most popular netdev in production is tap.  Look at
> net/tap.c:tap_receive() to see how QEMU writes the guest's packet to the
> tap device on the host.
>
> The tap driver in the host kernel will then "receive" the packet from
> the guest and process it further (often the user has configured a
> software bridge device so the packet will be forwarded onto the host's
> physical NIC).
>
> Just to recap the structure is:
>
>  guest <-> emulated e1000 NIC <-> tap netdev <-> host kernel
>
> Use tcpdump in the guest or host, or add printfs to QEMU if you want to
> follow traffic further.
>
> Good luck,
> Stefan
>



[Qemu-devel] Help for beginner

2015-01-12 Thread Ady Wahyudi Paundu
Hi all, Happy New Year (not too late I hope)
I also hope you guys don't' mind to be bothered by newbie questions
related to Qemu, because I really don't know where else to ask.  I
want to learn how several aspects of qemu works, and it really hard to
find resources (physical or virtual) about it.  From qemu
documentation "QEMU does not have a high level design description
document - only the source code tells the full story"
My question, if i want to learn CPU and/or Network related operation
within Qemu, what file (or function) should i put my focus into? for
example, simple ping operation from within a guest VM will use what
functions?
Thank you in advance.

regards,
ady



[Qemu-devel] about tracetool

2014-12-01 Thread Ady Wahyudi Paundu
Hi all,
I know that simpletrace records go to memory buffer before it flushed
to file by a writer thread.  My question is how to call this thread
(preferably using python), so I can make the flush process periodical?

Regards,
Ady