Commit bf36d136 authored by Andreas Schmidt's avatar Andreas Schmidt

Add channel time in evaluation.

parent 518bac8b
Pipeline #2081 failed with stages
in 22 seconds
......@@ -282,6 +282,7 @@ void *receive_data_loop(void *ptr) {
prrtPacketType_t packetType = PrrtPacket_type(packet);
debug(DEBUG_DATARECEIVER, "received packet %d:%u", (int) packetType, seqno);
packet->channelReceive = packet_recv_timestamp;
enum XlapTimestampPacketKind kind = ts_any_packet;
prrtTimestamp_t sentTimestamp;
......
......@@ -20,6 +20,7 @@
#include "socket.h"
static inline prrtPacketLength_t deliver_packet(const PrrtSocket *s, void *buffer, PrrtPacket *packet) {
size_t timespec_size = sizeof(struct timespec);
prrtPacketLength_t len = 0;
if(packet != NULL) {
XlapTimeStampClock(s, ts_data_packet, packet->sequenceNumber, PrrtReceivePackage);
......@@ -28,6 +29,9 @@ static inline prrtPacketLength_t deliver_packet(const PrrtSocket *s, void *buffe
len = (prrtPacketLength_t) (packet->payloadLength - PRRT_PACKET_DATA_HEADER_SIZE);
XlapTimeStampCycle(s, ts_data_packet, packet->sequenceNumber, CopyOutputStart);
PrrtPacket_copy_payload_to_buffer(buffer, packet, PRRT_PACKET_DATA_HEADER_SIZE);
memcpy(buffer + len, &packet->channelReceive, timespec_size);
len += timespec_size;
XlapTimeStampCycle(s, ts_data_packet, packet->sequenceNumber, CopyOutputEnd);
XlapTimeStampClock(s, ts_data_packet, packet->sequenceNumber, PrrtDeliver);
......
......@@ -38,6 +38,7 @@ typedef struct prrtPacket {
prrtIndex_t index;
prrtSequenceNumber_t sequenceNumber;
void *payload;
struct timespec channelReceive;
prrtPacketLength_t payloadLength;
// Packet State field that are not put into the packet on the wire
......
......@@ -99,7 +99,7 @@ int main(int argc, char **argv) {
}
#endif
long long int *rtts = calloc((size_t) rounds, sizeof(uint64_t));
long long int *rtts = calloc((size_t) rounds, sizeof(long long int));
s = PrrtSocket_create(false, HALF_TIMESTAMP-1);
check(s != NULL, "Could not create socket.");
......@@ -126,13 +126,13 @@ int main(int argc, char **argv) {
continue;
}
int round = 0;
struct timespec now;
struct timespec * old;
clock_gettime(CLOCK_REALTIME, &now);
struct timespec * channel;
sscanf(buffer, "%10d", &round);
old = (struct timespec *) (buffer + 20);
channel = (struct timespec *) (buffer + n - sizeof(struct timespec));
rtts[round] = timedelta(&now, old);
rtts[round] = timedelta(channel, old);
i++;
}
......
......@@ -125,7 +125,7 @@ int main(int argc, char **argv) {
XlapTimestampTableInstall(s, ts_redundancy_packet, tstable_redundancy);
uint32_t j = 0;
char buf[150];
char buf[75];
memset(buf, 0x0, sizeof(buf));
assert(sizeof(buf) >= sizeof(struct timespec));
while (j < rounds) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment