On Sat, Sep 21, 2013 at 3:43 AM, Xenia Ragiadakou <burzalodowa@xxxxxxxxx> wrote: > On 09/21/2013 04:30 AM, Dan Williams wrote: > Hi Dan, > > What do you mean by saying "1% object size hit"? Do you mean 1% increase in > xhci footprint? I was comparing the results of size(1) on xhci-hcd.o with a version that turns xhci_ddbg_trace, but I have not looked to see how much of that overhead actually impacts performance in the debug/tracing disabled case. > > Although, I wrote the patches that add traces for xhci debugging statements, Thank you for that! I just started working with the xhci driver and this conversion already proved useful for me. > there are some > things that bother me. One is that their functionality can be replicated in > many cases using the dynamic debugging interface, which does not add any > extra overhead, The dynamic debug interface adds more overhead compared to tracing as it needs to read a variable and evaluate a branch at every invocation in the disabled case. > and the other is that xhci_dbg_trace hides the calls to > xhci_dbg(), which restricts the control over the dynamic debug statements > (i.e when someone enables the debug statements of a function by writing to > dynamic_debug/control file in debugfs, and the calls to dev_dbg() are hidden > by calls to xhci_dbg_trace, those debug statements won't be enabled). I see what you mean. This got me thinking it would be nice to make something like xhci_dbg_trace a generic implementation that combines a dynamic print statement with a trace point. I took a quick stab at it and it seems possible to have: 1/ a combined debug print / tracepoint that can be controlled through both the control file and the ftrace interface. I.e. writing "... +T" to the control file enables the trace message, but not the debug print. 2/ move the debug print behind the tracepoint static key so that we don't incur the overhead of branching on the flags in the dynamic_debug descriptor. 3/ Some macro magic to make the dynamic debug descriptor inherit the final callsite information like you mention above There was a patch a while back [1] that converted dynamic debug to use jump labels (later reverted), but this approach would be a bit different. Share the tracepoint jump label in a combined interface. -- Dan [1]: https://lkml.org/lkml/2010/6/9/353 -- 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