Message ID | 20231220173837.3326983-1-aleksandr.loktionov@intel.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [iwl-next,v2] i40e: add trace events related to SFP module IOCTLs | expand |
On Wed, Dec 20, 2023 at 06:38:37PM +0100, Aleksandr Loktionov wrote: > Add trace events related to SFP module IOCTLs for troubleshooting. > > Example: > echo "i40e_*" >/sys/kernel/tracing/set_ftrace_filter > echo "i40e_ioctl*" >/sys/kernel/tracing/events/i40e/filter > echo 1 >/sys/kernel/tracing/tracing_on > echo 1 >/sys/kernel/tracing/events/i40e/enable > ... > cat /sys/kernel/tracing/trace > > Riewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> > Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> > --- > v1->v2 applied to proper git branch > --- > drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 5 +++++ > drivers/net/ethernet/intel/i40e/i40e_trace.h | 18 ++++++++++++++++++ > 2 files changed, 23 insertions(+) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c > index c841779..bdf2b6b 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c > @@ -1074,6 +1074,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 Hi Aleksandr, I think that i40e_trace.h needs to be included in i40e_ethtool.c as part of this patch. .../i40e_ethtool.c: In function ‘i40e_get_link_ksettings’: .../i40e_ethtool.c:1077:9: error: implicit declaration of function ‘i40e_trace’ [-Werror=implicit-function-declaration] 1077 | i40e_trace(ioctl_get_link_ksettings, pf, hw_link_info->link_info); | ^~~~~~~~~~ ... Flagged by gcc-13 W=1 build ...
> -----Original Message----- > From: Simon Horman <horms@kernel.org> > Sent: Thursday, December 21, 2023 4:35 PM > To: Loktionov, Aleksandr <aleksandr.loktionov@intel.com> > Cc: intel-wired-lan@lists.osuosl.org; Nguyen, Anthony L > <anthony.l.nguyen@intel.com>; netdev@vger.kernel.org; Kitszel, > Przemyslaw <przemyslaw.kitszel@intel.com> > Subject: Re: [PATCH iwl-next v2] i40e: add trace events related to > SFP module IOCTLs > > On Wed, Dec 20, 2023 at 06:38:37PM +0100, Aleksandr Loktionov > wrote: > > Add trace events related to SFP module IOCTLs for > troubleshooting. > > > > Example: > > echo "i40e_*" >/sys/kernel/tracing/set_ftrace_filter > > echo "i40e_ioctl*" > >/sys/kernel/tracing/events/i40e/filter > > echo 1 >/sys/kernel/tracing/tracing_on > > echo 1 >/sys/kernel/tracing/events/i40e/enable > > ... > > cat /sys/kernel/tracing/trace > > > > Riewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> > > Signed-off-by: Aleksandr Loktionov > <aleksandr.loktionov@intel.com> > > --- > > v1->v2 applied to proper git branch > > --- > > drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 5 +++++ > > drivers/net/ethernet/intel/i40e/i40e_trace.h | 18 > ++++++++++++++++++ > > 2 files changed, 23 insertions(+) > > > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c > > b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c > > index c841779..bdf2b6b 100644 > > --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c > > +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c > > @@ -1074,6 +1074,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 > > Hi Aleksandr, > > I think that i40e_trace.h needs to be included in i40e_ethtool.c as > part of this patch. > This patch is just needs to be applied after ' i40e: add tracepoints for nvmupdate troubleshooting' patch. > .../i40e_ethtool.c: In function ‘i40e_get_link_ksettings’: > .../i40e_ethtool.c:1077:9: error: implicit declaration of function > ‘i40e_trace’ [-Werror=implicit-function-declaration] > 1077 | i40e_trace(ioctl_get_link_ksettings, pf, > hw_link_info->link_info); > | ^~~~~~~~~~ > > ... > > Flagged by gcc-13 W=1 build > > ... > > -- > pw-bot: changes-requested
Hi Aleksandr, kernel test robot noticed the following build errors: [auto build test ERROR on tnguy-next-queue/dev-queue] url: https://github.com/intel-lab-lkp/linux/commits/Aleksandr-Loktionov/i40e-add-trace-events-related-to-SFP-module-IOCTLs/20231222-165333 base: https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue patch link: https://lore.kernel.org/r/20231220173837.3326983-1-aleksandr.loktionov%40intel.com patch subject: [PATCH iwl-next v2] i40e: add trace events related to SFP module IOCTLs config: x86_64-kexec (https://download.01.org/0day-ci/archive/20231223/202312230700.6El79he7-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231223/202312230700.6El79he7-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202312230700.6El79he7-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/trace/define_trace.h:102, from drivers/net/ethernet/intel/i40e/i40e_trace.h:276, from drivers/net/ethernet/intel/i40e/i40e_main.c:25: drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'ftrace_test_probe_i40e_ioctl_get_module_info': include/trace/trace_events.h:416:42: error: 'trace_event_raw_event_i40e_ioctl_template' undeclared (first use in this function); did you mean 'trace_event_raw_event_i40e_tx_template'? 416 | check_trace_callback_type_##call(trace_event_raw_event_##template); \ | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ include/trace/trace_events.h:416:42: note: each undeclared identifier is reported only once for each function it appears in 416 | check_trace_callback_type_##call(trace_event_raw_event_##template); \ | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'ftrace_test_probe_i40e_ioctl_get_module_eeprom': include/trace/trace_events.h:416:42: error: 'trace_event_raw_event_i40e_ioctl_template' undeclared (first use in this function); did you mean 'trace_event_raw_event_i40e_tx_template'? 416 | check_trace_callback_type_##call(trace_event_raw_event_##template); \ | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:211:1: note: in expansion of macro 'DEFINE_EVENT' 211 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'ftrace_test_probe_i40e_ioctl_get_link_ksettings': include/trace/trace_events.h:416:42: error: 'trace_event_raw_event_i40e_ioctl_template' undeclared (first use in this function); did you mean 'trace_event_raw_event_i40e_tx_template'? 416 | check_trace_callback_type_##call(trace_event_raw_event_##template); \ | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:217:1: note: in expansion of macro 'DEFINE_EVENT' 217 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: At top level: include/trace/trace_events.h:441:36: error: 'event_class_i40e_ioctl_template' undeclared here (not in a function); did you mean 'event_class_i40e_xmit_template'? 441 | .class = &event_class_##template, \ | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ include/trace/trace_events.h:445:36: error: 'trace_event_type_funcs_i40e_ioctl_template' undeclared here (not in a function); did you mean 'trace_event_type_funcs_i40e_xmit_template'? 445 | .event.funcs = &trace_event_type_funcs_##template, \ | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ include/trace/trace_events.h:446:35: error: 'print_fmt_i40e_ioctl_template' undeclared here (not in a function); did you mean 'print_fmt_i40e_tx_template'? 446 | .print_fmt = print_fmt_##template, \ | ^~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ In file included from include/trace/define_trace.h:103: drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'perf_test_probe_i40e_ioctl_get_module_info': include/trace/perf.h:67:42: error: 'perf_trace_i40e_ioctl_template' undeclared (first use in this function); did you mean 'perf_trace_i40e_xmit_template'? 67 | check_trace_callback_type_##call(perf_trace_##template); \ | ^~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'perf_test_probe_i40e_ioctl_get_module_eeprom': include/trace/perf.h:67:42: error: 'perf_trace_i40e_ioctl_template' undeclared (first use in this function); did you mean 'perf_trace_i40e_xmit_template'? 67 | check_trace_callback_type_##call(perf_trace_##template); \ | ^~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:211:1: note: in expansion of macro 'DEFINE_EVENT' 211 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'perf_test_probe_i40e_ioctl_get_link_ksettings': include/trace/perf.h:67:42: error: 'perf_trace_i40e_ioctl_template' undeclared (first use in this function); did you mean 'perf_trace_i40e_xmit_template'? 67 | check_trace_callback_type_##call(perf_trace_##template); \ | ^~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:217:1: note: in expansion of macro 'DEFINE_EVENT' 217 | DEFINE_EVENT( | ^~~~~~~~~~~~ In file included from include/trace/define_trace.h:104: drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'bpf_test_probe_i40e_ioctl_get_module_info': >> include/trace/bpf_probe.h:65:42: error: '__bpf_trace_i40e_ioctl_template' undeclared (first use in this function); did you mean '__bpf_trace_i40e_tx_template'? 65 | check_trace_callback_type_##call(__bpf_trace_##template); \ | ^~~~~~~~~~~~ include/trace/bpf_probe.h:101:9: note: in expansion of macro '__DEFINE_EVENT' 101 | __DEFINE_EVENT(template, call, PARAMS(proto), PARAMS(args), 0) | ^~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: At top level: >> include/trace/bpf_probe.h:75:35: error: '__bpf_trace_i40e_ioctl_template' undeclared here (not in a function); did you mean '__bpf_trace_i40e_tx_template'? 75 | .bpf_func = __bpf_trace_##template, \ | ^~~~~~~~~~~~ include/trace/bpf_probe.h:101:9: note: in expansion of macro '__DEFINE_EVENT' 101 | __DEFINE_EVENT(template, call, PARAMS(proto), PARAMS(args), 0) | ^~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ vim +65 include/trace/bpf_probe.h c4f6699dfcb855 Alexei Starovoitov 2018-03-28 52 6939f4ef16d48f Qais Yousef 2021-01-19 53 #undef DECLARE_EVENT_CLASS 6939f4ef16d48f Qais Yousef 2021-01-19 54 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 6939f4ef16d48f Qais Yousef 2021-01-19 55 __BPF_DECLARE_TRACE(call, PARAMS(proto), PARAMS(args)) 6939f4ef16d48f Qais Yousef 2021-01-19 56 c4f6699dfcb855 Alexei Starovoitov 2018-03-28 57 /* c4f6699dfcb855 Alexei Starovoitov 2018-03-28 58 * This part is compiled out, it is only here as a build time check c4f6699dfcb855 Alexei Starovoitov 2018-03-28 59 * to make sure that if the tracepoint handling changes, the c4f6699dfcb855 Alexei Starovoitov 2018-03-28 60 * bpf probe will fail to compile unless it too is updated. c4f6699dfcb855 Alexei Starovoitov 2018-03-28 61 */ 9df1c28bb75217 Matt Mullins 2019-04-26 62 #define __DEFINE_EVENT(template, call, proto, args, size) \ c4f6699dfcb855 Alexei Starovoitov 2018-03-28 63 static inline void bpf_test_probe_##call(void) \ c4f6699dfcb855 Alexei Starovoitov 2018-03-28 64 { \ c4f6699dfcb855 Alexei Starovoitov 2018-03-28 @65 check_trace_callback_type_##call(__bpf_trace_##template); \ c4f6699dfcb855 Alexei Starovoitov 2018-03-28 66 } \ e8c423fb31fa8b Alexei Starovoitov 2019-10-15 67 typedef void (*btf_trace_##call)(void *__data, proto); \ 441420a1f0b303 Andrii Nakryiko 2020-03-01 68 static union { \ 441420a1f0b303 Andrii Nakryiko 2020-03-01 69 struct bpf_raw_event_map event; \ 441420a1f0b303 Andrii Nakryiko 2020-03-01 70 btf_trace_##call handler; \ 441420a1f0b303 Andrii Nakryiko 2020-03-01 71 } __bpf_trace_tp_map_##call __used \ 33def8498fdde1 Joe Perches 2020-10-21 72 __section("__bpf_raw_tp_map") = { \ 441420a1f0b303 Andrii Nakryiko 2020-03-01 73 .event = { \ c4f6699dfcb855 Alexei Starovoitov 2018-03-28 74 .tp = &__tracepoint_##call, \ 441420a1f0b303 Andrii Nakryiko 2020-03-01 @75 .bpf_func = __bpf_trace_##template, \ c4f6699dfcb855 Alexei Starovoitov 2018-03-28 76 .num_args = COUNT_ARGS(args), \ 9df1c28bb75217 Matt Mullins 2019-04-26 77 .writable_size = size, \ 441420a1f0b303 Andrii Nakryiko 2020-03-01 78 }, \ c4f6699dfcb855 Alexei Starovoitov 2018-03-28 79 }; c4f6699dfcb855 Alexei Starovoitov 2018-03-28 80 9df1c28bb75217 Matt Mullins 2019-04-26 81 #define FIRST(x, ...) x 9df1c28bb75217 Matt Mullins 2019-04-26 82 65223741ae1b75 Hou Tao 2021-10-04 83 #define __CHECK_WRITABLE_BUF_SIZE(call, proto, args, size) \ 9df1c28bb75217 Matt Mullins 2019-04-26 84 static inline void bpf_test_buffer_##call(void) \ 9df1c28bb75217 Matt Mullins 2019-04-26 85 { \ 9df1c28bb75217 Matt Mullins 2019-04-26 86 /* BUILD_BUG_ON() is ignored if the code is completely eliminated, but \ 9df1c28bb75217 Matt Mullins 2019-04-26 87 * BUILD_BUG_ON_ZERO() uses a different mechanism that is not \ 9df1c28bb75217 Matt Mullins 2019-04-26 88 * dead-code-eliminated. \ 9df1c28bb75217 Matt Mullins 2019-04-26 89 */ \ 9df1c28bb75217 Matt Mullins 2019-04-26 90 FIRST(proto); \ 9df1c28bb75217 Matt Mullins 2019-04-26 91 (void)BUILD_BUG_ON_ZERO(size != sizeof(*FIRST(args))); \ 65223741ae1b75 Hou Tao 2021-10-04 92 } 65223741ae1b75 Hou Tao 2021-10-04 93 65223741ae1b75 Hou Tao 2021-10-04 94 #undef DEFINE_EVENT_WRITABLE 65223741ae1b75 Hou Tao 2021-10-04 95 #define DEFINE_EVENT_WRITABLE(template, call, proto, args, size) \ 65223741ae1b75 Hou Tao 2021-10-04 96 __CHECK_WRITABLE_BUF_SIZE(call, PARAMS(proto), PARAMS(args), size) \ 9df1c28bb75217 Matt Mullins 2019-04-26 97 __DEFINE_EVENT(template, call, PARAMS(proto), PARAMS(args), size) 9df1c28bb75217 Matt Mullins 2019-04-26 98 9df1c28bb75217 Matt Mullins 2019-04-26 99 #undef DEFINE_EVENT 9df1c28bb75217 Matt Mullins 2019-04-26 100 #define DEFINE_EVENT(template, call, proto, args) \ 9df1c28bb75217 Matt Mullins 2019-04-26 @101 __DEFINE_EVENT(template, call, PARAMS(proto), PARAMS(args), 0) c4f6699dfcb855 Alexei Starovoitov 2018-03-28 102
Hi Aleksandr, kernel test robot noticed the following build errors: [auto build test ERROR on tnguy-next-queue/dev-queue] url: https://github.com/intel-lab-lkp/linux/commits/Aleksandr-Loktionov/i40e-add-trace-events-related-to-SFP-module-IOCTLs/20231222-165333 base: https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue patch link: https://lore.kernel.org/r/20231220173837.3326983-1-aleksandr.loktionov%40intel.com patch subject: [PATCH iwl-next v2] i40e: add trace events related to SFP module IOCTLs config: x86_64-randconfig-161-20231222 (https://download.01.org/0day-ci/archive/20231223/202312231758.zG1LthuL-lkp@intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231223/202312231758.zG1LthuL-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202312231758.zG1LthuL-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/trace/define_trace.h:102, from drivers/net/ethernet/intel/i40e/i40e_trace.h:276, from drivers/net/ethernet/intel/i40e/i40e_main.c:25: drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'ftrace_test_probe_i40e_ioctl_get_module_info': >> include/trace/trace_events.h:416:35: error: 'trace_event_raw_event_i40e_ioctl_template' undeclared (first use in this function); did you mean 'trace_event_raw_event_i40e_tx_template'? 416 | check_trace_callback_type_##call(trace_event_raw_event_##template); \ | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ include/trace/trace_events.h:416:35: note: each undeclared identifier is reported only once for each function it appears in 416 | check_trace_callback_type_##call(trace_event_raw_event_##template); \ | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'ftrace_test_probe_i40e_ioctl_get_module_eeprom': >> include/trace/trace_events.h:416:35: error: 'trace_event_raw_event_i40e_ioctl_template' undeclared (first use in this function); did you mean 'trace_event_raw_event_i40e_tx_template'? 416 | check_trace_callback_type_##call(trace_event_raw_event_##template); \ | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:211:1: note: in expansion of macro 'DEFINE_EVENT' 211 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'ftrace_test_probe_i40e_ioctl_get_link_ksettings': >> include/trace/trace_events.h:416:35: error: 'trace_event_raw_event_i40e_ioctl_template' undeclared (first use in this function); did you mean 'trace_event_raw_event_i40e_tx_template'? 416 | check_trace_callback_type_##call(trace_event_raw_event_##template); \ | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:217:1: note: in expansion of macro 'DEFINE_EVENT' 217 | DEFINE_EVENT( | ^~~~~~~~~~~~ In file included from include/trace/define_trace.h:102, from drivers/net/ethernet/intel/i40e/i40e_trace.h:276, from drivers/net/ethernet/intel/i40e/i40e_main.c:25: drivers/net/ethernet/intel/i40e/./i40e_trace.h: At top level: >> include/trace/trace_events.h:441:14: error: 'event_class_i40e_ioctl_template' undeclared here (not in a function); did you mean 'event_class_i40e_xmit_template'? 441 | .class = &event_class_##template, \ | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ >> include/trace/trace_events.h:445:19: error: 'trace_event_type_funcs_i40e_ioctl_template' undeclared here (not in a function); did you mean 'trace_event_type_funcs_i40e_xmit_template'? 445 | .event.funcs = &trace_event_type_funcs_##template, \ | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ >> include/trace/trace_events.h:446:16: error: 'print_fmt_i40e_ioctl_template' undeclared here (not in a function); did you mean 'print_fmt_i40e_tx_template'? 446 | .print_fmt = print_fmt_##template, \ | ^~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ In file included from include/trace/define_trace.h:103, from drivers/net/ethernet/intel/i40e/i40e_trace.h:276, from drivers/net/ethernet/intel/i40e/i40e_main.c:25: drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'perf_test_probe_i40e_ioctl_get_module_info': >> include/trace/perf.h:67:35: error: 'perf_trace_i40e_ioctl_template' undeclared (first use in this function); did you mean 'perf_trace_i40e_xmit_template'? 67 | check_trace_callback_type_##call(perf_trace_##template); \ | ^~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:205:1: note: in expansion of macro 'DEFINE_EVENT' 205 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'perf_test_probe_i40e_ioctl_get_module_eeprom': >> include/trace/perf.h:67:35: error: 'perf_trace_i40e_ioctl_template' undeclared (first use in this function); did you mean 'perf_trace_i40e_xmit_template'? 67 | check_trace_callback_type_##call(perf_trace_##template); \ | ^~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:211:1: note: in expansion of macro 'DEFINE_EVENT' 211 | DEFINE_EVENT( | ^~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h: In function 'perf_test_probe_i40e_ioctl_get_link_ksettings': >> include/trace/perf.h:67:35: error: 'perf_trace_i40e_ioctl_template' undeclared (first use in this function); did you mean 'perf_trace_i40e_xmit_template'? 67 | check_trace_callback_type_##call(perf_trace_##template); \ | ^~~~~~~~~~~ drivers/net/ethernet/intel/i40e/./i40e_trace.h:217:1: note: in expansion of macro 'DEFINE_EVENT' 217 | DEFINE_EVENT( | ^~~~~~~~~~~~ -- drivers/net/ethernet/intel/i40e/i40e_ethtool.c: In function 'i40e_get_link_ksettings': >> drivers/net/ethernet/intel/i40e/i40e_ethtool.c:1077:2: error: implicit declaration of function 'i40e_trace' [-Werror=implicit-function-declaration] 1077 | i40e_trace(ioctl_get_link_ksettings, pf, hw_link_info->link_info); | ^~~~~~~~~~ >> drivers/net/ethernet/intel/i40e/i40e_ethtool.c:1077:13: error: 'ioctl_get_link_ksettings' undeclared (first use in this function); did you mean 'i40e_get_link_ksettings'? 1077 | i40e_trace(ioctl_get_link_ksettings, pf, hw_link_info->link_info); | ^~~~~~~~~~~~~~~~~~~~~~~~ | i40e_get_link_ksettings drivers/net/ethernet/intel/i40e/i40e_ethtool.c:1077:13: note: each undeclared identifier is reported only once for each function it appears in drivers/net/ethernet/intel/i40e/i40e_ethtool.c: In function 'i40e_get_module_info': >> drivers/net/ethernet/intel/i40e/i40e_ethtool.c:5589:14: error: 'ioctl_get_module_info' undeclared (first use in this function); did you mean 'i40e_get_module_info'? 5589 | i40e_trace(ioctl_get_module_info, pf, ~0UL); | ^~~~~~~~~~~~~~~~~~~~~ | i40e_get_module_info drivers/net/ethernet/intel/i40e/i40e_ethtool.c: In function 'i40e_get_module_eeprom': >> drivers/net/ethernet/intel/i40e/i40e_ethtool.c:5617:13: error: 'ioctl_get_module_eeprom' undeclared (first use in this function); did you mean 'i40e_get_module_eeprom'? 5617 | i40e_trace(ioctl_get_module_eeprom, pf, ee ? ee->len : 0U); | ^~~~~~~~~~~~~~~~~~~~~~~ | i40e_get_module_eeprom cc1: some warnings being treated as errors vim +/i40e_trace +1077 drivers/net/ethernet/intel/i40e/i40e_ethtool.c 1057 1058 /** 1059 * i40e_get_link_ksettings - Get Link Speed and Duplex settings 1060 * @netdev: network interface device structure 1061 * @ks: ethtool ksettings 1062 * 1063 * Reports speed/duplex settings based on media_type 1064 **/ 1065 static int i40e_get_link_ksettings(struct net_device *netdev, 1066 struct ethtool_link_ksettings *ks) 1067 { 1068 struct i40e_netdev_priv *np = netdev_priv(netdev); 1069 struct i40e_pf *pf = np->vsi->back; 1070 struct i40e_hw *hw = &pf->hw; 1071 struct i40e_link_status *hw_link_info = &hw->phy.link_info; 1072 bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP; 1073 1074 ethtool_link_ksettings_zero_link_mode(ks, supported); 1075 ethtool_link_ksettings_zero_link_mode(ks, advertising); 1076 > 1077 i40e_trace(ioctl_get_link_ksettings, pf, hw_link_info->link_info); 1078 if (link_up) 1079 i40e_get_settings_link_up(hw, ks, netdev, pf); 1080 else 1081 i40e_get_settings_link_down(hw, ks, pf); 1082 1083 /* Now set the settings that don't rely on link being up/down */ 1084 /* Set autoneg settings */ 1085 ks->base.autoneg = ((hw_link_info->an_info & I40E_AQ_AN_COMPLETED) ? 1086 AUTONEG_ENABLE : AUTONEG_DISABLE); 1087 1088 /* Set media type settings */ 1089 switch (hw->phy.media_type) { 1090 case I40E_MEDIA_TYPE_BACKPLANE: 1091 ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1092 ethtool_link_ksettings_add_link_mode(ks, supported, Backplane); 1093 ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1094 ethtool_link_ksettings_add_link_mode(ks, advertising, 1095 Backplane); 1096 ks->base.port = PORT_NONE; 1097 break; 1098 case I40E_MEDIA_TYPE_BASET: 1099 ethtool_link_ksettings_add_link_mode(ks, supported, TP); 1100 ethtool_link_ksettings_add_link_mode(ks, advertising, TP); 1101 ks->base.port = PORT_TP; 1102 break; 1103 case I40E_MEDIA_TYPE_DA: 1104 case I40E_MEDIA_TYPE_CX4: 1105 ethtool_link_ksettings_add_link_mode(ks, supported, FIBRE); 1106 ethtool_link_ksettings_add_link_mode(ks, advertising, FIBRE); 1107 ks->base.port = PORT_DA; 1108 break; 1109 case I40E_MEDIA_TYPE_FIBER: 1110 ethtool_link_ksettings_add_link_mode(ks, supported, FIBRE); 1111 ethtool_link_ksettings_add_link_mode(ks, advertising, FIBRE); 1112 ks->base.port = PORT_FIBRE; 1113 break; 1114 case I40E_MEDIA_TYPE_UNKNOWN: 1115 default: 1116 ks->base.port = PORT_OTHER; 1117 break; 1118 } 1119 1120 /* Set flow control settings */ 1121 ethtool_link_ksettings_add_link_mode(ks, supported, Pause); 1122 ethtool_link_ksettings_add_link_mode(ks, supported, Asym_Pause); 1123 1124 switch (hw->fc.requested_mode) { 1125 case I40E_FC_FULL: 1126 ethtool_link_ksettings_add_link_mode(ks, advertising, Pause); 1127 break; 1128 case I40E_FC_TX_PAUSE: 1129 ethtool_link_ksettings_add_link_mode(ks, advertising, 1130 Asym_Pause); 1131 break; 1132 case I40E_FC_RX_PAUSE: 1133 ethtool_link_ksettings_add_link_mode(ks, advertising, Pause); 1134 ethtool_link_ksettings_add_link_mode(ks, advertising, 1135 Asym_Pause); 1136 break; 1137 default: 1138 ethtool_link_ksettings_del_link_mode(ks, advertising, Pause); 1139 ethtool_link_ksettings_del_link_mode(ks, advertising, 1140 Asym_Pause); 1141 break; 1142 } 1143 1144 return 0; 1145 } 1146
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index c841779..bdf2b6b 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -1074,6 +1074,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 @@ -5585,9 +5586,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; } @@ -5610,6 +5614,7 @@ static int i40e_get_module_eeprom(struct net_device *netdev, int status; int i; + i40e_trace(ioctl_get_module_eeprom, pf, ee ? ee->len : 0U); if (!ee || !ee->len || !data) return -EINVAL; diff --git a/drivers/net/ethernet/intel/i40e/i40e_trace.h b/drivers/net/ethernet/intel/i40e/i40e_trace.h index 33b4e30..b9be2f4 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_trace.h +++ b/drivers/net/ethernet/intel/i40e/i40e_trace.h @@ -202,6 +202,24 @@ DEFINE_EVENT( TP_ARGS(ring, desc, xdp)); +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_xmit_template,
Add trace events related to SFP module IOCTLs for troubleshooting. Example: echo "i40e_*" >/sys/kernel/tracing/set_ftrace_filter echo "i40e_ioctl*" >/sys/kernel/tracing/events/i40e/filter echo 1 >/sys/kernel/tracing/tracing_on echo 1 >/sys/kernel/tracing/events/i40e/enable ... cat /sys/kernel/tracing/trace Riewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> --- v1->v2 applied to proper git branch --- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 5 +++++ drivers/net/ethernet/intel/i40e/i40e_trace.h | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+)