Folks,

If one wants/needs to trace packets which vpp creates from whole cloth, here's 
how to do it. Typically, it's an input-node function.

  /* Top of node dispatch function */
  u32 n_trace = vlib_get_trace_count (vm, node);


  /* per-buffer */
  VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);

  /* If actually tracing generated packets... */
  if (PREDICT_FALSE (n_trace > 0))
    {
        session_queue_trace_t *t0;
        vlib_trace_buffer (vm, node, next_index, b0,
          1 /* follow_chain */ );
        vlib_set_trace_count (vm, node, --n_trace);
        t0 = vlib_add_trace (vm, node, b0, sizeof (*t0));

        <fill in rest of trace>
     }

In case of interior graph nodes, packets came from somewhere, and should be 
traced from where they entered the graph. Otherwise, information is lost.

Thanks... Dave

From: vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] On 
Behalf Of Luke, Chris
Sent: Thursday, July 13, 2017 6:51 AM
To: yug...@telincn.com; vpp-dev <vpp-dev@lists.fd.io>
Subject: Re: [vpp-dev] trace

Ewan,

Yes, it only works on the device input nodes. You're the second person to ask 
this recently, I guess we need to add a note to some documentation somewhere. :)

Cheers,
Chris

From: vpp-dev-boun...@lists.fd.io<mailto:vpp-dev-boun...@lists.fd.io> 
[mailto:vpp-dev-boun...@lists.fd.io] On Behalf Of 
yug...@telincn.com<mailto:yug...@telincn.com>
Sent: Thursday, July 13, 2017 0:41
To: vpp-dev <vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>>
Subject: [vpp-dev] trace

Hi all,
Cmd "vppctl trace add" only work for input nodes? Such as "dpdk-input" and 
"af-packet-input".
I found out that cmd "vppctl trace add ip4-input 1000" doesn't work.


Regards,
Ewan
________________________________
yug...@telincn.com<mailto:yug...@telincn.com>
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to