Re: [PATCH 1/2] iwlwifi: fix long debug print
On Fri, 2017-09-01 at 11:15 +0300, Kalle Valo wrote: > Joe Percheswrites: > > On Fri, 2017-09-01 at 08:37 +0300, Luca Coelho wrote: > > > On Thu, 2017-08-31 at 14:57 -0700, Joe Perches wrote: > > > > On Fri, 2017-08-25 at 11:27 +0300, Luca Coelho wrote: > > > > > From: Liad Kaufman > > > > > There is a debug print that sometimes reaches over > > > > > 110 chars, thus generating a warning in those cases. [] > > It might make sense to add a comment to describe these > > trace events coming from TRACE_EVENT(iwlwifi_dbg, > > > > All the IWL_DEBUG_ use this trace message maximum. > > Unfortunately the patch is already commited to wireless-drivers-next so > we can't change the commit log anymore. No worries about the commit. It'd be useful to add a comment to the code.
Re: [PATCH 1/2] iwlwifi: fix long debug print
Joe Percheswrites: > On Fri, 2017-09-01 at 08:37 +0300, Luca Coelho wrote: >> On Thu, 2017-08-31 at 14:57 -0700, Joe Perches wrote: >> > On Fri, 2017-08-25 at 11:27 +0300, Luca Coelho wrote: >> > > From: Liad Kaufman >> > > >> > > There is a debug print that sometimes reaches over >> > > 110 chars, thus generating a warning in those cases. >> > >> > What emits a warning here? >> >> We have a WARN_ON in iwl-devtrace-msg.h: >> >> #define MAX_MSG_LEN 110 > > OK, thanks for the hint. > > The commit message is a bit obscure. > > It might make sense to add a comment to describe these > trace events coming from TRACE_EVENT(iwlwifi_dbg, > > All the IWL_DEBUG_ use this trace message maximum. Unfortunately the patch is already commited to wireless-drivers-next so we can't change the commit log anymore. -- Kalle Valo
Re: [PATCH 1/2] iwlwifi: fix long debug print
On Fri, 2017-09-01 at 08:37 +0300, Luca Coelho wrote: > On Thu, 2017-08-31 at 14:57 -0700, Joe Perches wrote: > > On Fri, 2017-08-25 at 11:27 +0300, Luca Coelho wrote: > > > From: Liad Kaufman> > > > > > There is a debug print that sometimes reaches over > > > 110 chars, thus generating a warning in those cases. > > > > What emits a warning here? > > We have a WARN_ON in iwl-devtrace-msg.h: > > #define MAX_MSG_LEN 110 OK, thanks for the hint. The commit message is a bit obscure. It might make sense to add a comment to describe these trace events coming from TRACE_EVENT(iwlwifi_dbg, All the IWL_DEBUG_ use this trace message maximum.
Re: [PATCH 1/2] iwlwifi: fix long debug print
On Thu, 2017-08-31 at 14:57 -0700, Joe Perches wrote: > On Fri, 2017-08-25 at 11:27 +0300, Luca Coelho wrote: > > From: Liad Kaufman> > > > There is a debug print that sometimes reaches over > > 110 chars, thus generating a warning in those cases. > > What emits a warning here? We have a WARN_ON in iwl-devtrace-msg.h: #define MAX_MSG_LEN 110 DECLARE_EVENT_CLASS(iwlwifi_msg_event, TP_PROTO(struct va_format *vaf), TP_ARGS(vaf), TP_STRUCT__entry( __dynamic_array(char, msg, MAX_MSG_LEN) ), TP_fast_assign( WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), MAX_MSG_LEN, vaf->fmt, *vaf->va) >= MAX_MSG_LEN); ), TP_printk("%s", __get_str(msg)) ); We limit all our tracing messages to 110 bytes. Anything longer than that starts getting annoying to read. In mac80211 we limit it even further, to 100 bytes, so this is not unique to the iwlwifi driver. -- Cheers, Luca.
Re: [PATCH 1/2] iwlwifi: fix long debug print
On Fri, 2017-08-25 at 11:27 +0300, Luca Coelho wrote: > From: Liad Kaufman> > There is a debug print that sometimes reaches over > 110 chars, thus generating a warning in those cases. What emits a warning here?