Don't rely on events indicating when sk_buff structures are freed. After a
receive, we wait for another event indicating that this receive was for TCP
data. In the case where the data was not TCP, instead of keeping information
about the receive, we used to discard it when the skb was freed. It turns out
that it faster (and simpler) not to look at pkfree_skb events and keep the
information around anyways. Since sk_buff's are allocated in a pool, the
information will get overwritten and the size of pendingRecv will not grow
infinitely.
Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
.channelName= LTT_CHANNEL_NET,\
.eventName= LTT_EVENT_DEV_RECEIVE,\
.fields= FIELD_ARRAY(LTT_FIELD_SKB, LTT_FIELD_PROTOCOL),\
.channelName= LTT_CHANNEL_NET,\
.eventName= LTT_EVENT_DEV_RECEIVE,\
.fields= FIELD_ARRAY(LTT_FIELD_SKB, LTT_FIELD_PROTOCOL),\
- }, {\
- .channelName= LTT_CHANNEL_NET,\
- .eventName= LTT_EVENT_PKFREE_SKB,\
- .fields= FIELD_ARRAY(LTT_FIELD_SKB),\
}, {\
.channelName= LTT_CHANNEL_NET,\
.eventName= LTT_EVENT_TCPV4_RCV,\
}, {\
.channelName= LTT_CHANNEL_NET,\
.eventName= LTT_EVENT_TCPV4_RCV,\
LTT_EVENT_DEV_XMIT= g_quark_from_static_string("dev_xmit");
LTT_EVENT_DEV_RECEIVE= g_quark_from_static_string("dev_receive");
LTT_EVENT_DEV_XMIT= g_quark_from_static_string("dev_xmit");
LTT_EVENT_DEV_RECEIVE= g_quark_from_static_string("dev_receive");
- LTT_EVENT_PKFREE_SKB= g_quark_from_static_string("pkfree_skb");
LTT_EVENT_TCPV4_RCV= g_quark_from_static_string("tcpv4_rcv");
LTT_EVENT_NETWORK_IPV4_INTERFACE=
g_quark_from_static_string("network_ipv4_interface");
LTT_EVENT_TCPV4_RCV= g_quark_from_static_string("tcpv4_rcv");
LTT_EVENT_NETWORK_IPV4_INTERFACE=
g_quark_from_static_string("network_ipv4_interface");
GQuark
LTT_EVENT_DEV_XMIT,
LTT_EVENT_DEV_RECEIVE,
GQuark
LTT_EVENT_DEV_XMIT,
LTT_EVENT_DEV_RECEIVE,
LTT_EVENT_TCPV4_RCV,
LTT_EVENT_NETWORK_IPV4_INTERFACE;
LTT_EVENT_TCPV4_RCV,
LTT_EVENT_NETWORK_IPV4_INTERFACE;
lttv_trace_get_hook_field(traceHook, 0));
inE->packetKey= NULL;
lttv_trace_get_hook_field(traceHook, 0));
inE->packetKey= NULL;
- g_hash_table_insert(processingData->pendingRecv[traceNum],
+ g_hash_table_replace(processingData->pendingRecv[traceNum],
inE->skb, inE);
g_debug("Adding inE %p for skb %p to pendingRecv\n", inE, inE->skb);
inE->skb, inE);
g_debug("Adding inE %p for skb %p to pendingRecv\n", inE, inE->skb);
g_debug("Input event %p for skb %p done\n", inE, skb);
}
}
g_debug("Input event %p for skb %p done\n", inE, skb);
}
}
- else if (info->name == LTT_EVENT_PKFREE_SKB)
- {
- gboolean result;
- void* skb;
-
- // Search pendingRecv for an event with the same skb
- skb= (void*) (long) ltt_event_get_long_unsigned(event,
- lttv_trace_get_hook_field(traceHook, 0));
-
- result= g_hash_table_remove(processingData->pendingRecv[traceNum],
- skb);
- if (result == FALSE)
- {
- g_debug("No matching pending receive event found, \"shaddow"
- "skb\" %p\n", skb);
- }
- else
- {
- g_debug("Non-TCP skb %p\n", skb);
- }
- }
else if (info->name == LTT_EVENT_NETWORK_IPV4_INTERFACE)
{
char* name;
else if (info->name == LTT_EVENT_NETWORK_IPV4_INTERFACE)
{
char* name;