diff mbox series

[iwl-next] i40e: add trace events related to SFP module IOCTLs

Message ID 20231214141012.224894-1-aleksandr.loktionov@intel.com (mailing list archive)
State Superseded
Headers show
Series [iwl-next] i40e: add trace events related to SFP module IOCTLs | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Aleksandr Loktionov Dec. 14, 2023, 2:10 p.m. UTC
Add trace events related to SFP module IOCTLs for troubleshooting.

Riewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 src/CORE/i40e_ethtool.c |  5 +++++
 src/CORE/i40e_trace.h   | 18 ++++++++++++++++++
 2 files changed, 23 insertions(+)

Comments

Paul Menzel Dec. 14, 2023, 2:20 p.m. UTC | #1
Dear Aleksandr,


Thank you for your patch.


Am 14.12.23 um 15:10 schrieb Aleksandr Loktionov:
> Add trace events related to SFP module IOCTLs for troubleshooting.

Maybe list the three events? Maybe even a usage example.

> Riewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

Reviewed

> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>   src/CORE/i40e_ethtool.c |  5 +++++
>   src/CORE/i40e_trace.h   | 18 ++++++++++++++++++
>   2 files changed, 23 insertions(+)
> 
> diff --git a/src/CORE/i40e_ethtool.c b/src/CORE/i40e_ethtool.c
> index 0838566..e9d9d4b 100644
> --- a/src/CORE/i40e_ethtool.c
> +++ b/src/CORE/i40e_ethtool.c
> @@ -1057,6 +1057,7 @@ static int i40e_get_link_ksettings(struct net_device *netdev,
>   	ethtool_link_ksettings_zero_link_mode(ks, supported);
>   	ethtool_link_ksettings_zero_link_mode(ks, advertising);
>   
> +	i40e_trace(ioctl_get_link_ksettings, pf, hw_link_info->link_info);
>   	if (link_up)
>   		i40e_get_settings_link_up(hw, ks, netdev, pf);
>   	else
> @@ -7219,9 +7220,12 @@ static int i40e_get_module_info(struct net_device *netdev,
>   		modinfo->eeprom_len = I40E_MODULE_QSFP_MAX_LEN;
>   		break;
>   	default:
> +		i40e_trace(ioctl_get_module_info, pf, ~0UL);
>   		netdev_dbg(vsi->netdev, "SFP module type unrecognized or no SFP connector used.\n");

Is it useful, if there is a debug print already?


Kind regards,

Paul


>   		return -EOPNOTSUPP;
>   	}
> +	i40e_trace(ioctl_get_module_info, pf, (((u64)modinfo->type) << 32) |
> +		   modinfo->eeprom_len);
>   	return 0;
>   }
>   
> @@ -7244,6 +7248,7 @@ static int i40e_get_module_eeprom(struct net_device *netdev,
>   	u32 value = 0;
>   	int i;
>   
> +	i40e_trace(ioctl_get_module_eeprom, pf, ee ? ee->len : 0U);
>   	if (!ee || !ee->len || !data)
>   		return -EINVAL;
>   
> diff --git a/src/CORE/i40e_trace.h b/src/CORE/i40e_trace.h
> index cac0f7c..f54fc36 100644
> --- a/src/CORE/i40e_trace.h
> +++ b/src/CORE/i40e_trace.h
> @@ -428,6 +428,24 @@ DEFINE_EVENT(
>   
>   	TP_ARGS(pf, val));
>   
> +DEFINE_EVENT(
> +	i40e_ioctl_template, i40e_ioctl_get_module_info,
> +	TP_PROTO(struct i40e_pf *pf, u64 val),
> +
> +	TP_ARGS(pf, val));
> +
> +DEFINE_EVENT(
> +	i40e_ioctl_template, i40e_ioctl_get_module_eeprom,
> +	TP_PROTO(struct i40e_pf *pf, u64 val),
> +
> +	TP_ARGS(pf, val));
> +
> +DEFINE_EVENT(
> +	i40e_ioctl_template, i40e_ioctl_get_link_ksettings,
> +	TP_PROTO(struct i40e_pf *pf, u64 val),
> +
> +	TP_ARGS(pf, val));
> +
>   DECLARE_EVENT_CLASS(
>   	i40e_nvmupd_template,
Aleksandr Loktionov Dec. 14, 2023, 5:05 p.m. UTC | #2
> -----Original Message-----
> From: Paul Menzel <pmenzel@molgen.mpg.de>
> Sent: Thursday, December 14, 2023 3:20 PM
> To: Loktionov, Aleksandr <aleksandr.loktionov@intel.com>
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>
> Subject: Re: [Intel-wired-lan] [PATCH iwl-next] i40e: add trace
> events related to SFP module IOCTLs
> 
> Dear Aleksandr,
> 
> 
> Thank you for your patch.
> 
> 
> Am 14.12.23 um 15:10 schrieb Aleksandr Loktionov:
> > Add trace events related to SFP module IOCTLs for
> troubleshooting.
> 
> Maybe list the three events? Maybe even a usage example.
There is nothing especial about start to use new events, they start to be traced if you trace ioctls.


> 
> > Riewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> 
> Reviewed
> 
> > Signed-off-by: Aleksandr Loktionov
> <aleksandr.loktionov@intel.com>
> > ---
> >   src/CORE/i40e_ethtool.c |  5 +++++
> >   src/CORE/i40e_trace.h   | 18 ++++++++++++++++++
> >   2 files changed, 23 insertions(+)
> >
> > diff --git a/src/CORE/i40e_ethtool.c b/src/CORE/i40e_ethtool.c
> index
> > 0838566..e9d9d4b 100644
> > --- a/src/CORE/i40e_ethtool.c
> > +++ b/src/CORE/i40e_ethtool.c
> > @@ -1057,6 +1057,7 @@ static int i40e_get_link_ksettings(struct
> net_device *netdev,
> >   	ethtool_link_ksettings_zero_link_mode(ks, supported);
> >   	ethtool_link_ksettings_zero_link_mode(ks, advertising);
> >
> > +	i40e_trace(ioctl_get_link_ksettings, pf, hw_link_info-
> >link_info);
> >   	if (link_up)
> >   		i40e_get_settings_link_up(hw, ks, netdev, pf);
> >   	else
> > @@ -7219,9 +7220,12 @@ static int i40e_get_module_info(struct
> net_device *netdev,
> >   		modinfo->eeprom_len = I40E_MODULE_QSFP_MAX_LEN;
> >   		break;
> >   	default:
> > +		i40e_trace(ioctl_get_module_info, pf, ~0UL);
> >   		netdev_dbg(vsi->netdev, "SFP module type unrecognized
> or no SFP
> > connector used.\n");
> 
> Is it useful, if there is a debug print already?
In fact, very useful. On some production systems debug printk is disabled. The point to use trace is not to slowdown production as all debug printk-s start to do and start/stop tracing at any moment.

> 
> Kind regards,
> 
> Paul
> 
> 
> >   		return -EOPNOTSUPP;
> >   	}
> > +	i40e_trace(ioctl_get_module_info, pf, (((u64)modinfo->type)
> << 32) |
> > +		   modinfo->eeprom_len);
> >   	return 0;
> >   }
> >
> > @@ -7244,6 +7248,7 @@ static int i40e_get_module_eeprom(struct
> net_device *netdev,
> >   	u32 value = 0;
> >   	int i;
> >
> > +	i40e_trace(ioctl_get_module_eeprom, pf, ee ? ee->len : 0U);
> >   	if (!ee || !ee->len || !data)
> >   		return -EINVAL;
> >
> > diff --git a/src/CORE/i40e_trace.h b/src/CORE/i40e_trace.h index
> > cac0f7c..f54fc36 100644
> > --- a/src/CORE/i40e_trace.h
> > +++ b/src/CORE/i40e_trace.h
> > @@ -428,6 +428,24 @@ DEFINE_EVENT(
> >
> >   	TP_ARGS(pf, val));
> >
> > +DEFINE_EVENT(
> > +	i40e_ioctl_template, i40e_ioctl_get_module_info,
> > +	TP_PROTO(struct i40e_pf *pf, u64 val),
> > +
> > +	TP_ARGS(pf, val));
> > +
> > +DEFINE_EVENT(
> > +	i40e_ioctl_template, i40e_ioctl_get_module_eeprom,
> > +	TP_PROTO(struct i40e_pf *pf, u64 val),
> > +
> > +	TP_ARGS(pf, val));
> > +
> > +DEFINE_EVENT(
> > +	i40e_ioctl_template, i40e_ioctl_get_link_ksettings,
> > +	TP_PROTO(struct i40e_pf *pf, u64 val),
> > +
> > +	TP_ARGS(pf, val));
> > +
> >   DECLARE_EVENT_CLASS(
> >   	i40e_nvmupd_template,
Tony Nguyen Dec. 18, 2023, 11:08 p.m. UTC | #3
On 12/14/2023 6:10 AM, Aleksandr Loktionov wrote:
> Add trace events related to SFP module IOCTLs for troubleshooting.
> 
> Riewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>   src/CORE/i40e_ethtool.c |  5 +++++
>   src/CORE/i40e_trace.h   | 18 ++++++++++++++++++
>   2 files changed, 23 insertions(+)

This doesn't apply.

Thanks,
Tony
diff mbox series

Patch

diff --git a/src/CORE/i40e_ethtool.c b/src/CORE/i40e_ethtool.c
index 0838566..e9d9d4b 100644
--- a/src/CORE/i40e_ethtool.c
+++ b/src/CORE/i40e_ethtool.c
@@ -1057,6 +1057,7 @@  static int i40e_get_link_ksettings(struct net_device *netdev,
 	ethtool_link_ksettings_zero_link_mode(ks, supported);
 	ethtool_link_ksettings_zero_link_mode(ks, advertising);
 
+	i40e_trace(ioctl_get_link_ksettings, pf, hw_link_info->link_info);
 	if (link_up)
 		i40e_get_settings_link_up(hw, ks, netdev, pf);
 	else
@@ -7219,9 +7220,12 @@  static int i40e_get_module_info(struct net_device *netdev,
 		modinfo->eeprom_len = I40E_MODULE_QSFP_MAX_LEN;
 		break;
 	default:
+		i40e_trace(ioctl_get_module_info, pf, ~0UL);
 		netdev_dbg(vsi->netdev, "SFP module type unrecognized or no SFP connector used.\n");
 		return -EOPNOTSUPP;
 	}
+	i40e_trace(ioctl_get_module_info, pf, (((u64)modinfo->type) << 32) |
+		   modinfo->eeprom_len);
 	return 0;
 }
 
@@ -7244,6 +7248,7 @@  static int i40e_get_module_eeprom(struct net_device *netdev,
 	u32 value = 0;
 	int i;
 
+	i40e_trace(ioctl_get_module_eeprom, pf, ee ? ee->len : 0U);
 	if (!ee || !ee->len || !data)
 		return -EINVAL;
 
diff --git a/src/CORE/i40e_trace.h b/src/CORE/i40e_trace.h
index cac0f7c..f54fc36 100644
--- a/src/CORE/i40e_trace.h
+++ b/src/CORE/i40e_trace.h
@@ -428,6 +428,24 @@  DEFINE_EVENT(
 
 	TP_ARGS(pf, val));
 
+DEFINE_EVENT(
+	i40e_ioctl_template, i40e_ioctl_get_module_info,
+	TP_PROTO(struct i40e_pf *pf, u64 val),
+
+	TP_ARGS(pf, val));
+
+DEFINE_EVENT(
+	i40e_ioctl_template, i40e_ioctl_get_module_eeprom,
+	TP_PROTO(struct i40e_pf *pf, u64 val),
+
+	TP_ARGS(pf, val));
+
+DEFINE_EVENT(
+	i40e_ioctl_template, i40e_ioctl_get_link_ksettings,
+	TP_PROTO(struct i40e_pf *pf, u64 val),
+
+	TP_ARGS(pf, val));
+
 DECLARE_EVENT_CLASS(
 	i40e_nvmupd_template,