lkml.org 
[lkml]   [2020]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 23/24] kset-example: add pr_debug()s for easy visibility of its operation
On Mon, Jun 15, 2020 at 04:18:38PM -0600, jim.cromie@gmail.com wrote:
> On Sun, Jun 14, 2020 at 12:05 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Sat, Jun 13, 2020 at 09:57:37AM -0600, Jim Cromie wrote:
> > > put pr_debug()s into most functions, to easily see code operate when
> > > module is loaded and used.
> > >
> > > #> dmesg -w &
> > > #> modprobe kset-example dyndbg=+pfml
> > > #> cat /sys/kernel/kset-example/*/*
> > > ---
>
> > > static int __init example_init(void)
> > > {
> > > + pr_debug("called");
> >
> > Why??? If you want to do something like this, use ftrace, that is what
> > it is for.
> >
> > thanks,
> >
> > greg k-h
>
>
> mostly I needed an easy place to try out pr_debug_n in the next patch.
> if that next patch seems like a good anti-pattern for pr_debug_n use/misuse,
> then I could combine the 2, and add a 'dont do this, use ftrace' comment too.
> or not, of course.

This is not a good place to use it at all, as I do not want to see
people copying it. Anything that does "called" is ripe to just be
removed entirely.

Which again leads me to the "are you sure you want to do any of this?"
question as almost always, complex debugging stuff like this is never
used once the driver is up and running properly.

thanks,

greg k-h

\
 
 \ /
  Last update: 2020-06-16 08:37    [W:0.127 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site