qemu-discuss
[Top][All Lists]
Advanced

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

Re: Where goes "printf" messages?


From: Peter Maydell
Subject: Re: Where goes "printf" messages?
Date: Sun, 1 Nov 2020 13:27:00 +0000

On Sun, 1 Nov 2020 at 11:20, Kamil Jońca <kjonca@poczta.onet.pl> wrote:
>
>
> Hello.
> Assume, I want to trace behavior one qemu part (say,
> https://github.com/qemu/qemu/blob/master/hw/input/ps2.c)
> How can I see
>
> (line 793)
> #ifdef DEBUG_MOUSE
>     printf("kbd: write mouse 0x%02x\n", val);
> #endif
>
> after, of course, uncommenting
>
> (line 39-40)
> /* debug PC keyboard : only mouse */
> //#define DEBUG_MOUSE
>
> I tried to run domain with -D option, but nothing showed in file.

printf() is the standard C library function. It sends output
to the QEMU process's standard output -- this is usually the
terminal window where you started QEMU.

In this particular case the DEBUG_MOUSE define and printf
are a leftover from an older way of printing tracing messages.
There's only this one message, and it's redundant with the
trace_ps2_write_mouse() trace event directly above it.
So instead of editing QEMU to enable this debug, it will be
simpler to just enable the trace events and use those.

There are multiple 'back ends' that you can send trace
events to, but the simplest way to enable trace is to
use the -d option: in this case:
 -d trace:ps2*
should enable all the ps2 trace events, which will log
to stderr by default. If you want to send them to a file
instead you can use the -D option to do that.

(I think I'll send in a patch to remove that last remnant
printf...)

thanks
-- PMM



reply via email to

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