Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into Devel
Browse files Browse the repository at this point in the history
  • Loading branch information
mubes committed Sep 13, 2019
2 parents c204603 + 054bf3e commit f012c66
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 31 deletions.
11 changes: 8 additions & 3 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ David Piegdon [email protected] *5
Karl Palsson [email protected] *6
David Sidrane [email protected] *7


Note that contributors marked * made some contributions while
Orbuculum was under a GPL licence. Each kindly agreed by email
for their contributions to re-licenced to BSD, MIT or Apache
as selected by Dave Marples in his role as primary author
and maintainer. Email references for each partys' agreement are;
and maintainer. Email references for each partys' agreement are
at the foot of this document.

The Orbuculum broken crystal splash image is based on
work from Michael Scharrer ( https://mscharrer.net ) and
is licenced under a CC-BY-4.0 license
( https://creativecommons.org/licenses/by/4.0/ ).

1:<[email protected]>
2:<CAHeP9+a9YMaShQOHtWkmLFoEktKDwAteBhzRtoaxcRqLH7dd=g@mail.gmail.com>
3:<CADeBD8CUoeiL7a8t1dagMrbkRBMOLQNGt4ex0Cwyxjau26q7hg@mail.gmail.com>
4:Original author
5:<[email protected]>
6:<SNEhLrRZq6gPMjf3d6YLVfAPXo9aiyhfRrxrhIkZ2360@mailpile>
7:<CAGdws1MApisTO72tLC1R712V38uR-Q2867FmQvgm0st7Q_OUew@mail.gmail.com>
7:<CAGdws1MApisTO72tLC1R712V38uR-Q2867FmQvgm0st7Q_OUew@mail.gmail.com>
86 changes: 58 additions & 28 deletions Src/orbtop.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ struct reportLine
struct /* Record for options, either defaults or from command line */
{
bool useTPIU; /* Are we decoding via the TPIU? */
bool json; /* Output in JSON format rather than human readable */
bool reportFilenames; /* Report filenames for each routine? -- not presented via UI, intended for debug */
uint32_t tpiuITMChannel; /* What channel? */
bool forceITMSync; /* Must ITM start synced? */
Expand Down Expand Up @@ -330,7 +331,15 @@ void outputTop( void )
q = fopen( options.logfile, "a" );
}

fprintf( stdout, "\033[2J\033[;H" );
if (!options.json)
{
fprintf( stdout, "\033[2J\033[;H" );
}
else
{
/* Start of frame in JSON format */

}

if ( total )
{
Expand All @@ -350,25 +359,32 @@ void outputTop( void )

if ( ( percentage >= CUTOFF ) && ( ( !options.cutscreen ) || ( n < options.cutscreen ) ) )
{
fprintf( stdout, "%3d.%02d%% %8ld ", percentage / 100, percentage % 100, report[n].count );

dispSamples += report[n].count;

if ( ( options.reportFilenames ) && ( report[n].n->filename ) )
{
fprintf( stdout, "%s::", report[n].n->filename );
}

if ( ( options.lineDisaggregation ) && ( report[n].n->line ) )
{
fprintf( stdout, "%s::%d" EOL, d ? d : report[n].n->function, report[n].n->line );
}
else
{
fprintf( stdout, "%s" EOL, d ? d : report[n].n->function );
}

totPercent += percentage;

if (!options.json)
{
fprintf( stdout, "%3d.%02d%% %8ld ", percentage / 100, percentage % 100, report[n].count );


if ( ( options.reportFilenames ) && ( report[n].n->filename ) )
{
fprintf( stdout, "%s::", report[n].n->filename );
}

if ( ( options.lineDisaggregation ) && ( report[n].n->line ) )
{
fprintf( stdout, "%s::%d" EOL, d ? d : report[n].n->function, report[n].n->line );
}
else
{
fprintf( stdout, "%s" EOL, d ? d : report[n].n->function );
}
}
else
{
/* Output in JSON Format */
}
}

if ( ( p ) && ( n < options.maxRoutines ) && ( percentage >= CUTOFF ) )
Expand Down Expand Up @@ -399,16 +415,24 @@ void outputTop( void )
}
}

fprintf( stdout, "-----------------" EOL );

if ( samples == dispSamples )
{
fprintf( stdout, "%3d.%02d%% %8ld Samples" EOL, totPercent / 100, totPercent % 100, samples );
}
if (!options.json)
{
fprintf( stdout, "-----------------" EOL );

if ( samples == dispSamples )
{
fprintf( stdout, "%3d.%02d%% %8ld Samples" EOL, totPercent / 100, totPercent % 100, samples );
}
else
{
fprintf( stdout, "%3d.%02d%% %8ld of %ld Samples" EOL, totPercent / 100, totPercent % 100, dispSamples, samples );
}
}
else
{
fprintf( stdout, "%3d.%02d%% %8ld of %ld Samples" EOL, totPercent / 100, totPercent % 100, dispSamples, samples );
}
{
/* Close off JSON report */

}

if ( p )
{
Expand Down Expand Up @@ -657,6 +681,7 @@ void _printHelp( char *progName )
fprintf( stdout, " h: This help" EOL );
fprintf( stdout, " i: <channel> Set ITM Channel in TPIU decode (defaults to 1)" EOL );
fprintf( stdout, " I: <interval> Display interval in milliseconds (defaults to %d mS)" EOL, TOP_UPDATE_INTERVAL );
fprintf( stdout, " j: Output in JSON format" EOL);
fprintf( stdout, " l: Aggregate per line rather than per function" EOL );
fprintf( stdout, " n: Enforce sync requirement for ITM (i.e. ITM needs to issue syncs)" EOL );
fprintf( stdout, " o: <filename> to be used for output live file" EOL );
Expand All @@ -671,7 +696,7 @@ int _processOptions( int argc, char *argv[] )
{
int c;

while ( ( c = getopt ( argc, argv, "c:d:De:g:hi:I:lm:no:r:s:tv:" ) ) != -1 )
while ( ( c = getopt ( argc, argv, "c:d:De:g:hi:I:jlm:no:r:s:tv:" ) ) != -1 )
switch ( c )
{
// ------------------------------------
Expand Down Expand Up @@ -705,6 +730,11 @@ int _processOptions( int argc, char *argv[] )
break;

// ------------------------------------
case 'j':
options.json = true;
break;

// ------------------------------------
case 'l':
options.lineDisaggregation = true;
break;
Expand Down

0 comments on commit f012c66

Please sign in to comment.