From 7f29de49b0338364c10d64647bbcb8778cf44001 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Tue, 22 Sep 2009 07:46:24 +0000 Subject: [PATCH] Correct pload printing operation. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2473 fd59a12c-fef9-0310-b244-a6a79926bd2f --- services/pload.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/services/pload.c b/services/pload.c index 19bc79a9..a378d954 100644 --- a/services/pload.c +++ b/services/pload.c @@ -356,6 +356,7 @@ static void message_handler_req_exec_pload_mcast ( unsigned int nodeid) { const struct req_exec_pload_mcast *pload_mcast = msg; + char log_buffer[1024]; last_msg_no = pload_mcast->msg_code; if (msgs_delivered == 0) { @@ -365,13 +366,13 @@ static void message_handler_req_exec_pload_mcast ( if (msgs_delivered == msgs_wanted) { tv2 = timerlist_nano_current_get (); tv_elapsed = tv2 - tv1; - printf ("%5d Writes ", msgs_delivered); - printf ("%5d bytes per write ", msg_size); - printf ("%7.3f Seconds runtime ", - (tv_elapsed / 1000000000.0)); - printf ("%9.3f TP/s ", - ((float)msgs_delivered) / (tv_elapsed / 1000000000.0)); - printf ("%7.3f MB/s.\n", - ((float)msgs_delivered) * ((float)msg_size) / ((tv_elapsed / 1000000000.0)) * 1000000.0); + sprintf (log_buffer, "%5d Writes %d bytes per write %7.3f seconds runtime, %9.3f TP/S, %9.3f MB/S.\n", + msgs_delivered, + msg_size, + (tv_elapsed / 1000000000.0), + ((float)msgs_delivered) / (tv_elapsed / 1000000000.0), + (((float)msgs_delivered) * ((float)msg_size) / + (tv_elapsed / 1000000000.0)) / (1024.0 * 1024.0)); + log_printf (LOGSYS_LEVEL_NOTICE, "%s", log_buffer); } } -- 2.39.5