--- zzzz-none-000/linux-3.10.107/tools/testing/selftests/mqueue/mq_perf_tests.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/tools/testing/selftests/mqueue/mq_perf_tests.c 2021-02-04 17:41:59.000000000 +0000 @@ -37,6 +37,7 @@ #include #include #include +#include static char *usage = "Usage:\n" @@ -296,9 +297,9 @@ printf("\n\tQueue %s created:\n", queue_path); printf("\t\tmq_flags:\t\t\t%s\n", result.mq_flags & O_NONBLOCK ? "O_NONBLOCK" : "(null)"); - printf("\t\tmq_maxmsg:\t\t\t%d\n", result.mq_maxmsg); - printf("\t\tmq_msgsize:\t\t\t%d\n", result.mq_msgsize); - printf("\t\tmq_curmsgs:\t\t\t%d\n", result.mq_curmsgs); + printf("\t\tmq_maxmsg:\t\t\t%lu\n", result.mq_maxmsg); + printf("\t\tmq_msgsize:\t\t\t%lu\n", result.mq_msgsize); + printf("\t\tmq_curmsgs:\t\t\t%lu\n", result.mq_curmsgs); } void *fake_cont_thread(void *arg) @@ -440,7 +441,7 @@ shutdown(2, "clock_getres()", __LINE__); printf("\t\tMax priorities:\t\t\t%d\n", mq_prio_max); - printf("\t\tClock resolution:\t\t%d nsec%s\n", res.tv_nsec, + printf("\t\tClock resolution:\t\t%lu nsec%s\n", res.tv_nsec, res.tv_nsec > 1 ? "s" : ""); @@ -454,20 +455,20 @@ recv_total.tv_nsec = 0; for (i = 0; i < TEST1_LOOPS; i++) do_send_recv(); - printf("\t\tSend msg:\t\t\t%d.%ds total time\n", + printf("\t\tSend msg:\t\t\t%ld.%lus total time\n", send_total.tv_sec, send_total.tv_nsec); nsec = ((unsigned long long)send_total.tv_sec * 1000000000 + send_total.tv_nsec) / TEST1_LOOPS; - printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); - printf("\t\tRecv msg:\t\t\t%d.%ds total time\n", + printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec); + printf("\t\tRecv msg:\t\t\t%ld.%lus total time\n", recv_total.tv_sec, recv_total.tv_nsec); nsec = ((unsigned long long)recv_total.tv_sec * 1000000000 + recv_total.tv_nsec) / TEST1_LOOPS; - printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); + printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec); for (cur_test = test2; cur_test->desc != NULL; cur_test++) { - printf(cur_test->desc); + printf("%s:\n", cur_test->desc); printf("\t\t(%d iterations)\n", TEST2_LOOPS); prio_out = 0; send_total.tv_sec = 0; @@ -493,16 +494,16 @@ cur_test->func(&prio_out); } printf("done.\n"); - printf("\t\tSend msg:\t\t\t%d.%ds total time\n", + printf("\t\tSend msg:\t\t\t%ld.%lus total time\n", send_total.tv_sec, send_total.tv_nsec); nsec = ((unsigned long long)send_total.tv_sec * 1000000000 + send_total.tv_nsec) / TEST2_LOOPS; - printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); - printf("\t\tRecv msg:\t\t\t%d.%ds total time\n", + printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec); + printf("\t\tRecv msg:\t\t\t%ld.%lus total time\n", recv_total.tv_sec, recv_total.tv_nsec); nsec = ((unsigned long long)recv_total.tv_sec * 1000000000 + recv_total.tv_nsec) / TEST2_LOOPS; - printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); + printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec); printf("\t\tDraining queue..."); fflush(stdout); clock_gettime(clock, &start); @@ -536,10 +537,9 @@ { struct mq_attr attr; char *option, *next_option; - int i, cpu; + int i, cpu, rc; struct sigaction sa; poptContext popt_context; - char rc; void *retval; main_thread = pthread_self(); @@ -653,8 +653,10 @@ /* Tell the user our initial state */ printf("\nInitial system state:\n"); printf("\tUsing queue path:\t\t\t%s\n", queue_path); - printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%d\n", saved_limits.rlim_cur); - printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%d\n", saved_limits.rlim_max); + printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%ld\n", + (long) saved_limits.rlim_cur); + printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%ld\n", + (long) saved_limits.rlim_max); printf("\tMaximum Message Size:\t\t\t%d\n", saved_max_msgsize); printf("\tMaximum Queue Size:\t\t\t%d\n", saved_max_msgs); printf("\tNice value:\t\t\t\t%d\n", cur_nice); @@ -667,10 +669,10 @@ printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t(unlimited)\n"); printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t(unlimited)\n"); } else { - printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%d\n", - cur_limits.rlim_cur); - printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%d\n", - cur_limits.rlim_max); + printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%ld\n", + (long) cur_limits.rlim_cur); + printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%ld\n", + (long) cur_limits.rlim_max); } printf("\tMaximum Message Size:\t\t\t%d\n", cur_max_msgsize); printf("\tMaximum Queue Size:\t\t\t%d\n", cur_max_msgs);