All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Doug Gale <doug16k@gmail.com>
Cc: Eric Blake <eblake@redhat.com>,
	kwolf@redhat.com, qemu-block@nongnu.org,
	qemu-devel <qemu-devel@nongnu.org>,
	mreitz@redhat.com, keith.busch@intel.com
Subject: Re: [Qemu-devel] Patch to add helpful tracing output for driver authors in NVMe emulation
Date: Tue, 10 Oct 2017 08:58:08 +0200	[thread overview]
Message-ID: <87h8v7lcan.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <CAEfK_44_43d5_KaGUf-FH7bHxre5BP1wCQu96p38bhskUqU+Ug@mail.gmail.com> (Doug Gale's message of "Mon, 9 Oct 2017 14:44:14 -0400")

Doug Gale <doug16k@gmail.com> writes:

> I used exclamations as a concise way of indicating that the driver did
> something nonsensical, or horribly invalid, like something likely to
> cause a memory corruption, trying to start the controller with a
> nonsense configuration, providing invalid PRDs or writing to
> unrecognized MMIO offsets that might hang or do something extremely
> bad on a poorly implemented controller. Exclaiming is not shouting, I
> thought shouting was when it was all uppercase.
>
> If a driver might trash memory or hang a controller, maybe it should
> shout at the driver author or person investigating an unstable VM.
> None of those messages with exclamations should ever happen. If any of
> them are possible when the driver is correct, then I have made a
> mistake.

Please do not top-quote on this mailing list.

Existing tracepoints do not use exclamation marks to signal severity.

Consider using assertions for "if this happens, either the program's
state is shot (and continuing is unsafe), or the author's mental state
was shot (and continuing is probably unsafe, too)" conditions.
Tracepoints are for tracing.

> On Mon, Oct 9, 2017 at 11:52 AM, Eric Blake <eblake@redhat.com> wrote:
>> On 10/07/2017 02:51 AM, Doug Gale wrote:
>>> Completely re-implemented patch, with significant improvements (now
>>> specifies values in several places I missed, also reduced the amount
>>> of redundant lines). I used the nvme_ as the tracing infrastructure
>>> prefix. Tested with -trace nvme_* on the qemu command line, worked for
>>> me.
>>
>> This information belongs...
>>
>>>
>>>>From 166f57458d60d363a10a0933c3e860985531ac96 Mon Sep 17 00:00:00 2001
>>> From: Doug Gale <doug16k@gmail.com>
>>> Date: Thu, 5 Oct 2017 19:02:03 -0400
>>> Subject: [PATCH] Add tracing output to NVMe emulation to help driver authors.
>>>
>>> This uses the tracing infrastructure using nvme_ as the prefix.
>>>
>>> Signed-off-by: Doug Gale <doug16k@gmail.com>
>>> ---
>>
>> ...here, after the --- separator.  It is useful to the patch reviewer,
>> but does not need to be in the 'git log' history.  The maintainers use
>> 'git am' to process incoming patches, which automatically prunes review
>> comments located in this location.
>>
>> Also, since this is a version 2 patch, it is best if your subject line
>> includes 'v2', and if you send the patch as a new top-level thread
>> rather than in-reply-to v1.  This can be done with 'git send-email -v2'.
>>
>> The subject line is atypical; we tend to prefer 'topic: Short summary',
>> where you are missing the topic, you had a trailing dot that is not
>> typical, and where your line is longer than usual.  A better subject
>> line might be:
>>
>> nvme: Add tracing output
>>
>>
>> For more helpful information on patch submission:
>>
>> https://wiki.qemu.org/Contribute/SubmitAPatch
>>
>> I didn't look closely at the patch itself, but did notice:
>>
>>> +nvme_mmio_start_failed(void) "setting controller enable bit failed!"
>>> +nvme_mmio_start_success(void) "setting controller enable bit succeeded"
>>> +nvme_mmio_stopped(void) "cleared controller enable bit"
>>> +nvme_mmio_shutdown_set(void) "shutdown bit set"
>>> +nvme_mmio_shutdown_cleared(void) "shutdown bit cleared"
>>> +nvme_mmio_ignored(uint64_t offset, uint64_t data) "invalid MMIO
>>> write, offset=0x%"PRIx64", data=%"PRIx64"!"
>>
>> You have a couple of traces with a trailing '!'; that is atypical,
>> because we don't need our traces to shout at the user.

  reply	other threads:[~2017-10-10  6:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 23:18 [Qemu-devel] Patch to add helpful tracing output for driver authors in NVMe emulation Doug Gale
2017-10-06  9:49 ` Kevin Wolf
2017-10-06 13:53   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-10-06 13:50 ` [Qemu-devel] " Eric Blake
2017-10-06 13:54   ` Daniel P. Berrange
2017-10-06 13:58     ` Doug Gale
2017-10-06 14:01       ` Daniel P. Berrange
2017-10-07  7:51         ` Doug Gale
2017-10-09 15:52           ` Eric Blake
2017-10-09 18:44             ` Doug Gale
2017-10-10  6:58               ` Markus Armbruster [this message]
2017-10-10  8:02                 ` Kevin Wolf
2017-10-11 13:03                   ` Doug Gale
2017-10-11 13:08                   ` Peter Maydell
2017-10-11 19:46                     ` [Qemu-devel] [Qemu-block] " Paolo Bonzini

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=87h8v7lcan.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=doug16k@gmail.com \
    --cc=eblake@redhat.com \
    --cc=keith.busch@intel.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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.