Thanks!

>If you are just keen to debug something, I'd suggest using some
>socat/netcat/tcpproxy trickery to proxy port 7147 to the roach - so
>pretend that some PC is the roach, run the proxy on it where it
>forwards and logs katcp commands. The katcp commands run over a single
>TCP/IP port...

I'm actually just trying to debug an old control program for which we lack
source code--I had planned on intercepting the katcp commands, but I
thought to check if there was a canned roach solution first.

-Alex

On Thu, Jul 19, 2012 at 1:11 AM, Marc Welz <[email protected]> wrote:

> Hello
>
> > Does anyone know if a ROACH keeps a log of KATCP commands recieved?
>
> It doesn't. Writing log files to flash doesn't seem advisable
>
> > If
> > not, are there any ideas on how to implement one?
>
> If you telnet to port 7147 on the roach you should get to see its
> katcp interface. This interface supports various log levels... Try
> typing in
>
> ?log-level trace
>
> to increase its verbosity. You could add another trace log message
> which records all commands processed. That then would allow you to see
> the commands issued by another connection. You probably want to edit
> tcpborphserver2/katcp/dispatch.c to do this, and add a
> log_message_katcp(d, KATCP_LEVEL_TRACE, NULL, "yourlogmessage");
> to dispatch_katcp() or call_katcp(). Here "yourlogmessage" will
> probably have to be a buffer built up from various
> arg_string_katcl(d->d_line, i) calls.
>
> If you wish to record this information, there is a logging tool at
> github.com/ska-sa/katcp_devel  in log/ which will connect to a katcp
> interface, select a log level and write the log messages to file. Here
> is
> its help output:
>
> ~$ kcplog -h
> usage: kcplog [-v] [-h] [-l level] [-o logfile] [-a
> reconnect-attempts] [-d] [-t] [-s server:port]
> -v              be more verbose
> -h              this help
> -l level        select a log level (trace, debug, info, warn, ... to log
> at)
> -o logfile      write log messages to the specified log file instead of
> stdout
> -d              run in the background
> -f              run in the foreground
> -t              truncate the logfile when opening it
> -s server:port  connect to the specified server rather than localhost:7147
> -a attempts     make the given number attempts to connect to the
> server before giving up
> signals: HUP USR1 USR2
>  HUP            re-open the logfile (if -o is given)
>  USR1           change log level one level more detailed (eg from
> DEBUG to TRACE)
>  USR2           change log level one level less detailed (eg from INFO to
> WARN)
>
> This strategy is probably the proper way of doing it, but requires you to
> get the source for tcpborphserver2, (from
> https://casper.berkeley.edu/svn/trunk/roach/sw/tcpborphserver2) modify
> it and build it for the PPC.
>
> If you are just keen to debug something, I'd suggest using some
> socat/netcat/tcpproxy trickery to proxy port 7147 to the roach - so
> pretend that some PC is the roach, run the proxy on it where it
> forwards and logs katcp commands. The katcp commands run over a single
> TCP/IP port...
>
> > Searching through our ROACH's filesystem, I realize I don't know how to
> > find anything KATCP related. Is the KATCP server built into the kernel?
>
> No, it is a userspace application - on roach1 it is called
> tcpborphserver2, you should see it in the process listing. Using
> tcpborphserver3 on roach1 isn't going to work - that version under
> development for the roach2
>
> regards
>
> marc
>
>

Reply via email to