Loading prrt/time-sender.c +9 −5 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ static struct argp_option options[] = { {"port", 'p', "PORT", 0, "Target Port" }, {"local port", 'l', "PORT", 0, "Local Port" }, {"rounds", 'r', "ROUNDS", 0, "Rounds" }, {"size", 's', "SIZE", 0, "Size" }, {"output", 'o', "FILE", 0, "Output to FILE instead of standard output" }, {"threadpinning", 'T', 0, 0, "Enable thread pinning"}, {"pacing", 'P', 0, 0, "Enable pacing"}, Loading @@ -25,6 +26,7 @@ static struct arguments uint16_t port; uint16_t local_port; uint16_t rounds; uint16_t size; char* outfile; bool thread_pinning; bool pacing; Loading @@ -45,6 +47,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) case 'p': arguments->port = (uint16_t) strtol(arg, &pEnd, 10); break; case 's': arguments->size = (uint16_t) strtol(arg, &pEnd, 10); break; case 'P': arguments->pacing = true; break; Loading Loading @@ -77,6 +82,7 @@ int main(int argc, char **argv) { .target = "127.0.0.1", .port = 5000, .local_port = 6000, .size = 1500, .rounds = 127, .pacing = false, .outfile = "-", Loading Loading @@ -125,9 +131,9 @@ int main(int argc, char **argv) { XlapTimestampTableInstall(s, ts_redundancy_packet, tstable_redundancy); uint32_t j = 0; char buf[6250]; memset(buf, 0x0, sizeof(buf)); assert(sizeof(buf) >= sizeof(struct timespec)); uint16_t buffer_size = arguments.size; char* buf = calloc(buffer_size, sizeof(char)); assert(sizeof(buf) >= 2* sizeof(struct timespec) + 20); while (j < rounds) { struct timespec now; clock_gettime(CLOCK_REALTIME, &now); Loading @@ -137,8 +143,6 @@ int main(int argc, char **argv) { PrrtSocket_send(s, (unsigned char *) buf, sizeof(buf)); j++; // Send every 100us, as this is a sensible packet interval. //usleep_nano(100); } sleep_nano(10); Loading Loading
prrt/time-sender.c +9 −5 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ static struct argp_option options[] = { {"port", 'p', "PORT", 0, "Target Port" }, {"local port", 'l', "PORT", 0, "Local Port" }, {"rounds", 'r', "ROUNDS", 0, "Rounds" }, {"size", 's', "SIZE", 0, "Size" }, {"output", 'o', "FILE", 0, "Output to FILE instead of standard output" }, {"threadpinning", 'T', 0, 0, "Enable thread pinning"}, {"pacing", 'P', 0, 0, "Enable pacing"}, Loading @@ -25,6 +26,7 @@ static struct arguments uint16_t port; uint16_t local_port; uint16_t rounds; uint16_t size; char* outfile; bool thread_pinning; bool pacing; Loading @@ -45,6 +47,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) case 'p': arguments->port = (uint16_t) strtol(arg, &pEnd, 10); break; case 's': arguments->size = (uint16_t) strtol(arg, &pEnd, 10); break; case 'P': arguments->pacing = true; break; Loading Loading @@ -77,6 +82,7 @@ int main(int argc, char **argv) { .target = "127.0.0.1", .port = 5000, .local_port = 6000, .size = 1500, .rounds = 127, .pacing = false, .outfile = "-", Loading Loading @@ -125,9 +131,9 @@ int main(int argc, char **argv) { XlapTimestampTableInstall(s, ts_redundancy_packet, tstable_redundancy); uint32_t j = 0; char buf[6250]; memset(buf, 0x0, sizeof(buf)); assert(sizeof(buf) >= sizeof(struct timespec)); uint16_t buffer_size = arguments.size; char* buf = calloc(buffer_size, sizeof(char)); assert(sizeof(buf) >= 2* sizeof(struct timespec) + 20); while (j < rounds) { struct timespec now; clock_gettime(CLOCK_REALTIME, &now); Loading @@ -137,8 +143,6 @@ int main(int argc, char **argv) { PrrtSocket_send(s, (unsigned char *) buf, sizeof(buf)); j++; // Send every 100us, as this is a sensible packet interval. //usleep_nano(100); } sleep_nano(10); Loading