From 5974703b1bba88a3f2b941b3ac55ee1559ee4453 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Fri, 27 Oct 2023 11:28:01 -0700 Subject: [PATCH 1/2] DLPX-88179 estat JSON mode gives histogram keys in nanoseconds rather than microseconds PR URL: https://www.github.com/delphix/performance-diagnostics/pull/94 --- bpf/estat/backend-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bpf/estat/backend-io.c b/bpf/estat/backend-io.c index 12f6797..0cd6054 100644 --- a/bpf/estat/backend-io.c +++ b/bpf/estat/backend-io.c @@ -47,7 +47,8 @@ disk_io_start(struct pt_regs *ctx, struct request *reqp) int disk_io_done(struct pt_regs *ctx, struct request *reqp) { - u64 ts = bpf_ktime_get_ns(); + // bpf diplays it in microsecs. so here divide by 1000 to get microsecs + u64 ts = bpf_ktime_get_ns() / 1000; io_data_t *data = io_base_data.lookup((u64 *) &reqp); struct bio *bp = reqp->bio; From 79baf709a2069ee7dae87577076c8515dfe36b48 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Fri, 27 Oct 2023 11:57:00 -0700 Subject: [PATCH 2/2] debug --- bpf/estat/backend-io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bpf/estat/backend-io.c b/bpf/estat/backend-io.c index 0cd6054..5b7be44 100644 --- a/bpf/estat/backend-io.c +++ b/bpf/estat/backend-io.c @@ -47,8 +47,7 @@ disk_io_start(struct pt_regs *ctx, struct request *reqp) int disk_io_done(struct pt_regs *ctx, struct request *reqp) { - // bpf diplays it in microsecs. so here divide by 1000 to get microsecs - u64 ts = bpf_ktime_get_ns() / 1000; + u64 ts = bpf_ktime_get_ns(); io_data_t *data = io_base_data.lookup((u64 *) &reqp); struct bio *bp = reqp->bio; @@ -56,7 +55,7 @@ disk_io_done(struct pt_regs *ctx, struct request *reqp) return (0); // missed issue } - u64 delta = ts - data->ts; + u64 delta = (ts - data->ts) / 1000; char name[NAME_LENGTH] = ""; char axis[AXIS_LENGTH] = "";