Re: [PATCH v2 2/5] usb: serial: removing redundant __func__

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 15, 2016 at 08:26:25PM +0900, Greg Kroah-Hartman wrote:
> On Fri, Jul 15, 2016 at 08:14:26PM +0900, Greg KH wrote:
> > On Fri, Jul 15, 2016 at 12:40:45PM +0200, Oliver Neukum wrote:
> > > On Fri, 2016-07-15 at 11:35 +0200, Johan Hovold wrote:
> > > > which I find much harder to parse. We don't always enforce a common
> > > > prefix for function names, making grouping related functions even
> > > > harder.
> > > > 
> > > > Usually, what is printed in a debug message only makes sense in
> > > > combination with the function name (e.g. serial_write: 2 bytes), but
> > > > now
> > > > that connection is also less clear.
> > > > 
> > > > Also consider what the above log would look like if you have more than
> > > > one device active. Trying to keep the independent traces separate by
> > > > simply looking at the logs becomes almost impossible. For that reason
> > > > I
> > > > also very much prefer having the device name at the start of the
> > > > message.
> > > 
> > > You are right. But the correct remedy would be to fix dynamic debugging.
> > > Indeed printing the function before the module is braindead.

I think you meant "device name" and not "module" here, Oliver?

> > Yes, let's fix that instead, let me knock one up right now...
> 
> Wait, no, that's not the default at all.  module name and function name
> and line number and thread id are all options that you can ask for in
> the prefix.  If you don't, then they don't show up at all (which is why
> I never saw it before...)
> 
> The code looks like it is adding the module name before the function
> name, and it uses a ":" after the module name, which doesn't match up
> with what Johan showed in his log:
> 
> [  116.426849] ftdi_set_termios: ftdi_sio ttyUSB0: Setting CS8

My concern was about the device name (e.g. "ftdi_sio ttyUSB0") being
printed after the (module and) function name.

You still need to explicitly ask for the function name to be printed
though, and I tend not to enable that because of the reasons I mentioned
above.

And unless people start enabling that "+f" a lot of messages are likely
to become very cryptic if we simply drop the %s/__func__.

Also note that enabling "+m" would make the above example look like:

[ 8649.481781] ftdi_sio:ftdi_set_termios: ftdi_sio ttyUSB0: Setting CS8

> Johan, how are you enabling dynamic debug for these modules?  If you
> just use "+p" no function name should be there, you have to add "+mf" to
> get module and function names, right?

Usually I just use "+p", but I could start using "+pf" (or "+pmf") if I
could get the device name to be printed before the module and function
names.

> messy stuff...

Good if we can get it sorted, though.

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux