All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zoltan Kiss <zoltan.kiss@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH net-next] xen-netback: Adding debugfs "io_ring_qX" files
Date: Wed, 2 Jul 2014 19:43:25 +0100	[thread overview]
Message-ID: <53B452CD.7020903@citrix.com> (raw)
In-Reply-To: <1404298567.5562.13.camel@kazak.uk.xensource.com>

On 02/07/14 11:56, Ian Campbell wrote:
> On Mon, 2014-06-30 at 21:33 +0100, Zoltan Kiss wrote:
>> This patch adds debugfs capabilities to netback. There used to be a similar
>> patch floating around for classic kernel, but it used procfs. It is based on a
>> very similar blkback patch.
>> It creates xen-netback/[vifname]/io_ring_q[queueno] files, reading them output
>> various ring variables etc. Writing "kick" into it imitates an interrupt
>> happened, it can be useful to check whether the ring is just stalled due to a
>> missed interrupt.
>
> Shouldn't there be some CONFIG_XEN_DEBUG_FS ifdefs sprinkled around
> here?

Good question! I've checked where else is this used, it is in 
arch/x86/xen, particularly in spinlock.c and p2m.c. The goal there is, 
as far as I see, to make it configurable whether you want debugging in 
fast path. However here in netback it's not fast path.
It would be nice to have this netback debugfs stuff in production 
systems, but if it is tied to this same config option, that wouldn't be 
possible.
So either we don't put it behind a config option, or create a whole new 
one just for this. I don't see the benefit of the latter one, so I would 
prefer keep it like it is now.
>
>> 	if (tx_ring->sring) {
>> +		struct xen_netif_tx_sring *sring = tx_ring->sring;
>> +
>> +		err = snprintf(buf + rv, XEN_NETBACK_DBG_IORING_BUF_SIZE - rv,
>> +			       "TX queue %d: nr_ents %u\n", i,
>> +			       tx_ring->nr_ents);
>> +		if (err >= XEN_NETBACK_DBG_IORING_BUF_SIZE - rv)
>> +			return XEN_NETBACK_DBG_IORING_BUF_SIZE;
>> +		else
>> +			rv += err;
>
> Does debugfs not provide helpers which let this be done in some more
> palatable way?
>
> arch/x86/xen/p2m.c seems to use some useful seq_*/single_* helpers for
> something very similar and it looks much cleaner.
It took some time until I figured it out how to use them, but I've 
changed it for the next version.


>
>> +	if (vif->xenvif_dbg_root)
>
> No IS_ERR check?
>
> And in backend_disconnect/connect too.
Indeed, I fixed that
>
> Ian.
>


  reply	other threads:[~2014-07-02 18:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 20:33 [PATCH net-next] xen-netback: Adding debugfs "io_ring_qX" files Zoltan Kiss
2014-07-02 10:56 ` Ian Campbell
2014-07-02 18:43   ` Zoltan Kiss [this message]
2014-07-02 18:58     ` Ian Campbell
2014-07-02 18:58     ` Ian Campbell
2014-07-02 18:43   ` Zoltan Kiss
2014-07-02 10:56 ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2014-06-30 20:33 Zoltan Kiss

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=53B452CD.7020903@citrix.com \
    --to=zoltan.kiss@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.