Skip to content

Commit

Permalink
[PATCH] ifdef blktrace debugging fields
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Sep 29, 2006
1 parent 3d5b6fc commit 6c5c934
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions block/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,10 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
**/
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);
}
}

/*
Expand Down
3 changes: 1 addition & 2 deletions block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1847,8 +1847,7 @@ static void blk_release_queue(struct kobject *kobj)
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);
}
Expand Down
4 changes: 2 additions & 2 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,9 @@ struct task_struct {
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 */
Expand Down
2 changes: 2 additions & 0 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
/* 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;
}
Expand Down

0 comments on commit 6c5c934

Please sign in to comment.