All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ady Wahyudi Paundu <awpaundu@gmail.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Help for beginner
Date: Mon, 26 Jan 2015 13:10:52 +0900	[thread overview]
Message-ID: <CAOzyQ1HB_=QdRfo0PMctaz1i5apB7ZtOX-3_j78STRMjeOdDtg@mail.gmail.com> (raw)
In-Reply-To: <CAOzyQ1H3L_MNoB781_r-bYvE+usie5Aygby6knzbgkxc=MEK_Q@mail.gmail.com>

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 <awpaundu@gmail.com> 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 <stefanha@gmail.com> 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
>>
>

  reply	other threads:[~2015-01-26  4:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  1:40 [Qemu-devel] Help for beginner Ady Wahyudi Paundu
2015-01-15 15:32 ` Stefan Hajnoczi
2015-01-26  2:11   ` Ady Wahyudi Paundu
2015-01-26  4:10     ` Ady Wahyudi Paundu [this message]
2015-01-15 15:53 ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOzyQ1HB_=QdRfo0PMctaz1i5apB7ZtOX-3_j78STRMjeOdDtg@mail.gmail.com' \
    --to=awpaundu@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.