linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ziegler <br015@umbiko.net>
To: Daniel Bristot de Oliveira <bristot@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andreas Ziegler <br015@umbiko.net>
Subject: [PATCH 2/2 v2] tools/tracing/rtla: osnoise_hist: display average with two-digit precision
Date: Tue,  3 Jan 2023 11:34:00 +0100	[thread overview]
Message-ID: <20230103103400.275566-3-br015@umbiko.net> (raw)
In-Reply-To: <f47e877c-c95f-e3e6-b96f-89b0ca582878@kernel.org>

Calculate average value in osnoise-hist summary with two-digit 
precision to avoid displaying too optimitic results. 

Signed-off-by: Andreas Ziegler <br015@umbiko.net>
---
Changes v1 -> v2:
 - output with two-digit precision instead of rounding (Daniel)

 tools/tracing/rtla/src/osnoise_hist.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c
index fe34452fc4ec..13e1233690bb 100644
--- a/tools/tracing/rtla/src/osnoise_hist.c
+++ b/tools/tracing/rtla/src/osnoise_hist.c
@@ -335,8 +335,8 @@ osnoise_print_summary(struct osnoise_hist_params *params,
 			continue;
 
 		if (data->hist[cpu].count)
-			trace_seq_printf(trace->seq, "%9llu ",
-					data->hist[cpu].sum_sample / data->hist[cpu].count);
+			trace_seq_printf(trace->seq, "%9.2f ",
+				((double) data->hist[cpu].sum_sample) / data->hist[cpu].count);
 		else
 			trace_seq_printf(trace->seq, "        - ");
 	}
-- 
2.34.1


  parent reply	other threads:[~2023-01-03 10:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-24 12:39 rtla osnoise hist: average duration is always zero Andreas Ziegler
2022-12-24 21:17 ` Slade Watkins
2022-12-26 11:50   ` Andreas Ziegler
2022-12-28 15:25 ` Daniel Bristot de Oliveira
2023-01-03 10:33   ` [PATCH 0/2 v2] rtla osnoise hist average calculation Andreas Ziegler
2023-01-03 10:33   ` [PATCH 1/2 v2] tools/tracing/rtla: osnoise_hist: use total duration for " Andreas Ziegler
2023-01-12 14:32     ` Daniel Bristot de Oliveira
2023-01-03 10:34   ` Andreas Ziegler [this message]
2023-01-12 14:33     ` [PATCH 2/2 v2] tools/tracing/rtla: osnoise_hist: display average with two-digit precision Daniel Bristot de Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230103103400.275566-3-br015@umbiko.net \
    --to=br015@umbiko.net \
    --cc=bristot@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).