From 99b1cb22ee8ee2d11f35dd2fd2da65310b1e62d5 Mon Sep 17 00:00:00 2001 From: Dave Marples Date: Sat, 31 Aug 2024 00:16:50 +0100 Subject: [PATCH] Improve documentation and remove TPIU support from orbcat and orbfifo --- CHANGES.md | 3 ++ Inc/itmfifos.h | 3 +- README.md | 73 +++++++++++++++++++++--------------------- Src/itmfifos.c | 87 +++----------------------------------------------- Src/orbcat.c | 82 ++++++----------------------------------------- Src/orbfifo.c | 15 +++------ 6 files changed, 61 insertions(+), 202 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e7b62794..a65060f2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ In Progress (Version 2.2.0) * Support for ORBTrace 1.4 series gateware * Support in-probe TPIU frame stripping * Support TPIU frames in orbflow tag 1 +* Individual clients no longer decode TPIU - use orbuculum mux if you need this * Update saved file format to differentiate orbflow files from legacy * Simplification of client handling (speedup and less crud) * Various incremental improvements @@ -16,6 +17,8 @@ In Progress (Version 2.2.0) * Ensure utilities respect CTRL-C even when orbuculum mux is not available * improved support for C++ * Addition of ETM4 decode (experimental) +* Timestamping for orbtop, in various formats +* Exception reporting for orbtop * OSX CI Builder support * Orbuculum can now be used as a meson subproject * sam5 session setup support diff --git a/Inc/itmfifos.h b/Inc/itmfifos.h index 3cef32b6..5071be2d 100644 --- a/Inc/itmfifos.h +++ b/Inc/itmfifos.h @@ -9,7 +9,6 @@ #ifndef _ITMFIFOS_ #define _ITMFIFOS_ -#include "tpiuDecoder.h" #include "itmDecoder.h" #include "oflow.h" @@ -27,7 +26,7 @@ extern "C" { struct Channel; struct itmfifosHandle; -enum Prot { PROT_OFLOW, PROT_ITM, PROT_TPIU, PROT_UNKNOWN }; +enum Prot { PROT_OFLOW, PROT_ITM, PROT_UNKNOWN }; /* Fifos running */ void itmfifoForceSync( struct itmfifosHandle *f, bool synced ); /* Force sync status */ diff --git a/README.md b/README.md index a42f6854..942d6687 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ ![Screenshot](https://raw.githubusercontent.com/orbcode/orbuculum/main/Docs/title.png) -This (main) is the development branch for V2.2.0. Development is generally done in feature branches and folded into main as those features mature. +This (orbflow) is the development branch for V2.2.0. Development is generally done in feature branches and folded into main as those features mature, but the changes in orbflow are significant and disruptive, with limited user visible benefit, so we want to keep them off main for a little while longer. -Version 2.1.0 has recently been released and includes nice things like Python support, a decent quality Windows port and the ninja/meson build system. It also supports the full functionality of the ORBTrace Mini dongle. +Version 2.2.0 builds on 2.1.0 and adds several new CPU families, improved client application handling and the start of ETM4 support. Stats and timing are also much improved and the whole communications subsystem has been simplified and streamlined. Most importantly though, we have moved from 'legacy' protocol (basically, the exact same protocol that flows from the chip) for communications to 'orbflow' protocol. Orbflow protocol is an extensible packet oriented protocol which provides a more compact representation of the probe data. By default orbflow is used transparently between orbuculum and client applications. If you have an ORBTrace 1.4.0 or higher version then it is also used for communication from the probe to orbuculum. If you have your own legacy applications, or a version of ORBTrace less that 1.4.0, then the system will fall back to legacy protocol transparently. You can have a hybrid arrangement where some clients use legacy protocol and some use orbflow no problem. As you might imagine this can quickly become complex so please yell up if any edge cases don't seem to work correctly! -ORBTrace, the FPGA based trace interface dongle, has now been moved into its own separate repository as it's grown considerably and really needs its own identity. History for ORBtrace until the split point is maintained here for provenance purposes, but new work is now done over in the new location. +For the full benefit of this version you should be using ORBTrace mini Version 1.4.0 or higher. The CHANGES file now tells you what's been done recently. @@ -87,7 +87,7 @@ typos, it really does run that fast if you've got suitable hardware. Whatever it's source, orbuculum takes this data flow and makes it accessible to tools on the host PC. At its core it takes the data from the source, decodes it and presents it on a network -interface. The Orbuculum suite tools don't care if the data +interface...both orbflow and legacy protocol are available. The Orbuculum suite tools don't care if the data originates from a RZ or NRZ port, SWO or TRACE, or at what speed....that's all the job of the interface. @@ -103,7 +103,7 @@ from the target; * The ECPIX-5 ECP5 Breakout Board for parallel trace * Anything capable of saving the raw SWO data to a file * Anything capable of offering SWO on a TCP port -* ORBTrace Mini +* ORBTrace Mini (V1.4.0 or higher for orbflow support) Note that current support for the ECPIX-5 breakout board is based on the original bob, the designs for which are in the orbtrace_hw repository. bob2 support will be added when we get around to it (probably when we decide we @@ -120,19 +120,21 @@ of the use of the orbuculum suite at [Orbcode](https://orbcode.org). When using SWO Orbuculum can use, or bypass, the TPIU. The TPIU adds overhead to the datastream, but provides better synchronisation if there is corruption -on the link. To include the TPIU in decode stack, provide the -t +on the link. To include the TPIU in decode stack, provide the -T option on the command line. If you don't provide it, and the ITM decoder sees TPIU syncs in the datastream, it will complain and barf out. This is deliberate -after I spent two days trying to find an obscure bug 'cos I'd left the `-t` option off. You can have multiple -channels to the `-t` option, which is useful when you've got debug data in one stream and -trace data in another. +after I spent two days trying to find an obscure bug 'cos I'd left the `-T` option off. If you don't specify, then +only TPIU stream 1 is decoded over legacy protocol, use the `-tx` option to add additional streams. If you have an +end to end orbflow configuration with the probe stripping the TPIU framing then all streams are passed transparently +throughout the system. -Beware that in parallel trace the TPIU is mandatory, so therefore so is the -t option. +Beware that in parallel trace the TPIU is mandatory...it must be stripped somewhere in the system; Either by the probe or by `orbuculum`. -TPIU framing can be stripped either -by individual applications or the `orbuculum` mux. When its stripped by the mux the data are made available on +TPIU framing can be stripped in the probe or the `orbuculum` mux. For legacy applications orbuculum makes the data available on consecutive TCP/IP ports...so `-t 1,2` would put stream 1 data out over TCP port 3443 and stream 2 over 3444, by default. Do -not leave the first number out if you only want output from the second stream...that won't end well. +not leave the first number out if you only want output from the second stream...that won't end well. orbflow (on port 3402 by default) +supports all streams simultaneously, putting them under separate 'tags'. Historically, clients could independently strip TPIU too, but +that functionality has been removed in the name of simplification. When in NRZ (UART) mode the SWO data rate that comes out of the chip _must_ match the rate that the debugger expects. On the BMP speeds of @@ -268,8 +270,6 @@ A udev rules files is included in ```Support/60-orbcode.rules``` The default ins Building on OSX =============== -Recipe instructions courtesy of FrankTheTank; - * `brew install libusb zmq sdl2` If you are on an Intel Mac: @@ -364,7 +364,7 @@ However, times have moved on. Passing all those data through transparently was w was 'nothing to see here', so Orbuculum now supports a new protocol, orbflow (OFLOW). Orbflow is always carried on TCP/3402 and is a bit more intelligent than simply passing through the messages from the probe. It turns the stream of data into COBS encoded sequenced messages with defined message boundries and it also removes the redundant data. When used -in conjunction with an ORBTrace probe the orbflow messages are created in the probe itself, providing a further +in conjunction with an ORBTrace 1.4.0 or higher probe the orbflow messages are created in the probe itself, providing a further performance improvement. Basically, all of this is mostly transparent to the regular end user. Orbflow is automatically used for communication @@ -374,10 +374,15 @@ improvement, but it's otherwise mostly transparent. There are come slight changes to the command line options though. Historically, when using TPIU decoding, you had to specify the channels to be decoded with an option like `-T 1,2`. You now simply need to tell orbuculum -which tags to process with `-t 1,2` and, if your probe doesn't remove TPIU framing automatically, specify the `-T` +which tags to reflect over legacy protocol using `-t 1,2` and, if your probe doesn't remove TPIU framing automatically, specify the `-T` option on its own....if you try to specify the `-T` option and you've got an ORBTrace that supports Orbflow protocol then you'll get a warning, because TPIU framing removal is done automatically in the probe in that case, so you -don't generally need it. +don't generally need it....it's still possible to do it because there are some edge cases where it's useful, but you will +know why you need it if you need it, and you'll know to ignore the warning. If you're using end-to-end orbflow then you can +ignore the `-T` and `-tx` options altogether, although you might still need to tell the client which tag to access. + +Note that individual clients cannot now strip TPIU. This was an unusual requirement and it can still be met by piping via +`orbuculum` first. This results in a simplification of the clients. Why have we made this change? Well, decoding TPIU on the probe saves a huge amount of bandwidth, and moving to the tag based approach lets us convey other information from the probe too such as timestamps, voltages and currents. @@ -397,8 +402,8 @@ to run orbuculum would be; In this case, because no source options were provided on the command line, input will be taken from a Blackmagic probe USB SWO feed, or from an ORBTrace mini if it can find one. -It will start the daemon with a monitor reporting interval of 100ms. Orbuculum exposes TCP port 3443 to which -network clients can connect. This port delivers raw TPIU frames to any +It will start the daemon with a monitor reporting interval of 100ms. Orbuculum exposes TCP ports 3402 and 3443 to which +network clients can connect. 3402 delivers orbflow, 3443+x deliver raw frames. Both will relay to any client that is connected (such as orbcat, orbfifo or orbtop). The practical limit to the number of clients that can connect is set by the speed of the host machine....but there's nothing stopping you using another one on the local network :-) If you've got an orbtrace mini and you want @@ -406,7 +411,8 @@ to switch on power to your target and configure it for Manchester SWO, a suitabl ```$ orbuculum --monitor 1000 --orbtrace '-p vtref,3.3 -e vtref,on'``` -...this will re-initialise the probe if it gets disconnected at any time. +...this will re-initialise the probe if it gets disconnected at any time. Note that the `--orbtrace` bit is providing options through to +the `orbtrace` application, so you need to look at the command line options for that to make sensible selections. Information about command line options can be found with the -h option. Orbuculum itself is specifically designed to be 'hardy' to probe and @@ -438,9 +444,9 @@ For `orbuculum`, the specific command line options of note are; `-h, --help`: Brief help. - `-H, --hires`: Use high resolution time. This limits probe interface timeouts to 1ms, which makes host-side timing more accurate, but at the expense of _much_ higher load (literally perhaps x100). Use sparingly. + `-H, --hires`: Use high resolution time. This limits probe interface timeouts to 1ms, which makes host-side timing more accurate, but at the expense of _much_ higher load (literally perhaps x100). Use sparingly. DEPRECIATED AND PROBABLY UNNEEDED. - `-m, --monitor`: Monitor interval (in ms) for reporting on state of the link. If baudrate is specified (using `-a`) and is greater than 100bps then the percentage link occupancy is also reported. + `-m, --monitor`: Monitor interval (in ms) for reporting on state of the link. If baudrate is specified (using `-a`) and is greater than 100bps then the percentage link occupancy is also reported. Minimum of 500ms. `-n, --serial-number`: Set a specific serial number for the ORBTrace or BMP device to connect to. Any unambigious sequence is sufficient. Ignored for other probe types. @@ -454,9 +460,9 @@ For `orbuculum`, the specific command line options of note are; `-s, --server [address]:[port]`: Set address for explicit TCP Source connection, (default none:2332). - `-T, --tpiu`: Remove TPIU formatting from incoming data stream. + `-T, --tpiu`: Remove TPIU formatting from incoming data stream. TPIU is removed from tag 1 when source is an ORBTrace mini 1.4.0 or higher. - `-t, --tag x,y,...`: List of streams to decode (and onward route) from the probe (low stream numbers are TPIU channels). *By default only stream 1 (ITM) is routed.* + `-t, --tag x,y,...`: List of streams to decode (and onward route) from the probe (low stream numbers are TPIU channels). *By default only stream 1 (ITM) is routed over legacy protocol.* Orbfifo @@ -526,9 +532,6 @@ The command line options are; `-s [address]:[port]`: Set address for Source connection, (default localhost:3443). - `-t, --tpiu`: Use TPIU decoder. This will not sync if TPIU is not configured, so you won't see - packets in that case. - `-v, --verbose`: Verbose mode 0==Errors only, 1=Warnings (Default) 2=Info, 3=Full Debug. `-W, --writer-path [path]` : Enable filewriter functionality with output in specified directory (disabled by default). @@ -582,7 +585,7 @@ Command line options are: `-s, --server [server]:[port]`: to connect to - `-t, --tpiu [channel]`: Use TPIU decoder on specified channel (normally 1) + `-t, --tag [numberl]`: Specify tag to decode (normally 1) `-v, --verbose [level]`: Verbose mode 0(errors)..3(debug) @@ -639,7 +642,7 @@ make GRAPHIC_LIBRARY=ORBLCD `-S, --sbcolour [Colour]`: to be used for single bit renders, ignored for other bit depths. - `-t, --tpiu [channel]`: Use TPIU decoder on specified channel (normally 1). + `-t, --tag [number]`: Decode specified tag (normally 1). `-v, --verbose [level]`: Verbose mode 0(errors)..3(debug). @@ -691,8 +694,7 @@ options for orbcat are; `-s --server [server]:[port]`: to connect to. Defaults to `localhost:3443` to connect to the orbuculum daemon. Use `localhost:2332` to connect to a Segger J-Link, or whatever other combination applies to your source. - `-t, --tpiu`: Use TPIU decoder. This will not sync if TPIU is not configured, so you won't see - packets in that case. + `-t, --tag [number]`: Specify tag to decode. `-T, --timestamp [a|r|d|s|t]`: Add absolute, relative (to session start), delta, system timestamp or system timestamp delta to output. Note that system timestamp and system timestamp delta are only available if your target is generating timestamps, otherwise they will read back @@ -762,8 +764,7 @@ Command line options for orbtop are; `-s, --server [server]:[port]`: to connect to. Defaults to localhost:3443 - `-t, --tpiu`: Use TPIU decoder. This will not sync if TPIU is not configured, so you won't see - packets in that case. + `-t, --tag [number]`: Specify tag to decode. Defaults to 1. `-v, --verbose [x]`: Verbose mode 0..3. @@ -834,7 +835,7 @@ The command line options of note are; `-s, --server [Server:Port]`: to use - `-t, --tpiu [channel]`: Use TPIU to strip TPIU on specfied channel (normally best to let `orbuculum` handle this + `-t, --tag [number]`: Specify tag to decode, defaults to 2. Once it's running you will receive an indication at the lower right of the screen that it's capturing data. Hitting `H` will hold the capture and it will decode whatever is currently in the buffer. More usefully, if the capture stream is lost (e.g. because of debugger entry) then it will auto-hold and decode the buffer, showing you the last instructions executed. You can use the arrow keys to move around this buffer and dive into individual source files. Hit the `?` key for a quick overview of available commands. @@ -929,7 +930,7 @@ from channel 4, an orbcat line such as this would do the job; ...its obvious that the formatting of this buffer is completely dependent on the order in which data arrive from the target, so you -might want to put some 'tags' or differentiators into each channel to +might want to put some differentiators into each channel to keep them distinct - a typical mechanism might be to use commas to seperate the flows into different columns in a CSV file. diff --git a/Src/itmfifos.c b/Src/itmfifos.c index d71746a6..cc48c91a 100644 --- a/Src/itmfifos.c +++ b/Src/itmfifos.c @@ -19,7 +19,6 @@ #include "git_version_info.h" #include "generics.h" -#include "tpiuDecoder.h" #include "itmDecoder.h" #include "oflow.h" #include "fileWriter.h" @@ -59,8 +58,6 @@ struct itmfifosHandle /* The decoders and the packets from them */ struct ITMDecoder i; struct ITMPacket h; - struct TPIUDecoder t; - struct TPIUPacket p; struct OFLOW ot; enum timeDelay timeStatus; /* Indicator of if this time is exact */ uint64_t timeStamp; /* Latest received time */ @@ -73,7 +70,7 @@ struct itmfifosHandle bool filewriter; /* Is the filewriter in use? */ bool forceITMSync; /* Is ITM to be forced into sync? */ bool permafile; /* Use permanent files rather than fifos */ - int tag; /* Which OFLOW or TPIU stream are we decoding? */ + int tag; /* Which OFLOW stream are we decoding? */ bool amEnding; /* Flag indicating end is in progress */ enum Prot protocol; /* What protocol to communicate (default to OFLOW (== orbuculum)) */ @@ -492,65 +489,6 @@ void _itmPumpProcess( struct itmfifosHandle *f, char c ) // ------------------------------------ } } -// ==================================================================================================== -static void _tpiuProtocolPump( struct itmfifosHandle *f, uint8_t c ) - -{ - switch ( TPIUPump( &f->t, c ) ) - { - // ------------------------------------ - case TPIU_EV_NEWSYNC: - genericsReport( V_INFO, "TPIU In Sync (%d)" EOL, TPIUDecoderGetStats( &f->t )->syncCount ); - - // This fall-through is deliberate - case TPIU_EV_SYNCED: - - ITMDecoderForceSync( &f->i, true ); - break; - - // ------------------------------------ - case TPIU_EV_RXING: - case TPIU_EV_NONE: - break; - - // ------------------------------------ - case TPIU_EV_UNSYNCED: - genericsReport( V_INFO, "TPIU Lost Sync (%d)" EOL, TPIUDecoderGetStats( &f->t )->lostSync ); - ITMDecoderForceSync( &f->i, false ); - break; - - // ------------------------------------ - case TPIU_EV_RXEDPACKET: - if ( !TPIUGetPacket( &f->t, &f->p ) ) - { - genericsReport( V_WARN, "TPIUGetPacket fell over" EOL ); - } - - for ( uint32_t g = 0; g < f->p.len; g++ ) - { - if ( f->p.packet[g].s == f->tag ) - { - _itmPumpProcess( f, f->p.packet[g].d ); - continue; - } - - /* Its perfectly legal for TPIU channels to arrive that we aren't interested in */ - if ( ( f->p.packet[g].s != 0 ) && ( f->p.packet[g].s != 0x7f ) ) - { - genericsReport( V_INFO, "Unhandled TPIU channel %02x" EOL, f->p.packet[g].s ); - } - } - - break; - - // ------------------------------------ - case TPIU_EV_ERROR: - genericsReport( V_ERROR, "****ERROR****" EOL ); - break; - // ------------------------------------ - } -} - // ==================================================================================================== static void _OFLOWpacketRxed ( struct OFLOWFrame *p, void *param ) @@ -685,12 +623,6 @@ int itmfifoGettag( struct itmfifosHandle *f ) return f->tag; } // ==================================================================================================== -struct TPIUCommsStats *itmfifoGetCommsStats( struct itmfifosHandle *f ) - -{ - return TPIUGetCommsStats( &f->t ); -} -// ==================================================================================================== struct ITMDecoderStats *fifoGetITMDecoderStats( struct itmfifosHandle *f ) { @@ -712,24 +644,16 @@ void itmfifoProtocolPump( struct itmfifosHandle *f, uint8_t *c, int len ) else while ( len-- ) { - if ( PROT_TPIU == f->protocol ) - { - _tpiuProtocolPump( f, *c++ ); - } - else - { - /* There's no TPIU in use, so this goes straight to the ITM layer */ - _itmPumpProcess( f, *c++ ); - } + /* There's no TPIU in use, so this goes straight to the ITM layer */ + _itmPumpProcess( f, *c++ ); } } // ==================================================================================================== void itmfifoForceSync( struct itmfifosHandle *f, bool synced ) -/* Reset TPIU state and put ITM into defined state */ +/* Reset and put ITM into defined state */ { - TPIUDecoderForceSync( &f->t, 0 ); ITMDecoderForceSync( &f->i, synced ); } // ==================================================================================================== @@ -743,8 +667,7 @@ bool itmfifoCreate( struct itmfifosHandle *f ) /* Make sure there's an initial timestamp to work with */ f->lastHWExceptionTS = genericsTimestampuS(); - /* Reset the TPIU handler before we start */ - TPIUDecoderInit( &f->t ); + /* Reset the handler before we start */ OFLOWInit( &f->ot ); ITMDecoderInit( &f->i, f->forceITMSync ); diff --git a/Src/orbcat.c b/Src/orbcat.c index 0ec81c1a..cf28ac7c 100644 --- a/Src/orbcat.c +++ b/Src/orbcat.c @@ -21,7 +21,6 @@ #include "nw.h" #include "git_version_info.h" #include "generics.h" -#include "tpiuDecoder.h" #include "itmDecoder.h" #include "msgDecoder.h" #include "msgSeq.h" @@ -51,8 +50,8 @@ enum TSType { TSNone, TSAbsolute, TSRelative, TSDelta, TSStamp, TSStampDelta, TSNumTypes }; -enum Prot { PROT_OFLOW, PROT_ITM, PROT_TPIU, PROT_UNKNOWN }; -const char *protString[] = {"OFLOW", "ITM", "TPIU", NULL}; +enum Prot { PROT_OFLOW, PROT_ITM, PROT_UNKNOWN }; +const char *protString[] = {"OFLOW", "ITM", NULL}; const char *tsTypeString[TSNumTypes] = { "None", "Absolute", "Relative", "Delta", "System Timestamp", "System Timestamp Delta" }; @@ -60,7 +59,7 @@ const char *tsTypeString[TSNumTypes] = { "None", "Absolute", "Relative", "Delta" struct { /* Config information */ - uint32_t tag; /* Which TPIU or OFLOW stream are we decoding? */ + uint32_t tag; /* Which OFLOW tag are we decoding? */ bool forceITMSync; uint64_t cps; /* Cycles per second for target CPU */ @@ -95,11 +94,9 @@ struct struct ITMDecoder i; struct MSGSeq d; struct ITMPacket h; - struct TPIUDecoder t; struct OFLOW c; struct Frame cobsPart; /* Any part frame that has been received */ - struct TPIUPacket p; /* Any TPIU packet that has been recevied */ enum timeDelay timeStatus; /* Indicator of if this time is exact */ uint64_t timeStamp; /* Latest received time */ uint64_t lastTimeStamp; /* Last received time */ @@ -548,59 +545,6 @@ static void _itmPumpProcess( char c ) // ==================================================================================================== // ==================================================================================================== // ==================================================================================================== -static void _protocolPump( uint8_t c ) - -{ - if ( options.protocol == PROT_TPIU ) - { - switch ( TPIUPump( &_r.t, c ) ) - { - case TPIU_EV_NEWSYNC: - case TPIU_EV_SYNCED: - ITMDecoderForceSync( &_r.i, true ); - break; - - case TPIU_EV_RXING: - case TPIU_EV_NONE: - break; - - case TPIU_EV_UNSYNCED: - ITMDecoderForceSync( &_r.i, false ); - break; - - case TPIU_EV_RXEDPACKET: - if ( !TPIUGetPacket( &_r.t, &_r.p ) ) - { - genericsReport( V_WARN, "TPIUGetPacket fell over" EOL ); - } - - for ( uint32_t g = 0; g < _r.p.len; g++ ) - { - if ( _r.p.packet[g].s == options.tag ) - { - _itmPumpProcess( _r.p.packet[g].d ); - continue; - } - - if ( _r.p.packet[g].s != 0 ) - { - genericsReport( V_DEBUG, "Unknown TPIU channel %02x" EOL, _r.p.packet[g].s ); - } - } - - break; - - case TPIU_EV_ERROR: - genericsReport( V_WARN, "****ERROR****" EOL ); - break; - } - } - else - { - _itmPumpProcess( c ); - } -} -// ==================================================================================================== static void _printHelp( const char *const progName ) @@ -614,10 +558,9 @@ static void _printHelp( const char *const progName ) fprintf( stdout, " -g, --trigger: to use to trigger timestamp (default is newline)" EOL ); fprintf( stdout, " -h, --help: This help" EOL ); fprintf( stdout, " -n, --itm-sync: Enforce sync requirement for ITM (i.e. ITM needs to issue syncs)" EOL ); - fprintf( stdout, " -p, --protocol: Protocol to communicate. Defaults to OFLOW if -s is not set, otherwise ITM unless" EOL \ - " explicitly set to TPIU to decode TPIU frames on channel set by -t" EOL ); + fprintf( stdout, " -p, --protocol: Protocol to communicate. Defaults to OFLOW if -s is not set, otherwise ITM" EOL ); fprintf( stdout, " -s, --server: : to use" EOL ); - fprintf( stdout, " -t, --tag: : Which TPIU stream or OFLOW tag to use (normally 1)" EOL ); + fprintf( stdout, " -t, --tag: : Which orbflow tag to use (normally 1)" EOL ); fprintf( stdout, " -T, --timestamp: : Add absolute, relative (to session start)," EOL " delta, system timestamp or system timestamp delta to output. Note" EOL " a,r & d are host dependent and you may need to run orbuculum with -H." EOL ); @@ -643,7 +586,7 @@ static struct option _longOptions[] = {"itm-sync", no_argument, NULL, 'n'}, {"protocol", required_argument, NULL, 'p'}, {"server", required_argument, NULL, 's'}, - {"tpiu", required_argument, NULL, 't'}, + {"tag", required_argument, NULL, 't'}, {"timestamp", required_argument, NULL, 'T'}, {"verbose", required_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, @@ -893,7 +836,7 @@ bool _processOptions( int argc, char *argv[] ) options.protocol = PROT_ITM; } - if ( ( options.protocol == PROT_TPIU ) && !portExplicit ) + if ( ( options.protocol == PROT_ITM ) && !portExplicit ) { options.port = NWCLIENT_SERVER_PORT; } @@ -940,10 +883,6 @@ bool _processOptions( int argc, char *argv[] ) genericsReport( V_INFO, "Decoding ITM" EOL ); break; - case PROT_TPIU: - genericsReport( V_INFO, "Using TPIU with ITM in stream %d" EOL, options.tag ); - break; - default: genericsReport( V_INFO, "Decoding unknown" EOL ); break; @@ -1031,12 +970,12 @@ static void _feedStream( struct Stream *stream ) } else { - /* Both ITM and TPIU go directly through the protocol pump */ + /* ITM goes directly through the protocol pump */ unsigned char *c = cbw; while ( receivedSize-- ) { - _protocolPump( *c++ ); + _itmPumpProcess( *c++ ); } } @@ -1072,8 +1011,7 @@ int main( int argc, char *argv[] ) exit( -1 ); } - /* Reset the TPIU handler before we start */ - TPIUDecoderInit( &_r.t ); + /* Reset the handlers before we start */ ITMDecoderInit( &_r.i, options.forceITMSync ); OFLOWInit( &_r.c ); MSGSeqInit( &_r.d, &_r.i, MSG_REORDER_BUFLEN ); diff --git a/Src/orbfifo.c b/Src/orbfifo.c index 910f5960..e74f5dc2 100644 --- a/Src/orbfifo.c +++ b/Src/orbfifo.c @@ -29,7 +29,7 @@ #include "itmfifos.h" -const char *protString[] = {"OFLOW", "ITM", "TPIU", NULL}; +const char *protString[] = {"OFLOW", "ITM", NULL}; //#define DUMP_BLOCK @@ -79,10 +79,9 @@ static void _printHelp( const char *const progName ) genericsPrintf( " -h, --help: This help" EOL ); genericsPrintf( " -M, --no-colour: Supress colour in output" EOL ); genericsPrintf( " -P, --permanent: Create permanent files rather than fifos" EOL ); - genericsPrintf( " -p, --protocol: Protocol to communicate. Defaults to OFLOW if -s is not set, otherwise ITM unless" EOL \ - " explicitly set to TPIU to decode TPIU frames on stream set by -t" EOL ); + genericsPrintf( " -p, --protocol: Protocol to communicate. Defaults to OFLOW if -s is not set, otherwise ITM" EOL ); genericsPrintf( " -s, --server: : to use" EOL ); - genericsPrintf( " -t, --tag: Which TPIU stream or OFLOW tag to use (normally 1)" EOL ); + genericsPrintf( " -t, --tag: Which OFLOW tag to use (normally 1)" EOL ); genericsPrintf( " -v, --verbose: Verbose mode 0(errors)..3(debug)" EOL ); genericsPrintf( " -V, --version: Print version and exit" EOL ); genericsPrintf( " -W, --writer-path: Enable filewriter functionality using specified base path" EOL ); @@ -334,7 +333,7 @@ static bool _processOptions( int argc, char *argv[] ) itmfifoSetProtocol( _r.f, PROT_ITM ); } - if ( ( itmfifoGetProtocol( _r.f ) == PROT_TPIU ) && !portExplicit ) + if ( ( itmfifoGetProtocol( _r.f ) == PROT_ITM ) && !portExplicit ) { options.port = NWCLIENT_SERVER_PORT; } @@ -369,10 +368,6 @@ static bool _processOptions( int argc, char *argv[] ) genericsReport( V_INFO, "Decoding ITM" EOL ); break; - case PROT_TPIU: - genericsReport( V_INFO, "Using TPIU with ITM in stream %d" EOL, itmfifoGettag( _r.f ) ); - break; - default: genericsReport( V_INFO, "Decoding unknown" EOL ); break; @@ -453,7 +448,7 @@ int main( int argc, char *argv[] ) struct timeval tv; uint64_t remainTime; - /* Setup fifos with forced ITM sync, no TPIU and TPIU on channel 1 if its engaged later */ + /* Setup fifos with forced ITM sync, tag 1 */ _r.f = itmfifoInit( true, false, 1 ); assert( _r.f );