diff options
author | Dmitry V. Levin <ldv@strace.io> | 2021-01-28 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2021-01-28 08:00:00 +0000 |
commit | 4f2228692f9639f76ab4952d2b6486be31968210 (patch) | |
tree | 665fb96786a61ff922ec99dfff2b05eac0366b7a | |
parent | 2a4fd46487e00ebf706e6c6241d7eeac2d95b3ab (diff) | |
download | strace-4f2228692f9639f76ab4952d2b6486be31968210.tar.gz |
print_fields.h: remove prefix argument from PRINT_FIELD_IFINDEX macro
* print_fields.h (PRINT_FIELD_IFINDEX): Remove the first argument,
all callers updated.
-rw-r--r-- | bpf.c | 12 | ||||
-rw-r--r-- | msghdr.c | 3 | ||||
-rw-r--r-- | net.c | 6 | ||||
-rw-r--r-- | netlink_inet_diag.c | 3 | ||||
-rw-r--r-- | netlink_packet_diag.c | 6 | ||||
-rw-r--r-- | print_fields.h | 4 | ||||
-rw-r--r-- | print_group_req.c | 3 | ||||
-rw-r--r-- | rtnl_addr.c | 3 | ||||
-rw-r--r-- | rtnl_addrlabel.c | 3 | ||||
-rw-r--r-- | rtnl_link.c | 3 | ||||
-rw-r--r-- | rtnl_mdb.c | 5 | ||||
-rw-r--r-- | rtnl_neigh.c | 2 | ||||
-rw-r--r-- | rtnl_route.c | 3 | ||||
-rw-r--r-- | rtnl_tc.c | 2 | ||||
-rw-r--r-- | sock.c | 3 | ||||
-rw-r--r-- | sockaddr.c | 6 |
16 files changed, 43 insertions, 24 deletions
@@ -213,7 +213,8 @@ BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE) */ if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_ifindex)) break; - PRINT_FIELD_IFINDEX(", ", attr, map_ifindex); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(attr, map_ifindex); /* * The following three fields were introduced by Linux commits @@ -328,7 +329,8 @@ BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD) */ if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex)) break; - PRINT_FIELD_IFINDEX(", ", attr, prog_ifindex); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(attr, prog_ifindex); /* * expected_attach_type was added in Linux commit @@ -538,7 +540,8 @@ print_bpf_map_info(struct tcb * const tcp, uint32_t bpf_fd, */ if (len <= offsetof(struct bpf_map_info_struct, ifindex)) goto print_bpf_map_info_end; - PRINT_FIELD_IFINDEX(", ", info, ifindex); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(info, ifindex); /* * btf_vmlinux_value_type_id field was crammed in * by Linux commit v5.6-rc1~151^2~46^2~37^2~5. @@ -649,7 +652,8 @@ print_bpf_prog_info(struct tcb * const tcp, uint32_t bpf_fd, */ if (len <= offsetof(struct bpf_prog_info_struct, ifindex)) goto print_bpf_prog_info_end; - PRINT_FIELD_IFINDEX(", ", info, ifindex); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(info, ifindex); PRINT_FIELD_U_CAST(", ", info, gpl_compatible, unsigned int); tprint_struct_next(); PRINT_FIELD_DEV(info, netns_dev); @@ -149,7 +149,8 @@ print_cmsg_ip_pktinfo(struct tcb *tcp, const void *cmsg_data, { const struct in_pktinfo *info = cmsg_data; - PRINT_FIELD_IFINDEX("{", *info, ipi_ifindex); + tprint_struct_begin(); + PRINT_FIELD_IFINDEX(*info, ipi_ifindex); tprint_struct_next(); PRINT_FIELD_INET_ADDR(*info, ipi_spec_dst, AF_INET); tprint_struct_next(); @@ -845,7 +845,8 @@ print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr, } else if (!umove_or_printaddr(tcp, addr, &mreq)) { tprint_struct_begin(); PRINT_FIELD_INET_ADDR(mreq, ipv6mr_multiaddr, AF_INET6); - PRINT_FIELD_IFINDEX(", ", mreq, ipv6mr_interface); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(mreq, ipv6mr_interface); tprints("}"); } } @@ -882,7 +883,8 @@ print_packet_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const int le umove(tcp, addr, &mreq) < 0) { printaddr(addr); } else { - PRINT_FIELD_IFINDEX("{", mreq, mr_ifindex); + tprint_struct_begin(); + PRINT_FIELD_IFINDEX(mreq, mr_ifindex); PRINT_FIELD_XVAL(", ", mreq, mr_type, packet_mreq_type, "PACKET_MR_???"); PRINT_FIELD_U(", ", mreq, mr_alen); diff --git a/netlink_inet_diag.c b/netlink_inet_diag.c index d37879eac..e83cbde8a 100644 --- a/netlink_inet_diag.c +++ b/netlink_inet_diag.c @@ -37,7 +37,8 @@ print_inet_diag_sockid(const struct inet_diag_sockid *id, const uint8_t family) PRINT_FIELD_INET_ADDR(*id, idiag_src, family); tprint_struct_next(); PRINT_FIELD_INET_ADDR(*id, idiag_dst, family); - PRINT_FIELD_IFINDEX(", ", *id, idiag_if); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(*id, idiag_if); tprint_struct_next(); PRINT_FIELD_COOKIE(*id, idiag_cookie); tprints("}"); diff --git a/netlink_packet_diag.c b/netlink_packet_diag.c index 72d6361eb..368ffe027 100644 --- a/netlink_packet_diag.c +++ b/netlink_packet_diag.c @@ -62,7 +62,8 @@ decode_packet_diag_info(struct tcb *const tcp, if (umove_or_printaddr(tcp, addr, &pinfo)) return true; - PRINT_FIELD_IFINDEX("{", pinfo, pdi_index); + tprint_struct_begin(); + PRINT_FIELD_IFINDEX(pinfo, pdi_index); PRINT_FIELD_XVAL(", ", pinfo, pdi_version, af_packet_versions, "TPACKET_???"); PRINT_FIELD_U(", ", pinfo, pdi_reserve); @@ -82,7 +83,8 @@ print_packet_diag_mclist(struct tcb *const tcp, void *const elem_buf, struct packet_diag_mclist *dml = elem_buf; uint16_t alen = MIN(dml->pdmc_alen, sizeof(dml->pdmc_addr)); - PRINT_FIELD_IFINDEX("{", *dml, pdmc_index); + tprint_struct_begin(); + PRINT_FIELD_IFINDEX(*dml, pdmc_index); PRINT_FIELD_U(", ", *dml, pdmc_count); PRINT_FIELD_U(", ", *dml, pdmc_type); PRINT_FIELD_U(", ", *dml, pdmc_alen); diff --git a/print_fields.h b/print_fields.h index 283b051d5..f73b0c7dd 100644 --- a/print_fields.h +++ b/print_fields.h @@ -364,9 +364,9 @@ tprints_field_name(const char *name) STRACE_PRINTF(" */"); \ } while (0) -# define PRINT_FIELD_IFINDEX(prefix_, where_, field_) \ +# define PRINT_FIELD_IFINDEX(where_, field_) \ do { \ - STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + tprints_field_name(#field_); \ print_ifindex((where_).field_); \ } while (0) diff --git a/print_group_req.c b/print_group_req.c index 8965fc5ab..dc04418ba 100644 --- a/print_group_req.c +++ b/print_group_req.c @@ -29,7 +29,8 @@ MPERS_PRINTER_DECL(void, print_group_req, struct tcb *const tcp, if (len < (int) sizeof(greq)) { printaddr(addr); } else if (!umove_or_printaddr(tcp, addr, &greq)) { - PRINT_FIELD_IFINDEX("{", greq, gr_interface); + tprint_struct_begin(); + PRINT_FIELD_IFINDEX(greq, gr_interface); tprint_struct_next(); PRINT_FIELD_SOCKADDR(greq, gr_group, tcp); tprints("}"); diff --git a/rtnl_addr.c b/rtnl_addr.c index f2f283e8a..572126d9d 100644 --- a/rtnl_addr.c +++ b/rtnl_addr.c @@ -103,7 +103,8 @@ DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg) ifaddrflags, "IFA_F_???"); PRINT_FIELD_XVAL(", ", ifaddr, ifa_scope, routing_scopes, NULL); - PRINT_FIELD_IFINDEX(", ", ifaddr, ifa_index); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(ifaddr, ifa_index); decode_nla = true; } } else diff --git a/rtnl_addrlabel.c b/rtnl_addrlabel.c index 1e6da24ea..54c53df68 100644 --- a/rtnl_addrlabel.c +++ b/rtnl_addrlabel.c @@ -53,7 +53,8 @@ DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg) (char *) &ifal + offset)) { PRINT_FIELD_U("", ifal, ifal_prefixlen); PRINT_FIELD_U(", ", ifal, ifal_flags); - PRINT_FIELD_IFINDEX(", ", ifal, ifal_index); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(ifal, ifal_index); PRINT_FIELD_U(", ", ifal, ifal_seq); decode_nla = true; } diff --git a/rtnl_link.c b/rtnl_link.c index 5827e92de..b56ecb2ed 100644 --- a/rtnl_link.c +++ b/rtnl_link.c @@ -932,7 +932,8 @@ DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg) (char *) &ifinfo + offset)) { PRINT_FIELD_XVAL("", ifinfo, ifi_type, arp_hardware_types, "ARPHRD_???"); - PRINT_FIELD_IFINDEX(", ", ifinfo, ifi_index); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(ifinfo, ifi_index); PRINT_FIELD_FLAGS(", ", ifinfo, ifi_flags, iffflags, "IFF_???"); PRINT_FIELD_X(", ", ifinfo, ifi_change); diff --git a/rtnl_mdb.c b/rtnl_mdb.c index a2030d48f..be3159ea6 100644 --- a/rtnl_mdb.c +++ b/rtnl_mdb.c @@ -41,7 +41,8 @@ decode_mdba_mdb_entry_info(struct tcb *const tcp, if (len < sizeof(entry)) return false; else if (!umove_or_printaddr(tcp, addr, &entry)) { - PRINT_FIELD_IFINDEX("{", entry, ifindex); + tprint_struct_begin(); + PRINT_FIELD_IFINDEX(entry, ifindex); PRINT_FIELD_XVAL(", ", entry, state, mdb_states, "MDB_???"); /* @@ -189,7 +190,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_br_port_msg) if (!umoven_or_printaddr(tcp, addr + offset, sizeof(bpm) - offset, (char *) &bpm + offset)) { - PRINT_FIELD_IFINDEX("", bpm, ifindex); + PRINT_FIELD_IFINDEX(bpm, ifindex); decode_nla = true; } } else diff --git a/rtnl_neigh.c b/rtnl_neigh.c index 90e77eb58..d42af0d92 100644 --- a/rtnl_neigh.c +++ b/rtnl_neigh.c @@ -85,7 +85,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_ndmsg) if (!umoven_or_printaddr(tcp, addr + offset, sizeof(ndmsg) - offset, (char *) &ndmsg + offset)) { - PRINT_FIELD_IFINDEX("", ndmsg, ndm_ifindex); + PRINT_FIELD_IFINDEX(ndmsg, ndm_ifindex); PRINT_FIELD_FLAGS(", ", ndmsg, ndm_state, neighbor_cache_entry_states, "NUD_???"); diff --git a/rtnl_route.c b/rtnl_route.c index f8f534a56..525a1abc3 100644 --- a/rtnl_route.c +++ b/rtnl_route.c @@ -241,7 +241,8 @@ decode_rta_multipath(struct tcb *const tcp, PRINT_FIELD_FLAGS(", ", nh, rtnh_flags, route_nexthop_flags, "RTNH_F_???"); PRINT_FIELD_U(", ", nh, rtnh_hops); - PRINT_FIELD_IFINDEX(", ", nh, rtnh_ifindex); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(nh, rtnh_ifindex); tprints("}"); const unsigned short rtnh_len = MIN(len, nh.rtnh_len); @@ -295,7 +295,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_tcmsg) if (!umoven_or_printaddr(tcp, addr + offset, sizeof(tcmsg) - offset, (char *) &tcmsg + offset)) { - PRINT_FIELD_IFINDEX("", tcmsg, tcm_ifindex); + PRINT_FIELD_IFINDEX(tcmsg, tcm_ifindex); PRINT_FIELD_U(", ", tcmsg, tcm_handle); PRINT_FIELD_U(", ", tcmsg, tcm_parent); PRINT_FIELD_U(", ", tcmsg, tcm_info); @@ -271,7 +271,8 @@ MPERS_PRINTER_DECL(int, sock_ioctl, case SIOCBRDELIF: tprints(", "); if (!umove_or_printaddr(tcp, arg, &ifr)) { - PRINT_FIELD_IFINDEX("{", ifr, ifr_ifindex); + tprint_struct_begin(); + PRINT_FIELD_IFINDEX(ifr, ifr_ifindex); tprints("}"); } break; diff --git a/sockaddr.c b/sockaddr.c index eccf746d4..071c45ac1 100644 --- a/sockaddr.c +++ b/sockaddr.c @@ -211,7 +211,8 @@ print_sockaddr_data_in6(struct tcb *tcp, const void *const buf, #if defined IN6_IS_ADDR_LINKLOCAL && defined IN6_IS_ADDR_MC_LINKLOCAL if (IN6_IS_ADDR_LINKLOCAL(&sa_in6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&sa_in6->sin6_addr)) { - PRINT_FIELD_IFINDEX(", ", *sa_in6, sin6_scope_id); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(*sa_in6, sin6_scope_id); } else #endif { @@ -455,7 +456,8 @@ print_sockaddr_data_ll(struct tcb *tcp, const void *const buf, const struct sockaddr_ll *const sa_ll = buf; print_sll_protocol(sa_ll); - PRINT_FIELD_IFINDEX(", ", *sa_ll, sll_ifindex); + tprint_struct_next(); + PRINT_FIELD_IFINDEX(*sa_ll, sll_ifindex); PRINT_FIELD_XVAL(", ", *sa_ll, sll_hatype, arp_hardware_types, "ARPHRD_???"); PRINT_FIELD_XVAL(", ", *sa_ll, sll_pkttype, af_packet_types, |