Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions api/textoutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,26 @@ void TextOutput::dumpWindow( Timeline *whichWindow, string& strOutputFile, Progr
outputFile << LabelConstructor::objectLabel( i, whichWindow->getLevel(), trace, false, false ) << "\t";
}

TRecordTime t0 = whichWindow->getBeginTime( i );
TRecordTime t1 = whichWindow->getEndTime( i );

// Clamp the time range
if ( t0 < beginTime )
t0 = beginTime;
if ( t1 > endTime )
t1 = endTime;

TRecordTime dt = t1 - t0;

if( windowTimeUnits )
{
outputFile << whichWindow->traceUnitsToWindowUnits(
whichWindow->getBeginTime( i ) ) << "\t";
outputFile << whichWindow->traceUnitsToWindowUnits(
whichWindow->getEndTime( i ) - whichWindow->getBeginTime( i ) ) << "\t";
outputFile << whichWindow->traceUnitsToWindowUnits( t0 ) << "\t";
outputFile << whichWindow->traceUnitsToWindowUnits( dt ) << "\t";
}
else
{
outputFile << (PRV_UINT64)whichWindow->getBeginTime( i ) << "\t";
outputFile << (PRV_UINT64)( whichWindow->getEndTime( i ) - whichWindow->getBeginTime( i ) ) << "\t";
outputFile << (PRV_UINT64) t0 << "\t";
outputFile << (PRV_UINT64) dt << "\t";
}

if( textualSemantic )
Expand All @@ -145,17 +154,27 @@ void TextOutput::dumpWindow( Timeline *whichWindow, string& strOutputFile, Progr
{
outputFile << LabelConstructor::objectLabel( i, whichWindow->getLevel(), trace, false, false ) << "\t";
}

TRecordTime t0 = whichWindow->getBeginTime( i );
TRecordTime t1 = whichWindow->getEndTime( i );

// Clamp the time range
if ( t0 < beginTime )
t0 = beginTime;
if ( t1 > endTime )
t1 = endTime;

TRecordTime dt = t1 - t0;

if( windowTimeUnits )
{
outputFile << whichWindow->traceUnitsToWindowUnits(
whichWindow->getBeginTime( i ) ) << "\t";
outputFile << whichWindow->traceUnitsToWindowUnits(
whichWindow->getEndTime( i ) - whichWindow->getBeginTime( i ) ) << "\t";
outputFile << whichWindow->traceUnitsToWindowUnits( t0 ) << "\t";
outputFile << whichWindow->traceUnitsToWindowUnits( dt ) << "\t";
}
else
{
outputFile << (PRV_UINT64)whichWindow->getBeginTime( i ) << "\t";
outputFile << (PRV_UINT64)( whichWindow->getEndTime( i ) - whichWindow->getBeginTime( i ) ) << "\t";
outputFile << (PRV_UINT64) t0 << "\t";
outputFile << (PRV_UINT64) dt << "\t";
}

if( textualSemantic )
Expand Down