From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:24:29: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20
Date: Wed, 05 Jan 2022 10:34:43 +0800 [thread overview]
Message-ID: <202201051026.81C1NmK2-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 8487 bytes --]
Hi Vlad,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c9e6606c7fe92b50a02ce51dda82586ebdf99b48
commit: 9724fd5d9c2a0d3686b799ed5ca90cb9378ca4f2 net/mlx5: Bridge, add tracepoints
date: 7 months ago
config: csky-allyesconfig (https://download.01.org/0day-ci/archive/20220105/202201051026.81C1NmK2-lkp(a)intel.com/config)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9724fd5d9c2a0d3686b799ed5ca90cb9378ca4f2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 9724fd5d9c2a0d3686b799ed5ca90cb9378ca4f2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=csky SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/trace/define_trace.h:102,
from drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:113,
from drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:12:
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h: In function 'trace_event_raw_event_mlx5_esw_bridge_fdb_template':
>> drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:24:29: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20 [-Wstringop-truncation]
24 | strncpy(__entry->dev_name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
25 | netdev_name(fdb->dev),
| ~~~~~~~~~~~~~~~~~~~~~~
26 | IFNAMSIZ);
| ~~~~~~~~~
include/trace/trace_events.h:706:11: note: in definition of macro 'DECLARE_EVENT_CLASS'
706 | { assign; } \
| ^~~~~~
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:23:21: note: in expansion of macro 'TP_fast_assign'
23 | TP_fast_assign(
| ^~~~~~~~~~~~~~
In file included from include/trace/define_trace.h:103,
from drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:113,
from drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:12:
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h: In function 'perf_trace_mlx5_esw_bridge_fdb_template':
>> drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:24:29: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20 [-Wstringop-truncation]
24 | strncpy(__entry->dev_name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
25 | netdev_name(fdb->dev),
| ~~~~~~~~~~~~~~~~~~~~~~
26 | IFNAMSIZ);
| ~~~~~~~~~
include/trace/perf.h:66:11: note: in definition of macro 'DECLARE_EVENT_CLASS'
66 | { assign; } \
| ^~~~~~
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:23:21: note: in expansion of macro 'TP_fast_assign'
23 | TP_fast_assign(
| ^~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for LOCKDEP
Depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && (FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86)
Selected by
- PROVE_LOCKING && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
- LOCK_STAT && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
- DEBUG_LOCK_ALLOC && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
vim +/strncpy +24 drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h
12
13 DECLARE_EVENT_CLASS(mlx5_esw_bridge_fdb_template,
14 TP_PROTO(const struct mlx5_esw_bridge_fdb_entry *fdb),
15 TP_ARGS(fdb),
16 TP_STRUCT__entry(
17 __array(char, dev_name, IFNAMSIZ)
18 __array(unsigned char, addr, ETH_ALEN)
19 __field(u16, vid)
20 __field(u16, flags)
21 __field(unsigned int, used)
22 ),
23 TP_fast_assign(
> 24 strncpy(__entry->dev_name,
25 netdev_name(fdb->dev),
26 IFNAMSIZ);
27 memcpy(__entry->addr, fdb->key.addr, ETH_ALEN);
28 __entry->vid = fdb->key.vid;
29 __entry->flags = fdb->flags;
30 __entry->used = jiffies_to_msecs(jiffies - fdb->lastuse)
31 ),
32 TP_printk("net_device=%s addr=%pM vid=%hu flags=%hx used=%u",
33 __entry->dev_name,
34 __entry->addr,
35 __entry->vid,
36 __entry->flags,
37 __entry->used / 1000)
38 );
39
40 DEFINE_EVENT(mlx5_esw_bridge_fdb_template,
41 mlx5_esw_bridge_fdb_entry_init,
42 TP_PROTO(const struct mlx5_esw_bridge_fdb_entry *fdb),
43 TP_ARGS(fdb)
44 );
45 DEFINE_EVENT(mlx5_esw_bridge_fdb_template,
46 mlx5_esw_bridge_fdb_entry_refresh,
47 TP_PROTO(const struct mlx5_esw_bridge_fdb_entry *fdb),
48 TP_ARGS(fdb)
49 );
50 DEFINE_EVENT(mlx5_esw_bridge_fdb_template,
51 mlx5_esw_bridge_fdb_entry_cleanup,
52 TP_PROTO(const struct mlx5_esw_bridge_fdb_entry *fdb),
53 TP_ARGS(fdb)
54 );
55
56 DECLARE_EVENT_CLASS(mlx5_esw_bridge_vlan_template,
57 TP_PROTO(const struct mlx5_esw_bridge_vlan *vlan),
58 TP_ARGS(vlan),
59 TP_STRUCT__entry(
60 __field(u16, vid)
61 __field(u16, flags)
62 ),
63 TP_fast_assign(
64 __entry->vid = vlan->vid;
65 __entry->flags = vlan->flags;
66 ),
67 TP_printk("vid=%hu flags=%hx",
68 __entry->vid,
69 __entry->flags)
70 );
71
72 DEFINE_EVENT(mlx5_esw_bridge_vlan_template,
73 mlx5_esw_bridge_vlan_create,
74 TP_PROTO(const struct mlx5_esw_bridge_vlan *vlan),
75 TP_ARGS(vlan)
76 );
77 DEFINE_EVENT(mlx5_esw_bridge_vlan_template,
78 mlx5_esw_bridge_vlan_cleanup,
79 TP_PROTO(const struct mlx5_esw_bridge_vlan *vlan),
80 TP_ARGS(vlan)
81 );
82
83 DECLARE_EVENT_CLASS(mlx5_esw_bridge_port_template,
84 TP_PROTO(const struct mlx5_esw_bridge_port *port),
85 TP_ARGS(port),
86 TP_STRUCT__entry(
87 __field(u16, vport_num)
88 ),
89 TP_fast_assign(
90 __entry->vport_num = port->vport_num;
91 ),
92 TP_printk("vport_num=%hu", __entry->vport_num)
93 );
94
95 DEFINE_EVENT(mlx5_esw_bridge_port_template,
96 mlx5_esw_bridge_vport_init,
97 TP_PROTO(const struct mlx5_esw_bridge_port *port),
98 TP_ARGS(port)
99 );
100 DEFINE_EVENT(mlx5_esw_bridge_port_template,
101 mlx5_esw_bridge_vport_cleanup,
102 TP_PROTO(const struct mlx5_esw_bridge_port *port),
103 TP_ARGS(port)
104 );
105
106 #endif
107
108 /* This part must be outside protection */
109 #undef TRACE_INCLUDE_PATH
110 #define TRACE_INCLUDE_PATH esw/diag
111 #undef TRACE_INCLUDE_FILE
112 #define TRACE_INCLUDE_FILE bridge_tracepoint
> 113 #include <trace/define_trace.h>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Vlad Buslov <vladbu@nvidia.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Saeed Mahameed <saeedm@nvidia.com>,
Jianbo Liu <jianbol@nvidia.com>
Subject: drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:24:29: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20
Date: Wed, 5 Jan 2022 10:34:43 +0800 [thread overview]
Message-ID: <202201051026.81C1NmK2-lkp@intel.com> (raw)
Hi Vlad,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c9e6606c7fe92b50a02ce51dda82586ebdf99b48
commit: 9724fd5d9c2a0d3686b799ed5ca90cb9378ca4f2 net/mlx5: Bridge, add tracepoints
date: 7 months ago
config: csky-allyesconfig (https://download.01.org/0day-ci/archive/20220105/202201051026.81C1NmK2-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9724fd5d9c2a0d3686b799ed5ca90cb9378ca4f2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 9724fd5d9c2a0d3686b799ed5ca90cb9378ca4f2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=csky SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/trace/define_trace.h:102,
from drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:113,
from drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:12:
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h: In function 'trace_event_raw_event_mlx5_esw_bridge_fdb_template':
>> drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:24:29: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20 [-Wstringop-truncation]
24 | strncpy(__entry->dev_name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
25 | netdev_name(fdb->dev),
| ~~~~~~~~~~~~~~~~~~~~~~
26 | IFNAMSIZ);
| ~~~~~~~~~
include/trace/trace_events.h:706:11: note: in definition of macro 'DECLARE_EVENT_CLASS'
706 | { assign; } \
| ^~~~~~
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:23:21: note: in expansion of macro 'TP_fast_assign'
23 | TP_fast_assign(
| ^~~~~~~~~~~~~~
In file included from include/trace/define_trace.h:103,
from drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:113,
from drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:12:
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h: In function 'perf_trace_mlx5_esw_bridge_fdb_template':
>> drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:24:29: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20 [-Wstringop-truncation]
24 | strncpy(__entry->dev_name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
25 | netdev_name(fdb->dev),
| ~~~~~~~~~~~~~~~~~~~~~~
26 | IFNAMSIZ);
| ~~~~~~~~~
include/trace/perf.h:66:11: note: in definition of macro 'DECLARE_EVENT_CLASS'
66 | { assign; } \
| ^~~~~~
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:23:21: note: in expansion of macro 'TP_fast_assign'
23 | TP_fast_assign(
| ^~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for LOCKDEP
Depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && (FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86)
Selected by
- PROVE_LOCKING && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
- LOCK_STAT && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
- DEBUG_LOCK_ALLOC && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
vim +/strncpy +24 drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h
12
13 DECLARE_EVENT_CLASS(mlx5_esw_bridge_fdb_template,
14 TP_PROTO(const struct mlx5_esw_bridge_fdb_entry *fdb),
15 TP_ARGS(fdb),
16 TP_STRUCT__entry(
17 __array(char, dev_name, IFNAMSIZ)
18 __array(unsigned char, addr, ETH_ALEN)
19 __field(u16, vid)
20 __field(u16, flags)
21 __field(unsigned int, used)
22 ),
23 TP_fast_assign(
> 24 strncpy(__entry->dev_name,
25 netdev_name(fdb->dev),
26 IFNAMSIZ);
27 memcpy(__entry->addr, fdb->key.addr, ETH_ALEN);
28 __entry->vid = fdb->key.vid;
29 __entry->flags = fdb->flags;
30 __entry->used = jiffies_to_msecs(jiffies - fdb->lastuse)
31 ),
32 TP_printk("net_device=%s addr=%pM vid=%hu flags=%hx used=%u",
33 __entry->dev_name,
34 __entry->addr,
35 __entry->vid,
36 __entry->flags,
37 __entry->used / 1000)
38 );
39
40 DEFINE_EVENT(mlx5_esw_bridge_fdb_template,
41 mlx5_esw_bridge_fdb_entry_init,
42 TP_PROTO(const struct mlx5_esw_bridge_fdb_entry *fdb),
43 TP_ARGS(fdb)
44 );
45 DEFINE_EVENT(mlx5_esw_bridge_fdb_template,
46 mlx5_esw_bridge_fdb_entry_refresh,
47 TP_PROTO(const struct mlx5_esw_bridge_fdb_entry *fdb),
48 TP_ARGS(fdb)
49 );
50 DEFINE_EVENT(mlx5_esw_bridge_fdb_template,
51 mlx5_esw_bridge_fdb_entry_cleanup,
52 TP_PROTO(const struct mlx5_esw_bridge_fdb_entry *fdb),
53 TP_ARGS(fdb)
54 );
55
56 DECLARE_EVENT_CLASS(mlx5_esw_bridge_vlan_template,
57 TP_PROTO(const struct mlx5_esw_bridge_vlan *vlan),
58 TP_ARGS(vlan),
59 TP_STRUCT__entry(
60 __field(u16, vid)
61 __field(u16, flags)
62 ),
63 TP_fast_assign(
64 __entry->vid = vlan->vid;
65 __entry->flags = vlan->flags;
66 ),
67 TP_printk("vid=%hu flags=%hx",
68 __entry->vid,
69 __entry->flags)
70 );
71
72 DEFINE_EVENT(mlx5_esw_bridge_vlan_template,
73 mlx5_esw_bridge_vlan_create,
74 TP_PROTO(const struct mlx5_esw_bridge_vlan *vlan),
75 TP_ARGS(vlan)
76 );
77 DEFINE_EVENT(mlx5_esw_bridge_vlan_template,
78 mlx5_esw_bridge_vlan_cleanup,
79 TP_PROTO(const struct mlx5_esw_bridge_vlan *vlan),
80 TP_ARGS(vlan)
81 );
82
83 DECLARE_EVENT_CLASS(mlx5_esw_bridge_port_template,
84 TP_PROTO(const struct mlx5_esw_bridge_port *port),
85 TP_ARGS(port),
86 TP_STRUCT__entry(
87 __field(u16, vport_num)
88 ),
89 TP_fast_assign(
90 __entry->vport_num = port->vport_num;
91 ),
92 TP_printk("vport_num=%hu", __entry->vport_num)
93 );
94
95 DEFINE_EVENT(mlx5_esw_bridge_port_template,
96 mlx5_esw_bridge_vport_init,
97 TP_PROTO(const struct mlx5_esw_bridge_port *port),
98 TP_ARGS(port)
99 );
100 DEFINE_EVENT(mlx5_esw_bridge_port_template,
101 mlx5_esw_bridge_vport_cleanup,
102 TP_PROTO(const struct mlx5_esw_bridge_port *port),
103 TP_ARGS(port)
104 );
105
106 #endif
107
108 /* This part must be outside protection */
109 #undef TRACE_INCLUDE_PATH
110 #define TRACE_INCLUDE_PATH esw/diag
111 #undef TRACE_INCLUDE_FILE
112 #define TRACE_INCLUDE_FILE bridge_tracepoint
> 113 #include <trace/define_trace.h>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next reply other threads:[~2022-01-05 2:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 2:34 kernel test robot [this message]
2022-01-05 2:34 ` drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:24:29: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202201051026.81C1NmK2-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.