Skip to content

Commit

Permalink
FlowMeasurementRecorder: Fixed packet offset and length for mapAllReg…
Browse files Browse the repository at this point in the history
…ionTags which is total packet relative, not packet data relative.
  • Loading branch information
levy committed Nov 27, 2023
1 parent 9fa6f8c commit 4d641e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/inet/queueing/flow/FlowMeasurementRecorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void FlowMeasurementRecorder::makeMeasurements(Packet *packet)
void FlowMeasurementRecorder::endMeasurements(Packet *packet)
{
std::set<std::string> endedFlowNames;
b length = this->length == b(-1) ? packet->getDataLength() - offset : this->length;
b length = this->length == b(-1) ? packet->getTotalLength() - offset : this->length;
if (measureElapsedTime)
endMeasurement<ElapsedTimeTag>(packet, offset, length);
if (measureDelayingTime)
Expand All @@ -106,7 +106,7 @@ void FlowMeasurementRecorder::endMeasurements(Packet *packet)
packet->peekAll()->printToStream(s, 0);
packetEventFile.writeString("packetData", s.str());
packetEventFile.openArray("lifeTimes");
packet->peekData()->mapAllTags<CreationTimeTag>(offset, length, [&] (b o, b l, const Ptr<const CreationTimeTag>& creationTimeTag) {
packet->peekData()->mapAllTags<CreationTimeTag>(b(0), b(-1), [&] (b o, b l, const Ptr<const CreationTimeTag>& creationTimeTag) {
simtime_t lifeTime = simTime() - creationTimeTag->getCreationTime();
packetEventFile.openObject();
packetEventFile.writeInt("offset", b(o).get());
Expand Down

0 comments on commit 4d641e2

Please sign in to comment.