Re: [PATCH net-next 2/2] tcp: handle TCP_TIME_WAIT/TCP_NEW_SYN_RECV in tcp_set_state tracepoint

From: kbuild test robot
Date: Sun Nov 12 2017 - 10:41:22 EST


Hi Yafang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url: https://github.com/0day-ci/linux/commits/Yafang-Shao/net-tcp-track-all-TCP-IP-state-transition-in-tcp_set_state/20171112-203643
config: mips-malta_kvm_defconfig (attached as .config)
compiler: mipsel-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=mips

All errors (new ones prefixed by >>):

In file included from include/trace/define_trace.h:96:0,
from include/trace/events/tcp.h:318,
from net//core/net-traces.c:35:
include/trace/events/tcp.h: In function 'trace_event_raw_event_tcp_set_state':
>> include/trace/events/tcp.h:245:27: error: 'inet' undeclared (first use in this function); did you mean 'net'?
ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
^
include/trace/trace_events.h:719:4: note: in definition of macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/trace/trace_events.h:78:9: note: in expansion of macro 'PARAMS'
PARAMS(assign), \
^~~~~~
include/trace/events/tcp.h:180:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(tcp_set_state,
^~~~~~~~~~~
include/trace/events/tcp.h:198:2: note: in expansion of macro 'TP_fast_assign'
TP_fast_assign(
^~~~~~~~~~~~~~
include/trace/events/tcp.h:245:27: note: each undeclared identifier is reported only once for each function it appears in
ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
^
include/trace/trace_events.h:719:4: note: in definition of macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/trace/trace_events.h:78:9: note: in expansion of macro 'PARAMS'
PARAMS(assign), \
^~~~~~
include/trace/events/tcp.h:180:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(tcp_set_state,
^~~~~~~~~~~
include/trace/events/tcp.h:198:2: note: in expansion of macro 'TP_fast_assign'
TP_fast_assign(
^~~~~~~~~~~~~~
In file included from include/trace/define_trace.h:97:0,
from include/trace/events/tcp.h:318,
from net//core/net-traces.c:35:
include/trace/events/tcp.h: In function 'perf_trace_tcp_set_state':
>> include/trace/events/tcp.h:245:27: error: 'inet' undeclared (first use in this function); did you mean 'net'?
ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
^
include/trace/perf.h:66:4: note: in definition of macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/trace/trace_events.h:78:9: note: in expansion of macro 'PARAMS'
PARAMS(assign), \
^~~~~~
include/trace/events/tcp.h:180:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(tcp_set_state,
^~~~~~~~~~~
include/trace/events/tcp.h:198:2: note: in expansion of macro 'TP_fast_assign'
TP_fast_assign(
^~~~~~~~~~~~~~

vim +245 include/trace/events/tcp.h

e8fce239 Song Liu 2017-10-23 181
e8fce239 Song Liu 2017-10-23 182 TP_PROTO(const struct sock *sk, const int oldstate, const int newstate),
e8fce239 Song Liu 2017-10-23 183
e8fce239 Song Liu 2017-10-23 184 TP_ARGS(sk, oldstate, newstate),
e8fce239 Song Liu 2017-10-23 185
e8fce239 Song Liu 2017-10-23 186 TP_STRUCT__entry(
e8fce239 Song Liu 2017-10-23 187 __field(const void *, skaddr)
e8fce239 Song Liu 2017-10-23 188 __field(int, oldstate)
e8fce239 Song Liu 2017-10-23 189 __field(int, newstate)
e8fce239 Song Liu 2017-10-23 190 __field(__u16, sport)
e8fce239 Song Liu 2017-10-23 191 __field(__u16, dport)
e8fce239 Song Liu 2017-10-23 192 __array(__u8, saddr, 4)
e8fce239 Song Liu 2017-10-23 193 __array(__u8, daddr, 4)
e8fce239 Song Liu 2017-10-23 194 __array(__u8, saddr_v6, 16)
e8fce239 Song Liu 2017-10-23 195 __array(__u8, daddr_v6, 16)
e8fce239 Song Liu 2017-10-23 196 ),
e8fce239 Song Liu 2017-10-23 197
e8fce239 Song Liu 2017-10-23 198 TP_fast_assign(
e8fce239 Song Liu 2017-10-23 199 struct in6_addr *pin6;
e8fce239 Song Liu 2017-10-23 200 __be32 *p32;
e8fce239 Song Liu 2017-10-23 201
e8fce239 Song Liu 2017-10-23 202 __entry->skaddr = sk;
e8fce239 Song Liu 2017-10-23 203 __entry->oldstate = oldstate;
e8fce239 Song Liu 2017-10-23 204 __entry->newstate = newstate;
e8fce239 Song Liu 2017-10-23 205
e346c952 Yafang Shao 2017-11-09 206 if (oldstate == TCP_TIME_WAIT) {
e346c952 Yafang Shao 2017-11-09 207 __entry->sport = ntohs(inet_twsk(sk)->tw_sport);
e346c952 Yafang Shao 2017-11-09 208 __entry->dport = ntohs(inet_twsk(sk)->tw_dport);
e8fce239 Song Liu 2017-10-23 209
e8fce239 Song Liu 2017-10-23 210 p32 = (__be32 *) __entry->saddr;
e346c952 Yafang Shao 2017-11-09 211 *p32 = inet_twsk(sk)->tw_rcv_saddr;
e8fce239 Song Liu 2017-10-23 212
e8fce239 Song Liu 2017-10-23 213 p32 = (__be32 *) __entry->daddr;
e346c952 Yafang Shao 2017-11-09 214 *p32 = inet_twsk(sk)->tw_daddr;
e346c952 Yafang Shao 2017-11-09 215 } else if (oldstate == TCP_NEW_SYN_RECV) {
e346c952 Yafang Shao 2017-11-09 216 __entry->sport = inet_rsk(inet_reqsk(sk))->ir_num;
e346c952 Yafang Shao 2017-11-09 217 __entry->dport = ntohs(inet_rsk(inet_reqsk(sk))->ir_rmt_port);
e346c952 Yafang Shao 2017-11-09 218
e346c952 Yafang Shao 2017-11-09 219 p32 = (__be32 *) __entry->saddr;
e346c952 Yafang Shao 2017-11-09 220 *p32 = inet_rsk(inet_reqsk(sk))->ir_loc_addr;
e346c952 Yafang Shao 2017-11-09 221
e346c952 Yafang Shao 2017-11-09 222 p32 = (__be32 *) __entry->daddr;
e346c952 Yafang Shao 2017-11-09 223 *p32 = inet_rsk(inet_reqsk(sk))->ir_rmt_addr;
e346c952 Yafang Shao 2017-11-09 224 } else {
e346c952 Yafang Shao 2017-11-09 225 __entry->sport = ntohs(inet_sk(sk)->inet_sport);
e346c952 Yafang Shao 2017-11-09 226 __entry->dport = ntohs(inet_sk(sk)->inet_dport);
e346c952 Yafang Shao 2017-11-09 227
e346c952 Yafang Shao 2017-11-09 228 p32 = (__be32 *) __entry->saddr;
e346c952 Yafang Shao 2017-11-09 229 *p32 = inet_sk(sk)->inet_saddr;
e346c952 Yafang Shao 2017-11-09 230
e346c952 Yafang Shao 2017-11-09 231 p32 = (__be32 *) __entry->daddr;
e346c952 Yafang Shao 2017-11-09 232 *p32 = inet_sk(sk)->inet_daddr;
e346c952 Yafang Shao 2017-11-09 233 }
e8fce239 Song Liu 2017-10-23 234
e8fce239 Song Liu 2017-10-23 235 #if IS_ENABLED(CONFIG_IPV6)
e8fce239 Song Liu 2017-10-23 236 if (sk->sk_family == AF_INET6) {
e8fce239 Song Liu 2017-10-23 237 pin6 = (struct in6_addr *)__entry->saddr_v6;
e8fce239 Song Liu 2017-10-23 238 *pin6 = sk->sk_v6_rcv_saddr;
e8fce239 Song Liu 2017-10-23 239 pin6 = (struct in6_addr *)__entry->daddr_v6;
e8fce239 Song Liu 2017-10-23 240 *pin6 = sk->sk_v6_daddr;
e8fce239 Song Liu 2017-10-23 241 } else
e8fce239 Song Liu 2017-10-23 242 #endif
e8fce239 Song Liu 2017-10-23 243 {
e8fce239 Song Liu 2017-10-23 244 pin6 = (struct in6_addr *)__entry->saddr_v6;
e8fce239 Song Liu 2017-10-23 @245 ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
e8fce239 Song Liu 2017-10-23 246 pin6 = (struct in6_addr *)__entry->daddr_v6;
e8fce239 Song Liu 2017-10-23 247 ipv6_addr_set_v4mapped(inet->inet_daddr, pin6);
e8fce239 Song Liu 2017-10-23 248 }
e8fce239 Song Liu 2017-10-23 249 ),
e8fce239 Song Liu 2017-10-23 250
e8fce239 Song Liu 2017-10-23 251 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c oldstate=%s newstate=%s",
e8fce239 Song Liu 2017-10-23 252 __entry->sport, __entry->dport,
e8fce239 Song Liu 2017-10-23 253 __entry->saddr, __entry->daddr,
e8fce239 Song Liu 2017-10-23 254 __entry->saddr_v6, __entry->daddr_v6,
e8fce239 Song Liu 2017-10-23 255 show_tcp_state_name(__entry->oldstate),
e8fce239 Song Liu 2017-10-23 256 show_tcp_state_name(__entry->newstate))
e8fce239 Song Liu 2017-10-23 257 );
e8fce239 Song Liu 2017-10-23 258
cf34ce3d Song Liu 2017-10-30 259 TRACE_EVENT(tcp_retransmit_synack,
cf34ce3d Song Liu 2017-10-30 260
cf34ce3d Song Liu 2017-10-30 261 TP_PROTO(const struct sock *sk, const struct request_sock *req),
cf34ce3d Song Liu 2017-10-30 262
cf34ce3d Song Liu 2017-10-30 263 TP_ARGS(sk, req),
cf34ce3d Song Liu 2017-10-30 264
cf34ce3d Song Liu 2017-10-30 265 TP_STRUCT__entry(
cf34ce3d Song Liu 2017-10-30 266 __field(const void *, skaddr)
cf34ce3d Song Liu 2017-10-30 267 __field(const void *, req)
cf34ce3d Song Liu 2017-10-30 268 __field(__u16, sport)
cf34ce3d Song Liu 2017-10-30 269 __field(__u16, dport)
cf34ce3d Song Liu 2017-10-30 270 __array(__u8, saddr, 4)
cf34ce3d Song Liu 2017-10-30 271 __array(__u8, daddr, 4)
cf34ce3d Song Liu 2017-10-30 272 __array(__u8, saddr_v6, 16)
cf34ce3d Song Liu 2017-10-30 273 __array(__u8, daddr_v6, 16)
cf34ce3d Song Liu 2017-10-30 274 ),
cf34ce3d Song Liu 2017-10-30 275
cf34ce3d Song Liu 2017-10-30 276 TP_fast_assign(
cf34ce3d Song Liu 2017-10-30 277 struct inet_request_sock *ireq = inet_rsk(req);
cf34ce3d Song Liu 2017-10-30 278 struct in6_addr *pin6;
cf34ce3d Song Liu 2017-10-30 279 __be32 *p32;
cf34ce3d Song Liu 2017-10-30 280
cf34ce3d Song Liu 2017-10-30 281 __entry->skaddr = sk;
cf34ce3d Song Liu 2017-10-30 282 __entry->req = req;
cf34ce3d Song Liu 2017-10-30 283
cf34ce3d Song Liu 2017-10-30 284 __entry->sport = ireq->ir_num;
cf34ce3d Song Liu 2017-10-30 285 __entry->dport = ntohs(ireq->ir_rmt_port);
cf34ce3d Song Liu 2017-10-30 286
cf34ce3d Song Liu 2017-10-30 287 p32 = (__be32 *) __entry->saddr;
cf34ce3d Song Liu 2017-10-30 288 *p32 = ireq->ir_loc_addr;
cf34ce3d Song Liu 2017-10-30 289
cf34ce3d Song Liu 2017-10-30 290 p32 = (__be32 *) __entry->daddr;
cf34ce3d Song Liu 2017-10-30 291 *p32 = ireq->ir_rmt_addr;
cf34ce3d Song Liu 2017-10-30 292
cf34ce3d Song Liu 2017-10-30 293 #if IS_ENABLED(CONFIG_IPV6)
cf34ce3d Song Liu 2017-10-30 294 if (sk->sk_family == AF_INET6) {
cf34ce3d Song Liu 2017-10-30 295 pin6 = (struct in6_addr *)__entry->saddr_v6;
cf34ce3d Song Liu 2017-10-30 296 *pin6 = ireq->ir_v6_loc_addr;
cf34ce3d Song Liu 2017-10-30 297 pin6 = (struct in6_addr *)__entry->daddr_v6;
cf34ce3d Song Liu 2017-10-30 298 *pin6 = ireq->ir_v6_rmt_addr;
cf34ce3d Song Liu 2017-10-30 299 } else
cf34ce3d Song Liu 2017-10-30 300 #endif
cf34ce3d Song Liu 2017-10-30 301 {
cf34ce3d Song Liu 2017-10-30 302 pin6 = (struct in6_addr *)__entry->saddr_v6;
cf34ce3d Song Liu 2017-10-30 303 ipv6_addr_set_v4mapped(ireq->ir_loc_addr, pin6);
cf34ce3d Song Liu 2017-10-30 304 pin6 = (struct in6_addr *)__entry->daddr_v6;
cf34ce3d Song Liu 2017-10-30 305 ipv6_addr_set_v4mapped(ireq->ir_rmt_addr, pin6);
cf34ce3d Song Liu 2017-10-30 306 }
cf34ce3d Song Liu 2017-10-30 307 ),
cf34ce3d Song Liu 2017-10-30 308
cf34ce3d Song Liu 2017-10-30 309 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c",
cf34ce3d Song Liu 2017-10-30 310 __entry->sport, __entry->dport,
cf34ce3d Song Liu 2017-10-30 311 __entry->saddr, __entry->daddr,
cf34ce3d Song Liu 2017-10-30 312 __entry->saddr_v6, __entry->daddr_v6)
cf34ce3d Song Liu 2017-10-30 313 );
cf34ce3d Song Liu 2017-10-30 314
e086101b Cong Wang 2017-10-13 315 #endif /* _TRACE_TCP_H */
e086101b Cong Wang 2017-10-13 316
e086101b Cong Wang 2017-10-13 317 /* This part must be outside protection */
e086101b Cong Wang 2017-10-13 @318 #include <trace/define_trace.h>

:::::: The code at line 245 was first introduced by commit
:::::: e8fce23946b7e7eadf25ad78d8207c22903dfe27 tcp: add tracepoint trace_tcp_set_state()

:::::: TO: Song Liu <songliubraving@xxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip