Skip to contentSkip to conversation

blkparse: Introduce optional accounting of PC requests

PATCH New Christof Schmitt 1 participant 3 messages Jan 7, 2008 – Feb 29, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 blkparse: Introduce optional accounting of PC requests

From: Christof Schmitt <[email protected]>

The current blkparse lists only PC requests, but does not account for number of PC requests and the size of the attached data. This makes sense for block devices where requests originate from file systems.

When tracing SCSI tape drives via the sg device files, then all requests are PC requests. This patch introduces optional accounting for PC requests with the -p or --pc flags to blkparse. For disk drives and CD-ROMs this could also be useful to see a summary of the number and transferred data of PC requests.

Accounting the completion events does not work, since the kernel uses the data_len field as residual bytes count on event completion, so this has been left out.

blktrace.h +4 -0
@@ -32,6 +32,10 @@ struct io_stats {
 	unsigned long long qread_kb, qwrite_kb, cread_kb, cwrite_kb;
 	unsigned long long iread_kb, iwrite_kb;
 	unsigned long long mread_kb, mwrite_kb;
+	unsigned long qreads_pc, qwrites_pc, creads_pc, cwrites_pc;
+	unsigned long ireads_pc, iwrites_pc;
+	unsigned long long qread_kb_pc, qwrite_kb_pc, cread_kb_pc, cwrite_kb_pc;
+	unsigned long long iread_kb_pc, iwrite_kb_pc;
 	unsigned long io_unplugs, timer_unplugs;
 };
 
blkparse.c +105 -2

188 lines not on this page · raw message

#1 lore raw

PATCH 2/2 blkparse: Introduce optional accounting of PC requests

The current blkparse lists only PC requests, but does not account for number of PC requests and the size of the attached data. This patch introduces optional accounting for PC requests. If any PC event was encountered, the summary output will also include data from PC requests.

For PC completion events the amount of transferred data is not available, since the kernel uses the data_len field as residual bytes count on event completion.

blktrace.h +3 -0
@@ -32,6 +32,9 @@ struct io_stats {
 	unsigned long long qread_kb, qwrite_kb, cread_kb, cwrite_kb;
 	unsigned long long iread_kb, iwrite_kb;
 	unsigned long long mread_kb, mwrite_kb;
+	unsigned long qreads_pc, qwrites_pc, ireads_pc, iwrites_pc;
+	unsigned long rrqueue_pc, wrqueue_pc, creads_pc, cwrites_pc;
+	unsigned long long qread_kb_pc, qwrite_kb_pc, iread_kb_pc, iwrite_kb_pc;
 	unsigned long io_unplugs, timer_unplugs;
 };
 
blkparse.c +121 -0

160 lines not on this page · raw message

#2 lore raw

PATCH 2/2 blkparse: Introduce optional accounting of PC requests

In reply to Christof Schmitt

The current blkparse lists only PC requests, but does not account for number of PC requests and the size of the attached data. This patch introduces optional accounting for PC requests. If any PC event was encountered, the summary output will also include data from PC requests.

For PC completion events the amount of transferred data is not available, since the kernel uses the data_len field as residual bytes count on event completion.

blktrace.h +3 -0
@@ -32,6 +32,9 @@ struct io_stats {
 	unsigned long long qread_kb, qwrite_kb, cread_kb, cwrite_kb;
 	unsigned long long iread_kb, iwrite_kb;
 	unsigned long long mread_kb, mwrite_kb;
+	unsigned long qreads_pc, qwrites_pc, ireads_pc, iwrites_pc;
+	unsigned long rrqueue_pc, wrqueue_pc, creads_pc, cwrites_pc;
+	unsigned long long qread_kb_pc, qwrite_kb_pc, iread_kb_pc, iwrite_kb_pc;
 	unsigned long io_unplugs, timer_unplugs;
 };
 
blkparse.c +121 -0

160 lines not on this page · raw message