summaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
author杨威 <[email protected]>2023-06-30 18:44:24 +0800
committer杨威 <[email protected]>2023-06-30 22:35:53 +0800
commit06d04f8edda78151324d36114888e718cf5d32e1 (patch)
treedd5ca1519a782cfd18e2016e50338fcc8595bb50 /src/support
parent9ed7ab14a7c6d561b83602b2f302acd946bbb560 (diff)
🎈 perf(time_ms和time_s从全局结构体成员变为全局变量):
Diffstat (limited to 'src/support')
-rw-r--r--src/support/timestamp_record/timestamp_record.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/support/timestamp_record/timestamp_record.cpp b/src/support/timestamp_record/timestamp_record.cpp
index 546ae4e..8b786dd 100644
--- a/src/support/timestamp_record/timestamp_record.cpp
+++ b/src/support/timestamp_record/timestamp_record.cpp
@@ -69,67 +69,13 @@ void __timestamp_print_max_tuple4(const raw_pkt_t *raw_pkt, long timedelay, int
return;
}
-#if 0
void timestamp_record(enum timestamp_level level, const raw_pkt_t *raw_pkt, int thread_seq)
{
- struct timeval curtime;
-
- if(0 == g_timestamp_record_sw){
- return;
- }
-
- if(NULL == raw_pkt){
- /* û��ʵ�ʰ�����, �����DZ���ʱ��̭����, ��֮ǰ��ֵ���, ����. ����¼�˴�ʱ�� */
- memset(&g_timestamp_record[thread_seq].ts_rd, 0, sizeof(long)*__TS_LEVEL_MAX);
- return;
- }
-
- gettimeofday(&curtime, NULL);
- g_timestamp_record[thread_seq].ts_rd[level] = curtime.tv_sec * 1000000 + curtime.tv_usec
- - (raw_pkt->raw_pkt_ts.tv_sec*1000000 + raw_pkt->raw_pkt_ts.tv_usec);
-
- /* ij�̵߳����һ��ʱ�����¼����ʱ, ѡ���Ƿ���� */
- if((TS_LEVEL_AFTER_PLUG) == level && (g_timestamp_record[thread_seq].ts_rd[level] >= timestamp_out_min)){
- ibroadcast(PLATFORM_IHANDLE, 3, "timestamp", "%8ld %8ld %8ld %8ld %8ld \n",
- g_timestamp_record[thread_seq].ts_rd[TS_LEVEL_LIB],
- g_timestamp_record[thread_seq].ts_rd[TS_LEVEL_WORK],
- g_timestamp_record[thread_seq].ts_rd[TS_LEVEL_IP_ENTRY],
- g_timestamp_record[thread_seq].ts_rd[TS_LEVEL_BEFORE_PLUG],
- g_timestamp_record[thread_seq].ts_rd[TS_LEVEL_AFTER_PLUG]);
- }
-
- return;
}
void timestamp_record_lib(const raw_pkt_t *raw_pkt)
{
- int i;
- struct timeval curtime;
- long time_delay;
-
- if((0 == g_timestamp_record_sw) || (NULL == raw_pkt)){
- return;
- }
-
- gettimeofday(&curtime, NULL);
- time_delay = curtime.tv_sec * 1000000 + curtime.tv_usec
- - (raw_pkt->raw_pkt_ts.tv_sec*1000000 + raw_pkt->raw_pkt_ts.tv_usec);
-
- /* �������й����̵߳ļ��� */
- for(i = 0; i < g_packet_io_thread_num; i++){
- g_timestamp_record[i].ts_rd[TS_LEVEL_LIB] = time_delay;
- }
-
- return ;
-}
-#else
-void timestamp_record(enum timestamp_level level, const raw_pkt_t *raw_pkt, int thread_seq)
-{
-}
-void timestamp_record_lib(const raw_pkt_t *raw_pkt)
-{
}
-#endif
void timestamp_region_update(int tid, long long cpu_cycle)