* Ask a question
@ 2011-06-29 6:07 majianpeng
2011-06-29 6:20 ` Tao Ma
0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2011-06-29 6:07 UTC (permalink / raw)
To: linux-btrace
Hi all:
At present,I wanted to use blktrace.So I readed source and founded the problem.
Following is my step:
1:mount -t debugfs debugfs /sys/kernel/debug
2:blktrace -d /dev/sdb &
$pid
3:kill -9 $pid
I found some file in /sys/kernel/debug/block.
If a btrace is ruing,but I call ioctl(BLKTRACETEARDOWN)
case BLKTRACETEARDOWN:
ret = blk_trace_remove(q);
int blk_trace_remove(struct request_queue *q)
297 {
298 struct blk_trace *bt;
299
300 bt = xchg(&q->blk_trace, NULL);
301 if (!bt)
302 return -EINVAL;
303
304 if (bt->trace_state != Blktrace_running)
305 blk_trace_cleanup(bt);
306
307 return 0;
308 }
But the btrace is in blktrace_running, so bt did not cleanup.
When and Who cleanup btrace?
--------------
majianpeng
2011-06-29
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Ask a question
2011-06-29 6:07 Ask a question majianpeng
@ 2011-06-29 6:20 ` Tao Ma
0 siblings, 0 replies; 2+ messages in thread
From: Tao Ma @ 2011-06-29 6:20 UTC (permalink / raw)
To: linux-btrace
On 06/29/2011 02:07 PM, majianpeng wrote:
> Hi all:
> At present,I wanted to use blktrace.So I readed source and founded the problem.
> Following is my step:
> 1:mount -t debugfs debugfs /sys/kernel/debug
> 2:blktrace -d /dev/sdb &
> $pid
> 3:kill -9 $pid
> I found some file in /sys/kernel/debug/block.
You shouldn't use -9 to kill it directly. use -2 so that blktrace can
capture the signal and exit as expected.
Having said that, blktrace -k /dev/sdb should help in this case.
Thanks
Tao
>
> If a btrace is ruing,but I call ioctl(BLKTRACETEARDOWN)
> case BLKTRACETEARDOWN:
> ret = blk_trace_remove(q);
> int blk_trace_remove(struct request_queue *q)
> 297 {
> 298 struct blk_trace *bt;
> 299
> 300 bt = xchg(&q->blk_trace, NULL);
> 301 if (!bt)
> 302 return -EINVAL;
> 303
> 304 if (bt->trace_state != Blktrace_running)
> 305 blk_trace_cleanup(bt);
> 306
> 307 return 0;
> 308 }
> But the btrace is in blktrace_running, so bt did not cleanup.
> When and Who cleanup btrace?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-29 6:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-29 6:07 Ask a question majianpeng
2011-06-29 6:20 ` Tao Ma
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.