From 360a3f67c4e1a2a4cbeb01b6202a57821f18e1b0 Mon Sep 17 00:00:00 2001 From: David Munoz Constantine Date: Mon, 13 Feb 2023 12:50:23 -0800 Subject: [PATCH] storaged: use correct accumulate variable for publishing disk stats In the publish function, the variable mAccumulate_pub is used to log disk performance. However, the variable mAccumulate is used to log disk stats. The variable mAccumulate is only populated during a stall event. The publish function is used to log disk stats on a periodic timer, therefore, it should not rely on stall events to log stats. Instead, it should rely on the appropriately named mAccumulate_pub variable. Test: storaged unit tests Change-Id: I30e00f2c69618705d3f308630b7e023bfc5e384e Signed-off-by: David Munoz Constantine --- storaged/storaged_diskstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storaged/storaged_diskstats.cpp b/storaged/storaged_diskstats.cpp index 1eae5a10b..c31540947 100644 --- a/storaged/storaged_diskstats.cpp +++ b/storaged/storaged_diskstats.cpp @@ -312,7 +312,7 @@ void disk_stats_monitor::publish(void) { struct disk_perf perf = get_disk_perf(&mAccumulate_pub); log_debug_disk_perf(&perf, "regular"); - log_event_disk_stats(&mAccumulate, "regular"); + log_event_disk_stats(&mAccumulate_pub, "regular"); // Reset global structures memset(&mAccumulate_pub, 0, sizeof(struct disk_stats)); }