aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorShuah Khan <shuah.kh@samsung.com>2014-06-25 12:05:17 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-11 21:11:18 -0400
commitf15fed3da83212da8fa939ec70e38033ea35f8aa (patch)
tree21f85578d20042ea355fa34fb78fd7330aef2449 /tools
parent5e4ff6950352ab2f4b6f18c66c235bfa95c39a2a (diff)
tools: fix mq_perf_tests compile warnings
Fix numerous compile warnings in mq_perf_tests.c. All of these are wrong format in printfs when printing nvsec. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/mqueue/mq_perf_tests.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c
index 2fadd4b97045..94dae65eea41 100644
--- a/tools/testing/selftests/mqueue/mq_perf_tests.c
+++ b/tools/testing/selftests/mqueue/mq_perf_tests.c
@@ -296,9 +296,9 @@ static inline void open_queue(struct mq_attr *attr)
296 printf("\n\tQueue %s created:\n", queue_path); 296 printf("\n\tQueue %s created:\n", queue_path);
297 printf("\t\tmq_flags:\t\t\t%s\n", result.mq_flags & O_NONBLOCK ? 297 printf("\t\tmq_flags:\t\t\t%s\n", result.mq_flags & O_NONBLOCK ?
298 "O_NONBLOCK" : "(null)"); 298 "O_NONBLOCK" : "(null)");
299 printf("\t\tmq_maxmsg:\t\t\t%d\n", result.mq_maxmsg); 299 printf("\t\tmq_maxmsg:\t\t\t%lu\n", result.mq_maxmsg);
300 printf("\t\tmq_msgsize:\t\t\t%d\n", result.mq_msgsize); 300 printf("\t\tmq_msgsize:\t\t\t%lu\n", result.mq_msgsize);
301 printf("\t\tmq_curmsgs:\t\t\t%d\n", result.mq_curmsgs); 301 printf("\t\tmq_curmsgs:\t\t\t%lu\n", result.mq_curmsgs);
302} 302}
303 303
304void *fake_cont_thread(void *arg) 304void *fake_cont_thread(void *arg)
@@ -440,7 +440,7 @@ void *perf_test_thread(void *arg)
440 shutdown(2, "clock_getres()", __LINE__); 440 shutdown(2, "clock_getres()", __LINE__);
441 441
442 printf("\t\tMax priorities:\t\t\t%d\n", mq_prio_max); 442 printf("\t\tMax priorities:\t\t\t%d\n", mq_prio_max);
443 printf("\t\tClock resolution:\t\t%d nsec%s\n", res.tv_nsec, 443 printf("\t\tClock resolution:\t\t%lu nsec%s\n", res.tv_nsec,
444 res.tv_nsec > 1 ? "s" : ""); 444 res.tv_nsec > 1 ? "s" : "");
445 445
446 446
@@ -454,20 +454,20 @@ void *perf_test_thread(void *arg)
454 recv_total.tv_nsec = 0; 454 recv_total.tv_nsec = 0;
455 for (i = 0; i < TEST1_LOOPS; i++) 455 for (i = 0; i < TEST1_LOOPS; i++)
456 do_send_recv(); 456 do_send_recv();
457 printf("\t\tSend msg:\t\t\t%d.%ds total time\n", 457 printf("\t\tSend msg:\t\t\t%ld.%lus total time\n",
458 send_total.tv_sec, send_total.tv_nsec); 458 send_total.tv_sec, send_total.tv_nsec);
459 nsec = ((unsigned long long)send_total.tv_sec * 1000000000 + 459 nsec = ((unsigned long long)send_total.tv_sec * 1000000000 +
460 send_total.tv_nsec) / TEST1_LOOPS; 460 send_total.tv_nsec) / TEST1_LOOPS;
461 printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); 461 printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec);
462 printf("\t\tRecv msg:\t\t\t%d.%ds total time\n", 462 printf("\t\tRecv msg:\t\t\t%ld.%lus total time\n",
463 recv_total.tv_sec, recv_total.tv_nsec); 463 recv_total.tv_sec, recv_total.tv_nsec);
464 nsec = ((unsigned long long)recv_total.tv_sec * 1000000000 + 464 nsec = ((unsigned long long)recv_total.tv_sec * 1000000000 +
465 recv_total.tv_nsec) / TEST1_LOOPS; 465 recv_total.tv_nsec) / TEST1_LOOPS;
466 printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); 466 printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec);
467 467
468 468
469 for (cur_test = test2; cur_test->desc != NULL; cur_test++) { 469 for (cur_test = test2; cur_test->desc != NULL; cur_test++) {
470 printf(cur_test->desc); 470 printf("%s:\n", cur_test->desc);
471 printf("\t\t(%d iterations)\n", TEST2_LOOPS); 471 printf("\t\t(%d iterations)\n", TEST2_LOOPS);
472 prio_out = 0; 472 prio_out = 0;
473 send_total.tv_sec = 0; 473 send_total.tv_sec = 0;
@@ -493,16 +493,16 @@ void *perf_test_thread(void *arg)
493 cur_test->func(&prio_out); 493 cur_test->func(&prio_out);
494 } 494 }
495 printf("done.\n"); 495 printf("done.\n");
496 printf("\t\tSend msg:\t\t\t%d.%ds total time\n", 496 printf("\t\tSend msg:\t\t\t%ld.%lus total time\n",
497 send_total.tv_sec, send_total.tv_nsec); 497 send_total.tv_sec, send_total.tv_nsec);
498 nsec = ((unsigned long long)send_total.tv_sec * 1000000000 + 498 nsec = ((unsigned long long)send_total.tv_sec * 1000000000 +
499 send_total.tv_nsec) / TEST2_LOOPS; 499 send_total.tv_nsec) / TEST2_LOOPS;
500 printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); 500 printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec);
501 printf("\t\tRecv msg:\t\t\t%d.%ds total time\n", 501 printf("\t\tRecv msg:\t\t\t%ld.%lus total time\n",
502 recv_total.tv_sec, recv_total.tv_nsec); 502 recv_total.tv_sec, recv_total.tv_nsec);
503 nsec = ((unsigned long long)recv_total.tv_sec * 1000000000 + 503 nsec = ((unsigned long long)recv_total.tv_sec * 1000000000 +
504 recv_total.tv_nsec) / TEST2_LOOPS; 504 recv_total.tv_nsec) / TEST2_LOOPS;
505 printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); 505 printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec);
506 printf("\t\tDraining queue..."); 506 printf("\t\tDraining queue...");
507 fflush(stdout); 507 fflush(stdout);
508 clock_gettime(clock, &start); 508 clock_gettime(clock, &start);
@@ -653,8 +653,10 @@ int main(int argc, char *argv[])
653 /* Tell the user our initial state */ 653 /* Tell the user our initial state */
654 printf("\nInitial system state:\n"); 654 printf("\nInitial system state:\n");
655 printf("\tUsing queue path:\t\t\t%s\n", queue_path); 655 printf("\tUsing queue path:\t\t\t%s\n", queue_path);
656 printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%d\n", saved_limits.rlim_cur); 656 printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%ld\n",
657 printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%d\n", saved_limits.rlim_max); 657 (long) saved_limits.rlim_cur);
658 printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%ld\n",
659 (long) saved_limits.rlim_max);
658 printf("\tMaximum Message Size:\t\t\t%d\n", saved_max_msgsize); 660 printf("\tMaximum Message Size:\t\t\t%d\n", saved_max_msgsize);
659 printf("\tMaximum Queue Size:\t\t\t%d\n", saved_max_msgs); 661 printf("\tMaximum Queue Size:\t\t\t%d\n", saved_max_msgs);
660 printf("\tNice value:\t\t\t\t%d\n", cur_nice); 662 printf("\tNice value:\t\t\t\t%d\n", cur_nice);
@@ -667,10 +669,10 @@ int main(int argc, char *argv[])
667 printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t(unlimited)\n"); 669 printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t(unlimited)\n");
668 printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t(unlimited)\n"); 670 printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t(unlimited)\n");
669 } else { 671 } else {
670 printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%d\n", 672 printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%ld\n",
671 cur_limits.rlim_cur); 673 (long) cur_limits.rlim_cur);
672 printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%d\n", 674 printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%ld\n",
673 cur_limits.rlim_max); 675 (long) cur_limits.rlim_max);
674 } 676 }
675 printf("\tMaximum Message Size:\t\t\t%d\n", cur_max_msgsize); 677 printf("\tMaximum Message Size:\t\t\t%d\n", cur_max_msgsize);
676 printf("\tMaximum Queue Size:\t\t\t%d\n", cur_max_msgs); 678 printf("\tMaximum Queue Size:\t\t\t%d\n", cur_max_msgs);