* [patch 1/2] blkparse: Add PC requests to depth trace
@ 2008-01-07 7:50 Christof Schmitt
2008-01-14 7:40 ` Christof Schmitt
2008-02-29 11:59 ` Christof Schmitt
0 siblings, 2 replies; 3+ messages in thread
From: Christof Schmitt @ 2008-01-07 7:50 UTC (permalink / raw)
To: linux-btrace
From: Christof Schmitt <christof.schmitt@de.ibm.com>
The PC requests use the same queue and also contribute to the
queue length, so they should be added to the queue depth trace.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
--- a/blkparse.c 2008-01-04 09:11:54.000000000 +0100
+++ b/blkparse.c 2008-01-04 11:30:36.000000000 +0100
@@ -1347,8 +1347,10 @@ static void log_pc(struct per_cpu_info *
process_fmt(act, pci, t, -1ULL, t->pdu_len, buf);
}
-static void dump_trace_pc(struct blk_io_trace *t, struct per_cpu_info *pci)
+static void dump_trace_pc(struct blk_io_trace *t, struct per_dev_info *pdi,
+ struct per_cpu_info *pci)
{
+ int w = (t->action & BLK_TC_ACT(BLK_TC_WRITE)) != 0;
int act = t->action & 0xffff;
switch (act) {
@@ -1362,12 +1364,25 @@ static void dump_trace_pc(struct blk_io_
log_generic(pci, t, "S");
break;
case __BLK_TA_REQUEUE:
+ /*
+ * can happen if we miss traces, don't let it go
+ * below zero
+ */
+ if (pdi->cur_depth[w])
+ pdi->cur_depth[w]--;
log_generic(pci, t, "R");
break;
case __BLK_TA_ISSUE:
+ pdi->cur_depth[w]++;
+ if (pdi->cur_depth[w] > pdi->max_depth[w])
+ pdi->max_depth[w] = pdi->cur_depth[w];
+
log_pc(pci, t, "D");
break;
case __BLK_TA_COMPLETE:
+ if (pdi->cur_depth[w])
+ pdi->cur_depth[w]--;
+
log_pc(pci, t, "C");
break;
case __BLK_TA_INSERT:
@@ -1463,7 +1478,7 @@ static void dump_trace(struct blk_io_tra
{
if (text_output) {
if (t->action & BLK_TC_ACT(BLK_TC_PC))
- dump_trace_pc(t, pci);
+ dump_trace_pc(t, pdi, pci);
else
dump_trace_fs(t, pdi, pci);
}
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch 1/2] blkparse: Add PC requests to depth trace
2008-01-07 7:50 [patch 1/2] blkparse: Add PC requests to depth trace Christof Schmitt
@ 2008-01-14 7:40 ` Christof Schmitt
2008-02-29 11:59 ` Christof Schmitt
1 sibling, 0 replies; 3+ messages in thread
From: Christof Schmitt @ 2008-01-14 7:40 UTC (permalink / raw)
To: linux-btrace
The PC requests use the same queue and also contribute to the
queue length, so they should be added to the queue depth trace.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
--- a/blkparse.c 2008-01-14 07:42:45.000000000 +0100
+++ b/blkparse.c 2008-01-14 07:45:20.000000000 +0100
@@ -1347,8 +1347,10 @@ static void log_pc(struct per_cpu_info *
process_fmt(act, pci, t, -1ULL, t->pdu_len, buf);
}
-static void dump_trace_pc(struct blk_io_trace *t, struct per_cpu_info *pci)
+static void dump_trace_pc(struct blk_io_trace *t, struct per_dev_info *pdi,
+ struct per_cpu_info *pci)
{
+ int w = (t->action & BLK_TC_ACT(BLK_TC_WRITE)) != 0;
int act = t->action & 0xffff;
switch (act) {
@@ -1362,12 +1364,23 @@ static void dump_trace_pc(struct blk_io_
log_generic(pci, t, "S");
break;
case __BLK_TA_REQUEUE:
+ /*
+ * can happen if we miss traces, don't let it go
+ * below zero
+ */
+ if (pdi->cur_depth[w])
+ pdi->cur_depth[w]--;
log_generic(pci, t, "R");
break;
case __BLK_TA_ISSUE:
+ pdi->cur_depth[w]++;
+ if (pdi->cur_depth[w] > pdi->max_depth[w])
+ pdi->max_depth[w] = pdi->cur_depth[w];
log_pc(pci, t, "D");
break;
case __BLK_TA_COMPLETE:
+ if (pdi->cur_depth[w])
+ pdi->cur_depth[w]--;
log_pc(pci, t, "C");
break;
case __BLK_TA_INSERT:
@@ -1463,7 +1476,7 @@ static void dump_trace(struct blk_io_tra
{
if (text_output) {
if (t->action & BLK_TC_ACT(BLK_TC_PC))
- dump_trace_pc(t, pci);
+ dump_trace_pc(t, pdi, pci);
else
dump_trace_fs(t, pdi, pci);
}
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch 1/2] blkparse: Add PC requests to depth trace
2008-01-07 7:50 [patch 1/2] blkparse: Add PC requests to depth trace Christof Schmitt
2008-01-14 7:40 ` Christof Schmitt
@ 2008-02-29 11:59 ` Christof Schmitt
1 sibling, 0 replies; 3+ messages in thread
From: Christof Schmitt @ 2008-02-29 11:59 UTC (permalink / raw)
To: linux-btrace
The PC requests use the same queue and also contribute to the
queue length, so they should be added to the queue depth trace.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
--- a/blkparse.c 2008-01-14 07:42:45.000000000 +0100
+++ b/blkparse.c 2008-01-14 07:45:20.000000000 +0100
@@ -1347,8 +1347,10 @@ static void log_pc(struct per_cpu_info *
process_fmt(act, pci, t, -1ULL, t->pdu_len, buf);
}
-static void dump_trace_pc(struct blk_io_trace *t, struct per_cpu_info *pci)
+static void dump_trace_pc(struct blk_io_trace *t, struct per_dev_info *pdi,
+ struct per_cpu_info *pci)
{
+ int w = (t->action & BLK_TC_ACT(BLK_TC_WRITE)) != 0;
int act = t->action & 0xffff;
switch (act) {
@@ -1362,12 +1364,23 @@ static void dump_trace_pc(struct blk_io_
log_generic(pci, t, "S");
break;
case __BLK_TA_REQUEUE:
+ /*
+ * can happen if we miss traces, don't let it go
+ * below zero
+ */
+ if (pdi->cur_depth[w])
+ pdi->cur_depth[w]--;
log_generic(pci, t, "R");
break;
case __BLK_TA_ISSUE:
+ pdi->cur_depth[w]++;
+ if (pdi->cur_depth[w] > pdi->max_depth[w])
+ pdi->max_depth[w] = pdi->cur_depth[w];
log_pc(pci, t, "D");
break;
case __BLK_TA_COMPLETE:
+ if (pdi->cur_depth[w])
+ pdi->cur_depth[w]--;
log_pc(pci, t, "C");
break;
case __BLK_TA_INSERT:
@@ -1463,7 +1476,7 @@ static void dump_trace(struct blk_io_tra
{
if (text_output) {
if (t->action & BLK_TC_ACT(BLK_TC_PC))
- dump_trace_pc(t, pci);
+ dump_trace_pc(t, pdi, pci);
else
dump_trace_fs(t, pdi, pci);
}
--
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-02-29 11:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-07 7:50 [patch 1/2] blkparse: Add PC requests to depth trace Christof Schmitt
2008-01-14 7:40 ` Christof Schmitt
2008-02-29 11:59 ` Christof Schmitt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).