qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: S KH <sgh8183@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Question in QEMU : The result of printf does not appear in the qemu VM's log.
Date: Wed, 8 May 2019 10:15:19 +0100	[thread overview]
Message-ID: <20190508091519.GD32552@redhat.com> (raw)
In-Reply-To: <CAE519-=VsRtsLhd9T-RWSV-29yGz_0Zp7-TdMfXKcrV1wN0GWg@mail.gmail.com>

On Wed, May 08, 2019 at 10:51:00AM +0900, S KH wrote:
> Hello.
> 
> I'am student studying QEMU hypervisor and SPICE.
> 
> In order to find out the calling order of functions in QEMU source, I input
> and compiled 'printf ("% s \ n", __ func__) "into source.

If using  printf() output is buffered so may not appear immediately in
the logs. For debugging it is best to use  g_printerr("%s\n", __func__)
which gets sent to stderr which is unbuffered so will appear immediately.

Of course the other possib8lity is that the code where you put ehe
printf statements is not being invoked by the tests you're trying.
 
> And when I run the VM and open 'domain_name.log' in '/ var / log / libvirt
> / qemu', I see that no output from printf is displayed.

The log file libvirt creates will capture both stdout & stderr.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


  reply	other threads:[~2019-05-08  9:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08  1:51 [Qemu-devel] Question in QEMU : The result of printf does not appear in the qemu VM's log S KH
2019-05-08  9:15 ` Daniel P. Berrangé [this message]
     [not found]   ` <CAE519-niSfXffzKMY09_JJZ7q3KDRf+z-AU-XNeNqD=Z-DAeoA@mail.gmail.com>
2019-05-08 10:12     ` Daniel P. Berrangé

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=20190508091519.GD32552@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgh8183@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).