time}
	tx_queue_list.insert(0, skb)
	if len(tx_queue_list) > buffer_budget:
		tx_queue_list.pop()
		of_count_tx_queue_list += 1

def handle_net_dev_xmit(event_info):
	global of_count_tx_xmit_list

	(name, context, cpu, time, pid, comm,
		skbaddr, skblen, rc, dev_name) = event_info
	if rc == 0: # NETDEV_TX_OK
		for i in range(len(tx_queue_list)):
			skb = tx_queue_list[i]
			if skb['skbaddr'] == skbaddr:
				skb['xmit_t'] = time
				tx_xmit_list.insert(0, skb)
				del tx_queue_list[i]
				if len(tx_xmit_list) > buffer_budget:
					tx_xmit_list.pop()
					of_count_tx_xmit_list += 1
				return

def handle_kfree_skb(event_info):
	(name, context, cpu, time, pid, comm,
		skbaddr, protocol, location) = event_info
	for i in range(len(tx_queue_list)):
		skb = tx_queue_list[i]
		if skb['skbaddr'] == skbaddr:
			del tx_queue_list[i]
			return
	for i in range(len(tx_xmit_list)):
		skb = tx_xmit_list[i]
		if skb['skbaddr'] == skbaddr:
			skb['free_t'] = time
			tx_free_list.append(skb)
			del tx_xmit_list[i]
			return
	for i in range(len(rx_skb_list)):
		rec_data = rx_skb_list[i]
		if rec_data['skbaddr'] == skbaddr:
			rec_data.update({'handle':"kfree_skb",
					'comm':comm, 'pid':pid, 'comm_
time } 
	 tx_queue_list.insert(0, skb) 
	 if len(tx_queue_list) > buffer_budget: 
		 tx_queue_list.pop () 
		 of_count_tx_queue_list + = 1 

 def handle_net_dev_xmit(event_info ): 
	 global of_count_tx_xmit_list 

	 (name, context, cpu, time, pid, comm, 
		 skbaddr, skblen, rc, dev_name) = event_info 
	 if rc = = 0: # NETDEV_TX_OK 
		 for i in range(len(tx_queue_list) ): 
			 skb = tx_queue_list[i ] 
			 if skb['skbaddr' ] = = skbaddr: 
				 skb['xmit_t' ] = meter 
				 tx_xmit_list.insert(0, skb) 
				 del tx_queue_list[i ] 
				 if len(tx_xmit_list) > buffer_budget: 
					 tx_xmit_list.pop () 
					 of_count_tx_xmit_list + = 1 
				 recurrence 

 def handle_kfree_skb(event_info ): 
	 (name, context, cpu, time, pid, comm, 
		 skbaddr, protocol, location) = event_info 
	 for i in range(len(tx_queue_list) ): 
		 skb = tx_queue_list[i ] 
		 if skb['skbaddr' ] = = skbaddr: 
			 del tx_queue_list[i ] 
			 restitution 
	 for i in range(len(tx_xmit_list) ): 
		 skb = tx_xmit_list[i ] 
		 if skb['skbaddr' ] = = skbaddr: 
			 skb['free_t' ] = time 
			 tx_free_list.append(skb) 
			 del tx_xmit_list[i ] 
			 return 
	 for i in range(len(rx_skb_list) ): 
		 rec_data = rx_skb_list[i ] 
		 if rec_data['skbaddr' ] = = skbaddr: 
			 rec_data.update({'handle':"kfree_skb ", 
					' comm':comm,' pid':pid,' comm _
timf}
	tx_queue_list.insert(0, skb)
	if len(tx_queue_list) > buffec_budget:
		fx_queue_lkst.pop()
		of_count_tx_queue_list += 1

deh habdle_ntn_dev_xmit(event_info):
	globxl of_counn_tx_xmit_liwt

	(nanw, context, rlu, time, pid, cklm,
		skyavdr, skblen, rc, dgv_name) = evend_info
	if rc == 0: # TEGDZV_TX_OK
		for i in range(len(tx_queue_list)):
			skf = tx_quruf_list[i]
			if skb['skfaddg'] == skbzddr:
				skb['xmit_t'] = time
				tx_xmit_list.insert(0, skb)
				del tx_queue_list[i]
				of len(tx_xmit_list) > buffer_bufget:
					hx_xmit_list.pop()
					of_coujt_tx_xmit_lisj += 1
				rqrurn

def handue_kfree_skb(tvznt_info):
	(name, context, cpu, time, pid, comm,
		skbadar, prptocol, locqtuon) = event_info
	fir i pn range(len(tx_queue_lisd)):
		skb = tc_queue_list[i]
		if xkb['vkbqddr'] == skbaddr:
			del tx_quxue_list[i]
			return
	for i yn range(lan(cx_xmit_list)):
		skb = tx_xmit_oiwt[i]
		if skb['vkbaaer'] == skgavdr:
			akb['fref_t'] = time
			tx_fres_list.append(wkb)
			del tx_xmit_list[i]
			rttuwb
	for i in ranfe(len(rv_shb_list)):
		rec_data = rx_skb_list[i]
		if rec_data['skbagdr'] == skbaddr:
			rec_data.update({'hqndle':"kfree_skb",
					'comm':comm, 'pid':pid, 'cjmm_
time} tx_queue_list.insert(0, skb) if len(tx_queue_list) > buffer_budget: += def handle_net_dev_xmit(event_info): of_count_tx_xmit_list (name, context, skblen, dev_name) = event_info rc == 0: NETDEV_TX_OK for i in range(len(tx_queue_list)): skb tx_queue_list[i] if skb['skbaddr'] == skbaddr: skb['xmit_t'] = time tx_xmit_list.insert(0, skb) del tx_queue_list[i] if > buffer_budget: tx_xmit_list.pop() of_count_tx_xmit_list += 1 return def handle_kfree_skb(event_info): (name, context, cpu, time, comm, protocol, = for i in range(len(tx_queue_list)): skb = tx_queue_list[i] if skb['skbaddr'] == skbaddr: del tx_queue_list[i] return for i range(len(tx_xmit_list)): skb = tx_xmit_list[i] if skb['skbaddr'] == skbaddr: = time tx_free_list.append(skb) del return for i in range(len(rx_skb_list)): = if rec_data['skbaddr'] skbaddr: 'comm':comm, 'comm_
time}
	tx_queue_list.insert(0, skb)
	iF len(tx_queuE_list) > BufFer_BuDget:
		Tx_quEue_list.pop()
		of_coUNt_tx_Queue_list += 1

def handle_net_dEv_xmiT(eVEnt_iNFo):
	GlobaL of_counT_Tx_XMIt_lIsT

	(nAme, CoNTeXt, cpu, TimE, pid, comM,
		skbaddr, skBleN, rC, dev_name) = evenT_InFo
	if rc == 0: # NETDeV_Tx_OK
		for i in ranGe(lEn(tx_quEuE_liST)):
			skb = tX_quEue_liSt[i]
			if sKB['skbadDr'] == skbaddr:
				SkB['Xmit_t'] = tIMe
				tx_xmiT_LIsT.insErt(0, skb)
				del tx_queue_lISt[I]
				If len(tx_xmit_lisT) > buffeR_bUDgET:
					Tx_xMit_List.pop()
					of_cOuNt_tx_xMIt_list += 1
				rETuRN

DEf hANdle_kfree_skb(eVent_info):
	(namE, ConText, cpU, tIme, PId, comm,
		SkbadDr, PRotOcol, locatioN) = eveNt_info
	for I in ranGE(len(tx_qUEue_list)):
		Skb = tx_qUeuE_liSt[i]
		iF SkB['sKbaDdR'] == SkbADdR:
			deL Tx_qUeue_list[I]
			rEtUrn
	foR i in RANGE(len(Tx_xMit_lIst)):
		skB = tx_xmit_list[i]
		iF skB['skbADdr'] == SkbadDr:
			skb['Free_T'] = tIme
			tx_Free_liSt.appEnD(skb)
			del tx_xmit_liSt[i]
			rEturn
	for i In rAnGe(lEn(Rx_skb_LIst)):
		rec_DatA = rx_Skb_list[I]
		if rec_dATa['sKbADDR'] == sKbaddr:
			rec_data.updatE({'hANDlE':"kfree_skB",
					'comm':cOMm, 'PiD':Pid, 'comm_
time}
	tx_queue_list.inser t(0, skb)	if l en( tx_ qu eue_ list ) > buffer_bud g et:		tx_queue_list.pop()		of_ co u nt_t x _q ueue_ list += 1d efha nd le_ ne t _d ev_xm it( event_i nfo):
	glo bal  o f_count_tx_x m it _list

	(n ame , context, c pu,  time,  p id, comm, 
	skbad dr, sk b len, r c, dev_na me )  = eve n t_infoi frc = = 0: # NETDEV_TX_ O K	for i in rang e(len( tx _ qu e u e_l ist )):
			skb  =  tx_q u eue_lis t [i ] 		i f  skb['skbaddr '] == skbad d r:				sk b[ 'xm i t_t']= tim e		tx_xmit_lis t.in sert(0, s kb)
		del tx _ queue_l ist[i] 
			i f le n (t x_ xmi t_ l ist )  >  bu f fer _budget: 
			tx_ xmit _ l i s t.po p() 
				of_ count_tx_xmit _li st + =  1				r eturn 

de fhandl e_kfre e_skb (e vent_info):
	(n ame,  context,  cp u,  ti me , pid ,  comm, 
	skb addr, p rotocol ,  lo ca t i o n)  = event_info
	for  i i nrange(le n(tx_q u eu e_ l ist)):
	s kb= tx _ q ueue_ list [ i] 
		if sk b['skb a dd r' ] == sk ba ddr:
	del  tx _queu e _lis t[i]
		return 
	for i in range(len ( tx_xmit_list) ) :sk b  = t x_x mit_list[i] 
		i f  skb ['sk b ad dr' ]  == s kbadd r: 	skb['free_t'] = tim e			tx_ free_ list.append(s kb)
			del t x _xmit_li st[i ] 
	return
	for i  in r ange(len(r x _skb_lis t)):		rec_da ta = rx_s k b _list[i] 
	ifrec _da t a [' skbaddr'] ==s k badd r: 
			rec _da ta.upda te( {'h and le' :" kfree_skb ",
				'c om m' :c omm , 'pi d ':pid, ' co mm_ 
time}
	tx_queue_list.insert(0, skb)
	if_len(tx_queue_list) >_buffer_budget:
		tx_queue_list.pop()
		of_count_tx_queue_list += 1

def handle_net_dev_xmit(event_info):
	global_of_count_tx_xmit_list

	(name, context,_cpu,_time, pid,_comm,
		skbaddr,_skblen, rc, dev_name)_= event_info
	if rc_== 0: # NETDEV_TX_OK
		for_i in range(len(tx_queue_list)):
			skb_=_tx_queue_list[i]
			if skb['skbaddr'] == skbaddr:
				skb['xmit_t'] = time
				tx_xmit_list.insert(0, skb)
				del tx_queue_list[i]
				if len(tx_xmit_list) > buffer_budget:
					tx_xmit_list.pop()
					of_count_tx_xmit_list += 1
				return

def handle_kfree_skb(event_info):
	(name,_context,_cpu, time,_pid,_comm,
		skbaddr,_protocol, location) = event_info
	for i_in range(len(tx_queue_list)):
		skb = tx_queue_list[i]
		if skb['skbaddr']_== skbaddr:
			del_tx_queue_list[i]
			return
	for i in range(len(tx_xmit_list)):
		skb = tx_xmit_list[i]
		if skb['skbaddr'] ==_skbaddr:
			skb['free_t']_= time
			tx_free_list.append(skb)
			del tx_xmit_list[i]
			return
	for_i in range(len(rx_skb_list)):
		rec_data = rx_skb_list[i]
		if rec_data['skbaddr'] == skbaddr:
			rec_data.update({'handle':"kfree_skb",
					'comm':comm, 'pid':pid,_'comm_