All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH -v2 1/2] Log reset events
Date: Fri, 16 Jan 2009 14:35:22 +0100	[thread overview]
Message-ID: <49708D1A.7050207@siemens.com> (raw)
In-Reply-To: <49707D1C.1080907@siemens.com>

Jan Kiszka wrote:
> Kevin Wolf wrote:
>> Laurent Desnogues schrieb:
>>> On Fri, Jan 16, 2009 at 1:14 PM, Kevin Wolf <kwolf@suse.de> wrote:
>>> [..]
>>>>> @@ -159,6 +159,12 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
>>>>>  void cpu_reset(CPUARMState *env)
>>>>>  {
>>>>>      uint32_t id;
>>>>> +
>>>>> +    if (qemu_loglevel_mask(CPU_LOG_RESET)) {
>>>>> +        fprintf(logfile, "CPU Reset (CPU %d)\n", env->cpu_index);
>>>>> +        cpu_dump_state(env, logfile, fprintf, 0);
>>>> Shouldn't that be qemu_log() and log_cpu_state() now?
>>> Yes. Sorry Jan :)
> 
> Well, the patch description misled me a bit ("global s/loglevel &
> X/qemu_loglevel_mask(X)/"), but I also could have checked more carefully
> what actually changed.
> 
>>> A trick to check things are done properly is to make sure you
>>> don't ever use logfile or loglevel variables.
>> Maybe qemu_log() should be a function rather than a macro? Then loglevel
>> and logfile could be static and the build would break if you try to use
>> them outside the logging code.
> 
> Sounds good (function-like macros are for corner cases only).
> 
> I will try to make logfile/loglevel static and fix my patch accordingly.

Making logfile and loglevel static means enforcing a function call just
to check if we perform logging. Would the additional overhead be
acceptable for all qemu_log* spots? Unless maintainers tell me "yes", I
will not touch this part for now.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 26
Corporate Competence Center Embedded Linux

  reply	other threads:[~2009-01-16 13:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 10:05 [Qemu-devel] [RESEND][PATCH 1/2] Log reset events Jan Kiszka
2009-01-16 10:20 ` Laurent Desnogues
2009-01-16 11:32   ` [Qemu-devel] " Jan Kiszka
2009-01-16 11:56     ` [Qemu-devel] [PATCH -v2 " Jan Kiszka
2009-01-16 12:14       ` Kevin Wolf
2009-01-16 12:12         ` Laurent Desnogues
2009-01-16 12:25           ` Kevin Wolf
2009-01-16 12:24             ` Laurent Desnogues
2009-01-16 12:27             ` [Qemu-devel] " Jan Kiszka
2009-01-16 13:35               ` Jan Kiszka [this message]
2009-01-16 13:52                 ` Kevin Wolf
2009-01-16 14:16       ` [Qemu-devel] [PATCH -v3 " Jan Kiszka
2009-01-16 15:05         ` Kevin Wolf
2009-01-16 15:35           ` [Qemu-devel] " Jan Kiszka

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=49708D1A.7050207@siemens.com \
    --to=jan.kiszka@siemens.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 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.