Re: [PATCH 18/30] notifier: Show function names on notifier routines if DEBUG_NOTIFIERS is set

2022-05-17 Thread Guilherme G. Piccoli
On 10/05/2022 14:29, Steven Rostedt wrote: > [...] > Also, don't sprinkle #ifdef in C code. Instead: > > if (IS_ENABLED(CONFIG_DEBUG_NOTIFIERS)) > pr_info("notifers: regsiter %ps()\n", > n->notifer_call); > > > Or define a print macro at the start of

Re: [PATCH 18/30] notifier: Show function names on notifier routines if DEBUG_NOTIFIERS is set

2022-05-11 Thread Steven Rostedt
On Thu, 28 Apr 2022 09:01:13 +0800 Xiaoming Ni wrote: > > +#ifdef CONFIG_DEBUG_NOTIFIERS > > + { > > + char sym_name[KSYM_NAME_LEN]; > > + > > + pr_info("notifiers: registered %s()\n", > > + notifier_name(n, sym_name)); > > + } > > Duplicate Code. >

Re: [PATCH 18/30] notifier: Show function names on notifier routines if DEBUG_NOTIFIERS is set

2022-04-30 Thread Guilherme G. Piccoli
On 27/04/2022 22:01, Xiaoming Ni wrote: > [...] > Duplicate Code. > > Is it better to use __func__ and %pS? > > pr_info("%s: %pS\n", __func__, n->notifier_call); > > This is a great suggestion Xiaoming, much appreciated! I feel like reinventing the wheel here - with your idea, code was super

[PATCH 18/30] notifier: Show function names on notifier routines if DEBUG_NOTIFIERS is set

2022-04-28 Thread Guilherme G. Piccoli
Currently we have a debug infrastructure in the notifiers file, but it's very simple/limited. This patch extends it by: (a) Showing all registered/unregistered notifiers' callback names; (b) Adding a dynamic debug tuning to allow showing called notifiers' function names. Notice that this should