1 #undef TRACE_SYSTEM 1 #undef TRACE_SYSTEM 2 #define TRACE_SYSTEM neigh 2 #define TRACE_SYSTEM neigh 3 3 4 #if !defined(_TRACE_NEIGH_H) || defined(TRACE_ 4 #if !defined(_TRACE_NEIGH_H) || defined(TRACE_HEADER_MULTI_READ) 5 #define _TRACE_NEIGH_H 5 #define _TRACE_NEIGH_H 6 6 7 #include <linux/skbuff.h> 7 #include <linux/skbuff.h> 8 #include <linux/netdevice.h> 8 #include <linux/netdevice.h> 9 #include <linux/tracepoint.h> 9 #include <linux/tracepoint.h> 10 #include <net/neighbour.h> 10 #include <net/neighbour.h> 11 11 12 #define neigh_state_str(state) 12 #define neigh_state_str(state) \ 13 __print_symbolic(state, 13 __print_symbolic(state, \ 14 { NUD_INCOMPLETE, "incomplete" 14 { NUD_INCOMPLETE, "incomplete" }, \ 15 { NUD_REACHABLE, "reachable" } 15 { NUD_REACHABLE, "reachable" }, \ 16 { NUD_STALE, "stale" }, 16 { NUD_STALE, "stale" }, \ 17 { NUD_DELAY, "delay" }, 17 { NUD_DELAY, "delay" }, \ 18 { NUD_PROBE, "probe" }, 18 { NUD_PROBE, "probe" }, \ 19 { NUD_FAILED, "failed" }, 19 { NUD_FAILED, "failed" }, \ 20 { NUD_NOARP, "noarp" }, 20 { NUD_NOARP, "noarp" }, \ 21 { NUD_PERMANENT, "permanent"}) 21 { NUD_PERMANENT, "permanent"}) 22 22 23 TRACE_EVENT(neigh_create, 23 TRACE_EVENT(neigh_create, 24 24 25 TP_PROTO(struct neigh_table *tbl, stru 25 TP_PROTO(struct neigh_table *tbl, struct net_device *dev, 26 const void *pkey, const struc 26 const void *pkey, const struct neighbour *n, 27 bool exempt_from_gc), 27 bool exempt_from_gc), 28 28 29 TP_ARGS(tbl, dev, pkey, n, exempt_from 29 TP_ARGS(tbl, dev, pkey, n, exempt_from_gc), 30 30 31 TP_STRUCT__entry( 31 TP_STRUCT__entry( 32 __field(u32, family) 32 __field(u32, family) 33 __string(dev, dev ? dev->name !! 33 __dynamic_array(char, dev, IFNAMSIZ ) 34 __field(int, entries) 34 __field(int, entries) 35 __field(u8, created) 35 __field(u8, created) 36 __field(u8, gc_exempt) 36 __field(u8, gc_exempt) 37 __array(u8, primary_key4, 4) 37 __array(u8, primary_key4, 4) 38 __array(u8, primary_key6, 16) 38 __array(u8, primary_key6, 16) 39 ), 39 ), 40 40 41 TP_fast_assign( 41 TP_fast_assign( >> 42 struct in6_addr *pin6; 42 __be32 *p32; 43 __be32 *p32; 43 44 44 __entry->family = tbl->family; 45 __entry->family = tbl->family; 45 __assign_str(dev); !! 46 __assign_str(dev, (dev ? dev->name : "NULL")); 46 __entry->entries = atomic_read 47 __entry->entries = atomic_read(&tbl->gc_entries); 47 __entry->created = n != NULL; 48 __entry->created = n != NULL; 48 __entry->gc_exempt = exempt_fr 49 __entry->gc_exempt = exempt_from_gc; >> 50 pin6 = (struct in6_addr *)__entry->primary_key6; 49 p32 = (__be32 *)__entry->prima 51 p32 = (__be32 *)__entry->primary_key4; 50 52 51 if (tbl->family == AF_INET) 53 if (tbl->family == AF_INET) 52 *p32 = *(__be32 *)pkey 54 *p32 = *(__be32 *)pkey; 53 else 55 else 54 *p32 = 0; 56 *p32 = 0; 55 57 56 #if IS_ENABLED(CONFIG_IPV6) 58 #if IS_ENABLED(CONFIG_IPV6) 57 if (tbl->family == AF_INET6) { 59 if (tbl->family == AF_INET6) { 58 struct in6_addr *pin6; << 59 << 60 pin6 = (struct in6_add 60 pin6 = (struct in6_addr *)__entry->primary_key6; 61 *pin6 = *(struct in6_a 61 *pin6 = *(struct in6_addr *)pkey; 62 } 62 } 63 #endif 63 #endif 64 ), 64 ), 65 65 66 TP_printk("family %d dev %s entries %d 66 TP_printk("family %d dev %s entries %d primary_key4 %pI4 primary_key6 %pI6c created %d gc_exempt %d", 67 __entry->family, __get_str(d 67 __entry->family, __get_str(dev), __entry->entries, 68 __entry->primary_key4, __ent 68 __entry->primary_key4, __entry->primary_key6, 69 __entry->created, __entry->g 69 __entry->created, __entry->gc_exempt) 70 ); 70 ); 71 71 72 TRACE_EVENT(neigh_update, 72 TRACE_EVENT(neigh_update, 73 73 74 TP_PROTO(struct neighbour *n, const u8 74 TP_PROTO(struct neighbour *n, const u8 *lladdr, u8 new, 75 u32 flags, u32 nlmsg_pid), 75 u32 flags, u32 nlmsg_pid), 76 76 77 TP_ARGS(n, lladdr, new, flags, nlmsg_p 77 TP_ARGS(n, lladdr, new, flags, nlmsg_pid), 78 78 79 TP_STRUCT__entry( 79 TP_STRUCT__entry( 80 __field(u32, family) 80 __field(u32, family) 81 __string(dev, (n->dev ? n->dev 81 __string(dev, (n->dev ? n->dev->name : "NULL")) 82 __array(u8, lladdr, MAX_ADDR_L 82 __array(u8, lladdr, MAX_ADDR_LEN) 83 __field(u8, lladdr_len) 83 __field(u8, lladdr_len) 84 __field(u8, flags) 84 __field(u8, flags) 85 __field(u8, nud_state) 85 __field(u8, nud_state) 86 __field(u8, type) 86 __field(u8, type) 87 __field(u8, dead) 87 __field(u8, dead) 88 __field(int, refcnt) 88 __field(int, refcnt) 89 __array(__u8, primary_key4, 4) 89 __array(__u8, primary_key4, 4) 90 __array(__u8, primary_key6, 16 90 __array(__u8, primary_key6, 16) 91 __field(unsigned long, confirm 91 __field(unsigned long, confirmed) 92 __field(unsigned long, updated 92 __field(unsigned long, updated) 93 __field(unsigned long, used) 93 __field(unsigned long, used) 94 __array(u8, new_lladdr, MAX_AD 94 __array(u8, new_lladdr, MAX_ADDR_LEN) 95 __field(u8, new_state) 95 __field(u8, new_state) 96 __field(u32, update_flags) 96 __field(u32, update_flags) 97 __field(u32, pid) 97 __field(u32, pid) 98 ), 98 ), 99 99 100 TP_fast_assign( 100 TP_fast_assign( 101 int lladdr_len = (n->dev ? n-> 101 int lladdr_len = (n->dev ? n->dev->addr_len : MAX_ADDR_LEN); 102 struct in6_addr *pin6; 102 struct in6_addr *pin6; 103 __be32 *p32; 103 __be32 *p32; 104 104 105 __entry->family = n->tbl->fami 105 __entry->family = n->tbl->family; 106 __assign_str(dev); !! 106 __assign_str(dev, (n->dev ? n->dev->name : "NULL")); 107 __entry->lladdr_len = lladdr_l 107 __entry->lladdr_len = lladdr_len; 108 memcpy(__entry->lladdr, n->ha, 108 memcpy(__entry->lladdr, n->ha, lladdr_len); 109 __entry->flags = n->flags; 109 __entry->flags = n->flags; 110 __entry->nud_state = n->nud_st 110 __entry->nud_state = n->nud_state; 111 __entry->type = n->type; 111 __entry->type = n->type; 112 __entry->dead = n->dead; 112 __entry->dead = n->dead; 113 __entry->refcnt = refcount_rea 113 __entry->refcnt = refcount_read(&n->refcnt); 114 pin6 = (struct in6_addr *)__en 114 pin6 = (struct in6_addr *)__entry->primary_key6; 115 p32 = (__be32 *)__entry->prima 115 p32 = (__be32 *)__entry->primary_key4; 116 116 117 if (n->tbl->family == AF_INET) 117 if (n->tbl->family == AF_INET) 118 *p32 = *(__be32 *)n->p 118 *p32 = *(__be32 *)n->primary_key; 119 else 119 else 120 *p32 = 0; 120 *p32 = 0; 121 121 122 #if IS_ENABLED(CONFIG_IPV6) 122 #if IS_ENABLED(CONFIG_IPV6) 123 if (n->tbl->family == AF_INET6 123 if (n->tbl->family == AF_INET6) { 124 pin6 = (struct in6_add 124 pin6 = (struct in6_addr *)__entry->primary_key6; 125 *pin6 = *(struct in6_a 125 *pin6 = *(struct in6_addr *)n->primary_key; 126 } else 126 } else 127 #endif 127 #endif 128 { 128 { 129 ipv6_addr_set_v4mapped 129 ipv6_addr_set_v4mapped(*p32, pin6); 130 } 130 } 131 __entry->confirmed = n->confir 131 __entry->confirmed = n->confirmed; 132 __entry->updated = n->updated; 132 __entry->updated = n->updated; 133 __entry->used = n->used; 133 __entry->used = n->used; 134 if (lladdr) 134 if (lladdr) 135 memcpy(__entry->new_ll 135 memcpy(__entry->new_lladdr, lladdr, lladdr_len); 136 __entry->new_state = new; 136 __entry->new_state = new; 137 __entry->update_flags = flags; 137 __entry->update_flags = flags; 138 __entry->pid = nlmsg_pid; 138 __entry->pid = nlmsg_pid; 139 ), 139 ), 140 140 141 TP_printk("family %d dev %s lladdr %s 141 TP_printk("family %d dev %s lladdr %s flags %02x nud_state %s type %02x " 142 "dead %d refcnt %d primary_k 142 "dead %d refcnt %d primary_key4 %pI4 primary_key6 %pI6c " 143 "confirmed %lu updated %lu u 143 "confirmed %lu updated %lu used %lu new_lladdr %s " 144 "new_state %s update_flags % 144 "new_state %s update_flags %02x pid %d", 145 __entry->family, __get_str(d 145 __entry->family, __get_str(dev), 146 __print_hex_str(__entry->lla 146 __print_hex_str(__entry->lladdr, __entry->lladdr_len), 147 __entry->flags, neigh_state_ 147 __entry->flags, neigh_state_str(__entry->nud_state), 148 __entry->type, __entry->dead 148 __entry->type, __entry->dead, __entry->refcnt, 149 __entry->primary_key4, __ent 149 __entry->primary_key4, __entry->primary_key6, 150 __entry->confirmed, __entry- 150 __entry->confirmed, __entry->updated, __entry->used, 151 __print_hex_str(__entry->new 151 __print_hex_str(__entry->new_lladdr, __entry->lladdr_len), 152 neigh_state_str(__entry->new 152 neigh_state_str(__entry->new_state), 153 __entry->update_flags, __ent 153 __entry->update_flags, __entry->pid) 154 ); 154 ); 155 155 156 DECLARE_EVENT_CLASS(neigh__update, 156 DECLARE_EVENT_CLASS(neigh__update, 157 TP_PROTO(struct neighbour *n, int err) 157 TP_PROTO(struct neighbour *n, int err), 158 TP_ARGS(n, err), 158 TP_ARGS(n, err), 159 TP_STRUCT__entry( 159 TP_STRUCT__entry( 160 __field(u32, family) 160 __field(u32, family) 161 __string(dev, (n->dev ? n->dev 161 __string(dev, (n->dev ? n->dev->name : "NULL")) 162 __array(u8, lladdr, MAX_ADDR_L 162 __array(u8, lladdr, MAX_ADDR_LEN) 163 __field(u8, lladdr_len) 163 __field(u8, lladdr_len) 164 __field(u8, flags) 164 __field(u8, flags) 165 __field(u8, nud_state) 165 __field(u8, nud_state) 166 __field(u8, type) 166 __field(u8, type) 167 __field(u8, dead) 167 __field(u8, dead) 168 __field(int, refcnt) 168 __field(int, refcnt) 169 __array(__u8, primary_key4, 4) 169 __array(__u8, primary_key4, 4) 170 __array(__u8, primary_key6, 16 170 __array(__u8, primary_key6, 16) 171 __field(unsigned long, confirm 171 __field(unsigned long, confirmed) 172 __field(unsigned long, updated 172 __field(unsigned long, updated) 173 __field(unsigned long, used) 173 __field(unsigned long, used) 174 __field(u32, err) 174 __field(u32, err) 175 ), 175 ), 176 176 177 TP_fast_assign( 177 TP_fast_assign( 178 int lladdr_len = (n->dev ? n-> 178 int lladdr_len = (n->dev ? n->dev->addr_len : MAX_ADDR_LEN); 179 struct in6_addr *pin6; 179 struct in6_addr *pin6; 180 __be32 *p32; 180 __be32 *p32; 181 181 182 __entry->family = n->tbl->fami 182 __entry->family = n->tbl->family; 183 __assign_str(dev); !! 183 __assign_str(dev, (n->dev ? n->dev->name : "NULL")); 184 __entry->lladdr_len = lladdr_l 184 __entry->lladdr_len = lladdr_len; 185 memcpy(__entry->lladdr, n->ha, 185 memcpy(__entry->lladdr, n->ha, lladdr_len); 186 __entry->flags = n->flags; 186 __entry->flags = n->flags; 187 __entry->nud_state = n->nud_st 187 __entry->nud_state = n->nud_state; 188 __entry->type = n->type; 188 __entry->type = n->type; 189 __entry->dead = n->dead; 189 __entry->dead = n->dead; 190 __entry->refcnt = refcount_rea 190 __entry->refcnt = refcount_read(&n->refcnt); 191 pin6 = (struct in6_addr *)__en 191 pin6 = (struct in6_addr *)__entry->primary_key6; 192 p32 = (__be32 *)__entry->prima 192 p32 = (__be32 *)__entry->primary_key4; 193 193 194 if (n->tbl->family == AF_INET) 194 if (n->tbl->family == AF_INET) 195 *p32 = *(__be32 *)n->p 195 *p32 = *(__be32 *)n->primary_key; 196 else 196 else 197 *p32 = 0; 197 *p32 = 0; 198 198 199 #if IS_ENABLED(CONFIG_IPV6) 199 #if IS_ENABLED(CONFIG_IPV6) 200 if (n->tbl->family == AF_INET6 200 if (n->tbl->family == AF_INET6) { 201 pin6 = (struct in6_add 201 pin6 = (struct in6_addr *)__entry->primary_key6; 202 *pin6 = *(struct in6_a 202 *pin6 = *(struct in6_addr *)n->primary_key; 203 } else 203 } else 204 #endif 204 #endif 205 { 205 { 206 ipv6_addr_set_v4mapped 206 ipv6_addr_set_v4mapped(*p32, pin6); 207 } 207 } 208 208 209 __entry->confirmed = n->confir 209 __entry->confirmed = n->confirmed; 210 __entry->updated = n->updated; 210 __entry->updated = n->updated; 211 __entry->used = n->used; 211 __entry->used = n->used; 212 __entry->err = err; 212 __entry->err = err; 213 ), 213 ), 214 214 215 TP_printk("family %d dev %s lladdr %s 215 TP_printk("family %d dev %s lladdr %s flags %02x nud_state %s type %02x " 216 "dead %d refcnt %d primary_k 216 "dead %d refcnt %d primary_key4 %pI4 primary_key6 %pI6c " 217 "confirmed %lu updated %lu u 217 "confirmed %lu updated %lu used %lu err %d", 218 __entry->family, __get_str(d 218 __entry->family, __get_str(dev), 219 __print_hex_str(__entry->lla 219 __print_hex_str(__entry->lladdr, __entry->lladdr_len), 220 __entry->flags, neigh_state_ 220 __entry->flags, neigh_state_str(__entry->nud_state), 221 __entry->type, __entry->dead 221 __entry->type, __entry->dead, __entry->refcnt, 222 __entry->primary_key4, __ent 222 __entry->primary_key4, __entry->primary_key6, 223 __entry->confirmed, __entry- 223 __entry->confirmed, __entry->updated, __entry->used, 224 __entry->err) 224 __entry->err) 225 ); 225 ); 226 226 227 DEFINE_EVENT(neigh__update, neigh_update_done, 227 DEFINE_EVENT(neigh__update, neigh_update_done, 228 TP_PROTO(struct neighbour *neigh, int 228 TP_PROTO(struct neighbour *neigh, int err), 229 TP_ARGS(neigh, err) 229 TP_ARGS(neigh, err) 230 ); 230 ); 231 231 232 DEFINE_EVENT(neigh__update, neigh_timer_handle 232 DEFINE_EVENT(neigh__update, neigh_timer_handler, 233 TP_PROTO(struct neighbour *neigh, int 233 TP_PROTO(struct neighbour *neigh, int err), 234 TP_ARGS(neigh, err) 234 TP_ARGS(neigh, err) 235 ); 235 ); 236 236 237 DEFINE_EVENT(neigh__update, neigh_event_send_d 237 DEFINE_EVENT(neigh__update, neigh_event_send_done, 238 TP_PROTO(struct neighbour *neigh, int 238 TP_PROTO(struct neighbour *neigh, int err), 239 TP_ARGS(neigh, err) 239 TP_ARGS(neigh, err) 240 ); 240 ); 241 241 242 DEFINE_EVENT(neigh__update, neigh_event_send_d 242 DEFINE_EVENT(neigh__update, neigh_event_send_dead, 243 TP_PROTO(struct neighbour *neigh, int 243 TP_PROTO(struct neighbour *neigh, int err), 244 TP_ARGS(neigh, err) 244 TP_ARGS(neigh, err) 245 ); 245 ); 246 246 247 DEFINE_EVENT(neigh__update, neigh_cleanup_and_ 247 DEFINE_EVENT(neigh__update, neigh_cleanup_and_release, 248 TP_PROTO(struct neighbour *neigh, int 248 TP_PROTO(struct neighbour *neigh, int rc), 249 TP_ARGS(neigh, rc) 249 TP_ARGS(neigh, rc) 250 ); 250 ); 251 251 252 #endif /* _TRACE_NEIGH_H */ 252 #endif /* _TRACE_NEIGH_H */ 253 253 254 /* This part must be outside protection */ 254 /* This part must be outside protection */ 255 #include <trace/define_trace.h> 255 #include <trace/define_trace.h> 256 256
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.