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