[etherlab-dev] pcap logging patch

Graeme Foot Graeme.Foot at touchcut.com
Tue Jun 11 03:40:45 CEST 2019


In case anyone is interested I've attached a patch for an EtherCAT comms logging function:


This will cache the first 30mb (defined under PCAP_SIZE) of EtherCAT comms traffic to memory in pcap format.  It adds a pcap command to the ethercat tool utility, which also has a reset option to clear the cache and continue logging.

I know there are already other debug options, i.e.:
- Debug level 2, will print the EtherCAT comms to syslog direct
- EC_DEBUG_IF, which creates a local IFACE port that gets the EtherCAT comms traffic mirrored to it
                (to be logged in wireshark locally or from a remote computer if the debug IFACE is bridged to a real IFACE)
- EC_DEBUG_RING, will print the EtherCAT comms to syslog if Debug level > 0
Warning: EC_DEBUG_RING uses the do_gettimeofday() method.  This is not safe to be called from an
RTAI realtime thread.  It will freeze your system if you only have one CPU.  It should use jiffies instead.

None of the options above really suited my situation as I wanted to track down intermittent startup issues at client sites.  The Syslog rotates too quickly and has other information in it and the Debug IFace option was not suitable to set up at a client site.


Graeme Foot
Kinetic Engineering Design Ltd.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20190611/44da3f81/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pcap-logging.patch
Type: application/octet-stream
Size: 18381 bytes
Desc: 0001-pcap-logging.patch
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20190611/44da3f81/attachment-0001.obj>

More information about the etherlab-dev mailing list