Skip to content

Commit b559b82

Browse files
Karan Tilak Kumarmartinkpetersen
authored andcommitted
scsi: fnic: Define stats to track multiqueue (MQ) IOs
Define an array to track IOs for the different queues, print the IO stats in fnic get stats data. Reviewed-by: Sesidhar Baddela <[email protected]> Reviewed-by: Arulprabhu Ponnusamy <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Karan Tilak Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 8a8449c commit b559b82

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/scsi/fnic/fnic_stats.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* Copyright 2013 Cisco Systems, Inc. All rights reserved. */
33
#ifndef _FNIC_STATS_H_
44
#define _FNIC_STATS_H_
5+
#define FNIC_MQ_MAX_QUEUES 64
56

67
struct stats_timestamps {
78
struct timespec64 last_reset_time;
@@ -26,6 +27,7 @@ struct io_path_stats {
2627
atomic64_t io_btw_10000_to_30000_msec;
2728
atomic64_t io_greater_than_30000_msec;
2829
atomic64_t current_max_io_time;
30+
atomic64_t ios[FNIC_MQ_MAX_QUEUES];
2931
};
3032

3133
struct abort_stats {

drivers/scsi/fnic/fnic_trace.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ int fnic_get_stats_data(struct stats_debug_info *debug,
204204
int len = 0;
205205
int buf_size = debug->buf_size;
206206
struct timespec64 val1, val2;
207+
int i = 0;
207208

208209
ktime_get_real_ts64(&val1);
209210
len = scnprintf(debug->debug_buffer + len, buf_size - len,
@@ -266,6 +267,16 @@ int fnic_get_stats_data(struct stats_debug_info *debug,
266267
(u64)atomic64_read(&stats->io_stats.io_btw_10000_to_30000_msec),
267268
(u64)atomic64_read(&stats->io_stats.io_greater_than_30000_msec));
268269

270+
len += scnprintf(debug->debug_buffer + len, buf_size - len,
271+
"------------------------------------------\n"
272+
"\t\tIO Queues and cumulative IOs\n"
273+
"------------------------------------------\n");
274+
275+
for (i = 0; i < FNIC_MQ_MAX_QUEUES; i++) {
276+
len += scnprintf(debug->debug_buffer + len, buf_size - len,
277+
"Q:%d -> %lld\n", i, (u64)atomic64_read(&stats->io_stats.ios[i]));
278+
}
279+
269280
len += scnprintf(debug->debug_buffer + len, buf_size - len,
270281
"\nCurrent Max IO time : %lld\n",
271282
(u64)atomic64_read(&stats->io_stats.current_max_io_time));

0 commit comments

Comments
 (0)