Commit 518bac8b authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Update time-apps.

parent 1799a7be
Loading
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ int main(int argc, char **argv) {
    }
    #endif

    long long int *rtts = calloc((size_t) rounds, sizeof(uint64_t));

    s = PrrtSocket_create(false, HALF_TIMESTAMP-1);
    check(s != NULL, "Could not create socket.");

@@ -119,20 +121,26 @@ int main(int argc, char **argv) {
    while (i < rounds && keepRunning) {
        char buffer[MAX_PAYLOAD_LENGTH + 1];
        debug(DEBUG_RECEIVER, "About to receive.");
        int n = PrrtSocket_receive_ordered_wait(s, buffer, 10 * 1000);
        int n = PrrtSocket_receive_asap_wait(s, buffer);
        if (n < 0) {
            continue;
        }
		struct timespec now, old;
        int round = 0;
		struct timespec now;
        struct timespec * old;
		clock_gettime(CLOCK_REALTIME, &now);
        sscanf(buffer, "%10d", &round);
        old = (struct timespec *) (buffer + 20);

		memcpy(&old, buffer, sizeof(struct timespec));

		fprintf(stderr, "%u: %lli\n", i, timedelta(&now, &old));

        rtts[round] = timedelta(&now, old);
        i++;
    }

    for (i = 0; i < rounds; i++) {
        fprintf(out_desc, "%u, %lli\n", i, rtts[i]);
    }


    XlapTimestampTableDumpHeader(out_desc);
    XlapTimestampTableDump(out_desc, ts_data_packet, tstable_data);
    XlapTimestampTableDump(out_desc, ts_redundancy_packet, tstable_redundancy);
+4 −3
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ int main(int argc, char **argv) {
    #endif


    PrrtSocket *s = PrrtSocket_create(true, 250 * 1000);
    PrrtSocket *s = PrrtSocket_create(true, 500 * 1000);
    check(s != NULL, "Socket create failed.");

    if(arguments.thread_pinning) {
@@ -125,13 +125,14 @@ int main(int argc, char **argv) {
    XlapTimestampTableInstall(s, ts_redundancy_packet, tstable_redundancy);

    uint32_t j = 0;
    char buf[1500];
    char buf[150];
	memset(buf, 0x0, sizeof(buf));
	assert(sizeof(buf) >= sizeof(struct timespec));
    while (j < rounds) {
		struct timespec now;
		clock_gettime(CLOCK_REALTIME, &now);
		memcpy(buf, &now, sizeof(struct timespec));
        sprintf(buf, "%10d", j);
		memcpy(buf + 20, &now, sizeof(struct timespec));

        PrrtSocket_send(s, (unsigned char *) buf, sizeof(buf));