vnet: use system time for pcap trace 23/35423/2
authorBenoît Ganne <bganne@cisco.com>
Wed, 23 Feb 2022 14:35:35 +0000 (15:35 +0100)
committerDave Wallace <dwallacelf@gmail.com>
Thu, 3 Mar 2022 20:43:54 +0000 (20:43 +0000)
Use system wall-clock time for packets timestamps instead of the time
since VPP started for pcap traces.

Type: improvement

Change-Id: I716165912efe8db3a8861d5c10597dc7629d2293
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/vnet/interface_funcs.h

index 5434542..02d8099 100644 (file)
@@ -546,6 +546,7 @@ pcap_add_buffer (pcap_main_t *pm, struct vlib_main_t *vm, u32 buffer_index,
 
   if (PREDICT_TRUE (pm->n_packets_captured < pm->n_packets_to_capture))
     {
+      time_now += vm->clib_time.init_reference_time;
       clib_spinlock_lock_if_init (&pm->lock);
       d = pcap_add_packet (pm, time_now, n_left, n);
       while (1)