[PATCH] btt: use millisecond output latency time

Fanhui Meng <[email protected]> Wed, 23 Apr 2025 16:27:29 +0800
Newsgroups org.kernel.vger.linux-btrace
Message-ID <[email protected]>
Output latency time in milliseconds to increase readability.
as the normal time for IO requests is usually a few milliseconds.

q2c.dat test output result:
1.725317 0.292148
1.725275 0.337183
1.725326 0.288462
1.725334 0.282350
1.725342 0.276609
2.039203 0.217158
2.039463 0.123061
2.039715 0.173856
2.040144 0.184456

Signed-off-by: Fanhui Meng <[email protected]>
---
 btt/latency.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/btt/latency.c b/btt/latency.c
index 51e6881..331595e 100644
--- a/btt/latency.c
+++ b/btt/latency.c
@@ -23,7 +23,7 @@
 static inline void latency_out(FILE *ofp, __u64 tstamp, __u64 latency)
 {
 	if (ofp)
-		fprintf(ofp, "%lf %lf\n", TO_SEC(tstamp), TO_SEC(latency));
+		fprintf(ofp, "%lf %lf\n", TO_SEC(tstamp), TO_MSEC(latency));
 }
 
 FILE *latency_open(struct d_info *dip, char *name, char *post)
-- 
2.25.1