From 85c9417b6ebc1e1cd25d479389c91926eb6948dc Mon Sep 17 00:00:00 2001 From: Benjamin Poirier Date: Mon, 10 Aug 2009 16:13:40 -0400 Subject: [PATCH] Do not use pkfree_skb events for synchronization 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 --- lttv/lttv/sync/event_processing_lttv_common.c | 5 ---- lttv/lttv/sync/event_processing_lttv_common.h | 1 - .../sync/event_processing_lttv_standard.c | 23 +------------------ 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/lttv/lttv/sync/event_processing_lttv_common.c b/lttv/lttv/sync/event_processing_lttv_common.c index 59c7c0f2..e225db71 100644 --- a/lttv/lttv/sync/event_processing_lttv_common.c +++ b/lttv/lttv/sync/event_processing_lttv_common.c @@ -40,10 +40,6 @@ .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"); diff --git a/lttv/lttv/sync/event_processing_lttv_common.h b/lttv/lttv/sync/event_processing_lttv_common.h index de57a650..31c2a649 100644 --- a/lttv/lttv/sync/event_processing_lttv_common.h +++ b/lttv/lttv/sync/event_processing_lttv_common.h @@ -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; diff --git a/lttv/lttv/sync/event_processing_lttv_standard.c b/lttv/lttv/sync/event_processing_lttv_standard.c index cef9f2b9..f67ab107 100644 --- a/lttv/lttv/sync/event_processing_lttv_standard.c +++ b/lttv/lttv/sync/event_processing_lttv_standard.c @@ -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; -- 2.34.1