[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240827065938.6b6d3767@kernel.org>
Date: Tue, 27 Aug 2024 06:59:38 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Maksym Kutsevol <max@...sevol.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Breno Leitao
<leitao@...ian.org>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] netcons: Add udp send fail statistics to netconsole
On Mon, 26 Aug 2024 19:55:36 -0400 Maksym Kutsevol wrote:
> > > +static ssize_t stats_show(struct config_item *item, char *buf)
> > > +{
> > > + struct netconsole_target *nt = to_target(item);
> > > +
> > > + return
> > > + nt->stats.xmit_drop_count, nt->stats.enomem_count);
> >
> > does configfs require value per file like sysfs or this is okay?
>
> Docs say (Documentation/filesystems/sysfs.txt):
>
> Attributes should be ASCII text files, preferably with only one value
> per file. It is noted that it may not be efficient to contain only one
> value per file, so it is socially acceptable to express an array of
> values of the same type.
Right, but this is for sysfs, main question is whether configfs has
the same expectations.
> Given those are of the same type, I thought it's ok. To make it less
> "fancy" maybe move to
> just values separated by whitespace + a block in
> Documentation/networking/netconsole.rst describing the format?
> E.g. sysfs_emit(buf, "%lu %lu\n", .....) ? I really don't want to have
> multiple files for it.
> What do you think?
Stats as an array are quite hard to read / understand
Powered by blists - more mailing lists