lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Apr 2020 00:49:10 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     John Stultz <john.stultz@...aro.org>,
        Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clocksource: Add debugfs support

On Wed, Apr 01, 2020 at 12:29:17AM +0200, Thierry Reding wrote:
> On Wed, Apr 01, 2020 at 12:06:37AM +0200, Thomas Gleixner wrote:
> > Thierry,
> > 
> > Thierry Reding <thierry.reding@...il.com> writes:
> > > Add a top-level "clocksource" directory to debugfs. For each clocksource
> > > registered with the system, a subdirectory will be added with attributes
> > > that can be queried to obtain information about the clocksource.
> > 
> > first of all this does tell what this patch does but omits the more
> > important information about the WHY.
> > 
> > What's even worse is that the changelog is blantantly wrong.
> > 
> > > +static int clocksource_debugfs_counter_show(struct seq_file *s, void *data)
> > > +{
> > > +	struct clocksource *cs = s->private;
> > > +
> > > +	seq_printf(s, "%llu\n", cs->read(cs));
> > > +
> > > +	return 0;
> > > +}
> > > +DEFINE_SHOW_ATTRIBUTE(clocksource_debugfs_counter);
> > > +
> > > +static void clocksource_debugfs_add(struct clocksource *cs)
> > > +{
> > > +	if (!debugfs_root)
> > > +		return;
> > > +
> > > +	cs->debugfs = debugfs_create_dir(cs->name, debugfs_root);
> > > +
> > > +	debugfs_create_file("counter", 0444, cs->debugfs, cs,
> > > +			    &clocksource_debugfs_counter_fops);
> > > +}
> > 
> > It does not provide any information about the clocksource, it provides
> > an interface to read the counter - nothing else.
> 
> The counter is part of the information about a clocksource, isn't it?
> But yes, frankly I had anticipated that I'd be adding more files here
> and when I ended up not doing that I forgot to update the patch
> description.

Looking again, I suppose I could add a couple of the fields from struct
clocksource to this as well. The rating seems like it would be useful,
as well as perhaps the mult (and maxadj) and shift fields, which would
give users an easy way of converting the counter value to nanoseconds.
max_idle_ns, max_cycles and mask seem too low-level and are really only
useful for the kernel to deal with the clocksource.

"flags" might also be interesting.

Any other suggestions?

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ