DXSpider Tracing Debug Entries

From DXSpider Documentation Wiki
Revision as of 19:36, 5 April 2025 by WI3W (talk | contribs) (Saving progress...)
Jump to navigation Jump to search

General Information

DXSpider has the ability to log information at various levels, and those levels are set using the debug tool in conjunction with the debug levels. Whilst this information is captured in the data files of ../spider/local_data/debug/ it can also be seen in realtime from the command line prompt. Once the debug levels are set the 'watchdbg' tool can be used from ../spider/perl/ to watch the cluster's full data stream. This can be a very busy stream but it can be filtered for easier scrutiny.

This guide assumes that 'watchdbg' has been linked to /usr/local/bin. If not, you can run this command in Linux:

 sudo ln -s /spider/perl/*dbg /usr/local/bin

This will command will link all dbg subroutines in /spider/perl to /usr/local/bin so they can be accessed from the user prompt like any other built in command.

watchdbg

  • watchdbg [-nnn lines before] [!<regexp>|<regexp>]...

You can have more than one <regexp> with an implicit 'and' between them. All <regexes> are caseless. It's recommended to put 'not' (!<regex>) first in any list. Don't forget that you are doing this in a shell and you may need to quote your <regex>s.

grepdbg

  • grepdbg [nn days before] [-nnn lines before] [<perl filter module>] [<regexp>|!<regexp>]...

You can have more than one <regexp> with an implicit 'and' between them. All <regexes> are caseless. It's recommended to put 'not' (!<regex>) first in any list. Don't forget that you are doing this in a shell and you may need to quote your <regex>s. 'grepdbg' with no arguments will simply list the current debug log with the timestamp for each line decoded into a human readable form.

grepdbg | less

is a handy way of scrolling through the debug log.

grepdbg -2 progress

will display any line containing 'progress' and also the two lines before that. You can install your own content and display arrangement (useful for filtering data in some complicated way). You call it like this (assuming it is called 'filter.pm').

This is what is meant by <perl filter module>.

grepdbg filter.pm

All the other arguments to grepdbg are available to limit the input to your filter. If you want them. The filter module MUST contain at least:

package main;
  sub handle
  {
    your code goes here
  }
  1;

It can also have a 'sub begin {...}' and / or 'sub end {...}' which are executed immediately after opening a logfile and then just before closing it, respectively. You can also add a 'sub total {...}' which executes after the last line is printed and grepdbg exits. Read the code of this program and copy'n'paste the 'sub process' code into a new file. Then change 'sub process' to 'sub handle'. Add the line 'package main;' at the beginning of the file and a line '1;' at the end and then modify it to your requirements...

Filtering traces

To trace incoming messages the I is used, and for outbound the D is used:

'<- I' or ' I '
'-> D' or ' D '

Trace examples

To watch all outbound spots from this node:

watchdbg ' D ' 'PC[16]1'

or to watch everything outbound:

watchdbg '\-> D' or watchdbg ' D '

The same can be done for inbound traffic:

watchdbg '<\- I' or watchdbg ' I '

or two watch all inbound PC92 frames:

watchdbg ' I ' 'PC92'

Note: the hyphen needs to be escaped with the " \ " character. The spaces between ' D ' are important, make sure they are included.

grepdbg

The debug files will save these traces, and those files can then be searched using the 'grepdbg' command. Ex:

 grepdbg ' D '

Saving to a file

But it is possible to save the traces to a specific file by using pipe | to push them to a file.

./watchdbg ' D ' 'PC[16]1' | grep <thing to search for> | trace.txt  ----> This still needs to be worked on.