Skip to contentSkip to conversation

ifdef blktrace debugging fields

PATCH Superseded Alexey Dobriyan 2 participants 4 messages Aug 1, 2006 – Aug 2, 2006 4 messages not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

PATCH 1/1 ifdef blktrace debugging fields

Quoted 2 lines · Jens Axboe

Certainly. If Alexey adds the blkdev.h bit as well, we can go ahead with it.

Done. Originally I looked at slab size of task_struct and still recovering.

[PATCH] ifdef blktrace debugging fields

---

 block/ll_rw_blk.c      |    4 ++--
 include/linux/blkdev.h |    4 ++--
 include/linux/sched.h  |    3 ++-
 kernel/fork.c          |    2 ++
 4 files changed, 8 insertions(+), 5 deletions(-)
block/ll_rw_blk.c +2 -2
@@ -1779,10 +1779,10 @@ static void blk_release_queue(struct kob
 
 	if (q->queue_tags)
 		__blk_queue_free_tags(q);
-
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	if (q->blk_trace)
 		blk_trace_shutdown(q);
-
+#endif
 	kmem_cache_free(requestq_cachep, q);
 }
 
include/linux/blkdev.h +2 -2
@@ -417,9 +417,9 @@ struct request_queue
 	unsigned int		sg_timeout;
 	unsigned int		sg_reserved_size;
 	int			node;
-
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	struct blk_trace	*blk_trace;
-
+#endif
 	/*
 	 * reserved for flush operations
 	 */
include/linux/sched.h +2 -1
@@ -784,8 +784,9 @@ #endif
 	struct prio_array *array;
 
 	unsigned short ioprio;
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	unsigned int btrace_seq;
-
+#endif
 	unsigned long sleep_avg;
 	unsigned long long timestamp, last_ran;
 	unsigned long long sched_time; /* sched_clock time spent running */
kernel/fork.c +2 -0
@@ -177,7 +177,9 @@ static struct task_struct *dup_task_stru
 	/* One for us, one for whoever does the "release_task()" (usually parent) */
 	atomic_set(&tsk->usage,2);
 	atomic_set(&tsk->fs_excl, 0);
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	tsk->btrace_seq = 0;
+#endif
 	tsk->splice_pipe = NULL;
 	return tsk;
 }
#5 lore raw
Quoted 6 lines · Alexey Dobriyan
Quoted 2 lines · Jens Axboe

Certainly. If Alexey adds the blkdev.h bit as well, we can go ahead with it.

Done. Originally I looked at slab size of task_struct and still recovering.

;-)

Quoted 15 lines

[PATCH] ifdef blktrace debugging fields

---

 block/ll_rw_blk.c      |    4 ++--
 include/linux/blkdev.h |    4 ++--
 include/linux/sched.h  |    3 ++-
 kernel/fork.c          |    2 ++
 4 files changed, 8 insertions(+), 5 deletions(-)
block/ll_rw_blk.c +0 -0
@@ -1779,10 +1779,10 @@ static void blk_release_queue(struct kob
 

block/ll_rw_blk.c static void blk_release_queue(struct kob · line 1787

Quoted 10 lines
block/ll_rw_blk.c +2 -2
 	if (q->queue_tags)
 		__blk_queue_free_tags(q);
-
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	if (q->blk_trace)
 		blk_trace_shutdown(q);
-
+#endif
 	kmem_cache_free(requestq_cachep, q);
 }

That can be made ifdef less, if you unconditionally call blk_trace_shutdown() and just make that one do:

        if (q->blk_trace) {
                ...
        }

since that'll then do the right always. Please make that change, then I'm fine with the patch.

Signature · 1 line
Jens Axboe
#6 lore raw

PATCH v3 1/1 ifdef blktrace debugging fields

Quoted 11 lines · Jens Axboe

Review

Quoted 7 lines
(quoted diff) +2 -1
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	if (q->blk_trace)
 		blk_trace_shutdown(q);
-
+#endif
 	kmem_cache_free(requestq_cachep, q);
 }

That can be made ifdef less, if you unconditionally call blk_trace_shutdown() and just make that one do:

Quoted 6 lines
        if (q->blk_trace) {
                ...
        }

since that'll then do the right always. Please make that change, then I'm fine with the patch.

OK here goes version 3.

[PATCH] ifdef blktrace debugging fields

---

 block/blktrace.c       |    6 ++++--
 block/ll_rw_blk.c      |    3 +--
 include/linux/blkdev.h |    4 ++--
 include/linux/sched.h  |    3 ++-
 kernel/fork.c          |    2 ++
 5 files changed, 11 insertions(+), 7 deletions(-)
block/blktrace.c +4 -2
@@ -450,8 +450,10 @@ int blk_trace_ioctl(struct block_device
  **/
 void blk_trace_shutdown(request_queue_t *q)
 {
-	blk_trace_startstop(q, 0);
-	blk_trace_remove(q);
+	if (q->blk_trace) {
+		blk_trace_startstop(q, 0);
+		blk_trace_remove(q);
+	}
 }
 
 /*
block/ll_rw_blk.c +1 -2
@@ -1780,8 +1780,7 @@ static void blk_release_queue(struct kob
 	if (q->queue_tags)
 		__blk_queue_free_tags(q);
 
-	if (q->blk_trace)
-		blk_trace_shutdown(q);
+	blk_trace_shutdown(q);
 
 	kmem_cache_free(requestq_cachep, q);
 }
include/linux/blkdev.h +2 -2
@@ -417,9 +417,9 @@ struct request_queue
 	unsigned int		sg_timeout;
 	unsigned int		sg_reserved_size;
 	int			node;
-
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	struct blk_trace	*blk_trace;
-
+#endif
 	/*
 	 * reserved for flush operations
 	 */
include/linux/sched.h +2 -1
@@ -784,8 +784,9 @@ #endif
 	struct prio_array *array;
 
 	unsigned short ioprio;
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	unsigned int btrace_seq;
-
+#endif
 	unsigned long sleep_avg;
 	unsigned long long timestamp, last_ran;
 	unsigned long long sched_time; /* sched_clock time spent running */
kernel/fork.c +2 -0
@@ -177,7 +177,9 @@ static struct task_struct *dup_task_stru
 	/* One for us, one for whoever does the "release_task()" (usually parent) */
 	atomic_set(&tsk->usage,2);
 	atomic_set(&tsk->fs_excl, 0);
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	tsk->btrace_seq = 0;
+#endif
 	tsk->splice_pipe = NULL;
 	return tsk;
 }
Acked-by on v3 1/1
#7 lore raw
Quoted 16 lines · Alexey Dobriyan
Quoted 15 lines · Jens Axboe

Review

Quoted 7 lines
(quoted diff) +2 -1
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	if (q->blk_trace)
 		blk_trace_shutdown(q);
-
+#endif
 	kmem_cache_free(requestq_cachep, q);
 }

That can be made ifdef less, if you unconditionally call blk_trace_shutdown() and just make that one do:

        if (q->blk_trace) {
                ...
        }
Quoted 6 lines
Quoted 2 lines

since that'll then do the right always. Please make that change, then I'm fine with the patch.

OK here goes version 3.

[PATCH] ifdef blktrace debugging fields

Looks good!

Signature · 1 line
Jens Axboe