From: Programmingkid <programmingkidx@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] hw/audio/sb16.c: Convert file to new logging API
Date: Wed, 31 Jan 2018 16:43:53 -0500 [thread overview]
Message-ID: <BCDC8A8F-F8CE-4F71-A11C-CF7078FB6BAF@gmail.com> (raw)
In-Reply-To: <20180131092213.srlhijglevhha6jw@sirius.home.kraxel.org>
> On Jan 31, 2018, at 4:22 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Tue, Jan 30, 2018 at 10:30:46AM -0500, Programmingkid wrote:
>>
>>> On Jan 30, 2018, at 4:41 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
>>>
>>>> @@ -148,15 +142,16 @@ static int irq_of_magic (int magic)
>>>> #if 0
>>>> static void log_dsp (SB16State *dsp)
>>>> {
>>>> - ldebug ("%s:%s:%d:%s:dmasize=%d:freq=%d:const=%d:speaker=%d\n",
>>>> - dsp->fmt_stereo ? "Stereo" : "Mono",
>>>> - dsp->fmt_signed ? "Signed" : "Unsigned",
>>>> - dsp->fmt_bits,
>>>> - dsp->dma_auto ? "Auto" : "Single",
>>>> - dsp->block_size,
>>>> - dsp->freq,
>>>> - dsp->time_const,
>>>> - dsp->speaker);
>>>> + qemu_log_mask(LOG_UNIMP, "%s:%s:%d:%s:dmasize=%d:freq=%d:const=%d:"
>>>> + "speaker=%d\n",
>>>> + dsp->fmt_stereo ? "Stereo" : "Mono",
>>>> + dsp->fmt_signed ? "Signed" : "Unsigned",
>>>> + dsp->fmt_bits,
>>>> + dsp->dma_auto ? "Auto" : "Single",
>>>> + dsp->block_size,
>>>> + dsp->freq,
>>>> + dsp->time_const,
>>>> + dsp->speaker);
>>>> }
>>>> #endif
>>>
>>> Hmm, dead code. Any places which call log_dsp() ?
>>
>> There are several places but they are all dead code. Do you want this removed?
>
> So it is still used but not compiled in by default.
>
> Looking at all of this again, I think "qemu_log_mask(LOG_UNIMP, ...)"
> should only be used in case there *really* is some soundblaster feature
> unimplemented. Otherwise converting to a tracepoint is probably more
> useful, so the debug messages can be enabled/disabled individually at
> runtime.
>
> The "#if 0" seems to be there to limit the flood of debug messages. So
> once they all are converted to trace points this is not needed any more
> and I think we should just enable all this code.
>
> dolog() seems to be mostly cases where the code warns about
> unimplemented featues or incomplete emulation, so using LOG_UNIMP looks
> sensible.
Simply replacing dolog() with "qemu_log_mask(LOG_UNIMP," seems like what was desired.
> ldebug() should probably trace points.
I need help with this. I tried replacing ldebug() with "qemu_log_mask(LOG_TRACE,", but that caused a lot of messages to be printed to the terminal. It is odd because I thought I had to use "-d trace" to make it print. Do you have another suggestion on what to replace ldebug() with?
> Probably makes sense to split this patch up into a small series.
The first patch will be the replacing dolog() with qemu_log_mask(LOG_UNIMP. The second patch will be replacing ldebug() with what you suggest.
next prev parent reply other threads:[~2018-01-31 21:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 5:18 [Qemu-devel] [PATCH] hw/audio/sb16.c: Convert file to new logging API John Arbuckle
2018-01-30 9:41 ` Gerd Hoffmann
2018-01-30 15:30 ` Programmingkid
2018-01-31 9:22 ` Gerd Hoffmann
2018-01-31 21:43 ` Programmingkid [this message]
2018-01-31 22:18 ` Programmingkid
2018-02-01 8:17 ` Gerd Hoffmann
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=BCDC8A8F-F8CE-4F71-A11C-CF7078FB6BAF@gmail.com \
--to=programmingkidx@gmail.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).