Do not use pkfree_skb events for synchronization
authorBenjamin Poirier <benjamin.poirier@polymtl.ca>
Mon, 10 Aug 2009 20:13:40 +0000 (16:13 -0400)
committerBenjamin Poirier <benjamin.poirier@polymtl.ca>
Fri, 18 Dec 2009 19:03:24 +0000 (14:03 -0500)
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>
lttv/lttv/sync/event_processing_lttv_common.c
lttv/lttv/sync/event_processing_lttv_common.h
lttv/lttv/sync/event_processing_lttv_standard.c

index 59c7c0f2953056ffc05d5458ad06d6685da37cbb..e225db714076e632325f5492d6842709dea55d19 100644 (file)
                .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,\
@@ -84,7 +80,6 @@ void createQuarks()
 
        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");
index de57a650630218222f73185d2a09a40d16497ad2..31c2a649aeb70a3a33cefc2df7255366d5d96163 100644 (file)
@@ -31,7 +31,6 @@ GQuark
 GQuark
        LTT_EVENT_DEV_XMIT,
        LTT_EVENT_DEV_RECEIVE,
-       LTT_EVENT_PKFREE_SKB,
        LTT_EVENT_TCPV4_RCV,
        LTT_EVENT_NETWORK_IPV4_INTERFACE;
 
index cef9f2b970f2a5f8712bb6b7355045ae931ff76a..f67ab107f0aa7df280314ea50cce503430e1b6b0 100644 (file)
@@ -461,7 +461,7 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData)
                                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);
@@ -531,27 +531,6 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData)
                        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;
This page took 0.026533 seconds and 4 git commands to generate.