Commit 6091bae3 authored by Joanne Hugé's avatar Joanne Hugé

Print all integers with fixed width

parent db791847
......@@ -211,15 +211,15 @@ int main(int argc, char *argv[]) {
if (main_param.verbose) {
if (tsn_task == RTT_TASK) {
printf("RTT: %" PRIu64 " (%d)\n", stats->rtt, stats->nb_cycles);
printf("RTT: %*" PRIu64 " (%*d)\n", 10, stats->rtt, 10, stats->nb_cycles);
} else if (enable_timestamps) {
int64_t user_space_time = stats->packet_info.userspace_exit_ts - stats->packet_info.userspace_enter_ts;
int64_t kernel_space_time = stats->packet_info.kernelspace_ts - stats->packet_info.userspace_exit_ts;
printf("(%d) User and kernel space time: %*" PRIi64 ", %" PRIi64 "\n",
stats->nb_cycles, 10, user_space_time, kernel_space_time);
printf("(%*d) User and kernel space time: %*" PRIi64 ", %" PRIi64 "\n",
10, stats->nb_cycles, 10, user_space_time, kernel_space_time);
}
}
......
......@@ -227,19 +227,19 @@ int main(int argc, char *argv[]) {
if (tsn_task == RECV_PACKET_TASK) {
diff = ((int64_t)stats->max_interval) - stats->min_interval;
printf("(%d) Jitter : %" PRIi64 " [Packet data: %s] [Lost packets: %d]\n",
stats->packets_received,
diff,
stats->packet_info.data,
stats->lost_packets);
printf("(%*d) Jitter : %*" PRIi64 " [Packet data: %*s] [Lost packets: %*d]\n",
10, stats->packets_received,
10, diff,
10, stats->packet_info.data,
10, stats->lost_packets);
if (enable_timestamps) {
int64_t user_space_time = stats->packet_info.userspace_exit_ts - stats->packet_info.userspace_enter_ts;
int64_t kernel_space_time = stats->packet_info.kernelspace_ts - stats->packet_info.userspace_exit_ts;
printf("(%d) User and kernel space time: %*" PRIi64 ", %" PRIi64 "\n",
stats->packets_received, 10, user_space_time, kernel_space_time);
printf("(%*d) User and kernel space time: %*" PRIi64 ", %" PRIi64 "\n",
10, stats->packets_received, 10, user_space_time, kernel_space_time);
}
}
}
......
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