08 Jun, 2016
1 commit
-
Have blktrace use the req/bio op accessor to get the REQ_OP.
Signed-off-by: Mike Christie
Reviewed-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
Signed-off-by: Jens Axboe
10 May, 2016
1 commit
-
if trace isn't enabled, parsing cgroup path just wastes cpu
Signed-off-by: Shaohua Li
Signed-off-by: Jens Axboe
09 Nov, 2013
1 commit
-
do_blk_trace_setup() will fully initialize 'buts.name', so can remove
the related memcpy(). And also use BLKTRACE_BDEV_SIZE and ARRAY_SIZE
instead of hard code number '32'.Signed-off-by: Chen Gang
Signed-off-by: Jens Axboe
08 Nov, 2013
1 commit
-
Currently each task sends BLK_TN_PROCESS event to the first traced
device it interacts with after a new trace is started. When there are
several traced devices and the task accesses more devices, this logic
can result in BLK_TN_PROCESS being sent several times to some devices
while it is never sent to other devices. Thus blkparse doesn't display
command name when parsing some blktrace files.Fix the problem by sending BLK_TN_PROCESS event to all traced devices
when a task interacts with any of them.Signed-off-by: Jan Kara
Review-by: Jeff Moyer
Signed-off-by: Jens Axboe
19 Apr, 2013
1 commit
-
This reverts commit 3a366e614d0837d9fc23f78cdb1a1186ebc3387f.
Wanlong Gao reports that it causes a kernel panic on his machine several
minutes after boot. Reverting it removes the panic.Jens says:
"It's not quite clear why that is yet, so I think we should just revert
the commit for 3.9 final (which I'm assuming is pretty close).The wifi is crap at the LSF hotel, so sending this email instead of
queueing up a revert and pull request."Reported-by: Wanlong Gao
Requested-by: Jens Axboe
Cc: Tejun Heo
Cc: Steven Rostedt
Signed-off-by: Linus Torvalds
14 Jan, 2013
1 commit
-
bio completion didn't kick block_bio_complete TP. Only dm was
explicitly triggering the TP on IO completion. This makes
block_bio_complete TP useless for tracers which want to know about
bios, and all other bio based drivers skip generating blktrace
completion events.This patch makes all bio completions via bio_endio() generate
block_bio_complete TP.* Explicit trace_block_bio_complete() invocation removed from dm and
the trace point is unexported.* @rq dropped from trace_block_bio_complete(). bios may fly around
w/o queue associated. Verifying and accessing the assocaited queue
belongs to TP probes.* blktrace now gets both request and bio completions. Make it ignore
bio completions if request completion path is happening.This makes all bio based drivers generate blktrace completion events
properly and makes the block_bio_complete TP actually useful.v2: With this change, block_bio_complete TP could be invoked on sg
commands which have bio's with %NULL bi_bdev. Update TP
assignment code to check whether bio->bi_bdev is %NULL before
dereferencing.Signed-off-by: Tejun Heo
Original-patch-by: Namhyung Kim
Cc: Tejun Heo
Cc: Steven Rostedt
Cc: Alasdair Kergon
Cc: dm-devel@redhat.com
Cc: Neil Brown
Signed-off-by: Jens Axboe
13 Oct, 2012
1 commit
-
Signed-off-by: David Howells
Acked-by: Arnd Bergmann
Acked-by: Thomas Gleixner
Acked-by: Michael Kerrisk
Acked-by: Paul E. McKenney
Acked-by: Dave Jones
01 Nov, 2011
1 commit
-
Standardize the style for compiler based printf format verification.
Standardized the location of __printf too.Done via script and a little typing.
$ grep -rPl --include=*.[ch] -w "__attribute__" * | \
grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'[akpm@linux-foundation.org: revert arch bits]
Signed-off-by: Joe Perches
Cc: "Kirill A. Shutemov"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Aug, 2011
1 commit
-
Add FLUSH/FUA support to blktrace. As FLUSH precedes WRITE and/or
FUA follows WRITE, use the same 'F' flag for both cases and
distinguish them by their (relative) position. The end results
look like (other flags might be shown also):- WRITE: W
- WRITE_FLUSH: FW
- WRITE_FUA: WF
- WRITE_FLUSH_FUA: FWFNote that we reuse TC_BARRIER due to lack of bit space of act_mask
so that the older versions of blktrace tools will report flush
requests as barriers from now on.Cc: Steven Rostedt
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Signed-off-by: Namhyung Kim
Reviewed-by: Jeff Moyer
Signed-off-by: Jens Axboe
13 Jun, 2011
1 commit
-
Use the compiler to verify format strings and arguments.
Fix fallout.
Signed-off-by: Joe Perches
Signed-off-by: Jens Axboe
03 Mar, 2011
1 commit
-
If we enable trace events to trace block actions, We use
blk_fill_rwbs_rq to analyze the corresponding actions
in request's cmd_flags, but we only choose the minor 2 bits
from it, so most of other flags(e.g, REQ_SYNC) are missing.
For example, with a sync write we get:
write_test-2409 [001] 160.013869: block_rq_insert: 3,64 W 0 () 258135 + =
8 [write_test]Since now we have integrated the flags of both bio and request,
it is safe to pass rq->cmd_flags directly to blk_fill_rwbs and
blk_fill_rwbs_rq isn't needed any more.With this patch, after a sync write we get:
write_test-2417 [000] 226.603878: block_rq_insert: 3,64 WS 0 () 258135 +=
8 [write_test]Signed-off-by: Tao Ma
Acked-by: Jeff Moyer
Signed-off-by: Jens Axboe
08 Aug, 2010
3 commits
-
block/compat_ioctl.c: In function 'compat_blkdev_ioctl':
block/compat_ioctl.c:754: error: 'BLKTRACESETUP32' undeclared (first use in this function)Signed-off-by: Stephen Rothwell
Acked-by: Arnd Bergmann
Signed-off-by: Jens Axboe -
The blktrace driver currently needs the BKL, but
we should not need to take that in the block layer,
so just push it down into the driver itself.It is quite likely that the BKL is not actually
required in blktrace code and could be removed
in a follow-on patch.Signed-off-by: Arnd Bergmann
Acked-by: Christoph Hellwig
Signed-off-by: Jens Axboe -
Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
struct requests. This allows much easier grepping for different request
types instead of unwinding through macros.Signed-off-by: Christoph Hellwig
Signed-off-by: Jens Axboe
17 Feb, 2010
1 commit
-
Add __percpu sparse annotations to core subsystems.
These annotations are to make sparse consider percpu variables to be
in a different address space and warn if accessed without going
through percpu accessors. This patch doesn't affect normal builds.Signed-off-by: Tejun Heo
Reviewed-by: Christoph Lameter
Acked-by: Paul E. McKenney
Cc: Jens Axboe
Cc: linux-mm@kvack.org
Cc: Rusty Russell
Cc: Dipankar Sarma
Cc: Peter Zijlstra
Cc: Andrew Morton
Cc: Eric Biederman
02 Oct, 2009
2 commits
-
Since 2.6.31 now has request-based device-mapper, it's useful to have
a tracepoint for request-remapping as well as bio-remapping.
This patch adds a tracepoint for request-remapping, trace_block_rq_remap().Signed-off-by: Kiyoshi Ueda
Signed-off-by: Jun'ichi Nomura
Cc: Alasdair G Kergon
Cc: Li Zefan
Signed-off-by: Jens Axboe -
Add missing blk_trace_remove_sysfs to be in pair with blk_trace_init_sysfs
introduced in commit 1d54ad6da9192fed5dd3b60224d9f2dfea0dcd82.
Release kobject also in case the request_fn is NULL.Problem was noticed via kmemleak backtrace when some sysfs entries were
note properly destroyed during device removal:unreferenced object 0xffff88001aa76640 (size 80):
comm "lvcreate", pid 2120, jiffies 4294885144
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 f0 65 a7 1a 00 88 ff ff .........e......
90 66 a7 1a 00 88 ff ff 86 1d 53 81 ff ff ff ff .f........S.....
backtrace:
[] kmemleak_alloc+0x26/0x60
[] kmem_cache_alloc+0x133/0x1c0
[] sysfs_new_dirent+0x41/0x120
[] sysfs_add_file_mode+0x3c/0xb0
[] internal_create_group+0xc1/0x1a0
[] sysfs_create_group+0x13/0x20
[] blk_trace_init_sysfs+0x14/0x20
[] blk_register_queue+0x3c/0xf0
[] add_disk+0x94/0x160
[] dm_create+0x598/0x6e0 [dm_mod]
[] dev_create+0x51/0x350 [dm_mod]
[] ctl_ioctl+0x1a3/0x240 [dm_mod]
[] dm_compat_ctl_ioctl+0x12/0x20 [dm_mod]
[] compat_sys_ioctl+0xcd/0x4f0
[] sysenter_dispatch+0x7/0x2c
[] 0xffffffffffffffffSigned-off-by: Zdenek Kabelac
Reviewed-by: Li Zefan
Signed-off-by: Jens Axboe
10 Jun, 2009
2 commits
-
Fix building failures when CONFIG_BLOCK == n.
Signed-off-by: Li Zefan
LKML-Reference:
Signed-off-by: Steven Rostedt
Signed-off-by: Ingo Molnar -
TRACE_EVENT is a more generic way to define tracepoints. Doing so adds
these new capabilities to this tracepoint:- zero-copy and per-cpu splice() tracing
- binary tracing without printf overhead
- structured logging records exposed under /debug/tracing/events
- trace events embedded in function tracer output and other plugins
- user-defined, per tracepoint filter expressions
...Cons:
- no dev_t info for the output of plug, unplug_timer and unplug_io events.
no dev_t info for getrq and sleeprq events if bio == NULL.
no dev_t info for rq_abort,...,rq_requeue events if rq->rq_disk == NULL.This is mainly because we can't get the deivce from a request queue.
But this may change in the future.- A packet command is converted to a string in TP_assign, not TP_print.
While blktrace do the convertion just before output.Since pc requests should be rather rare, this is not a big issue.
- In blktrace, an event can have 2 different print formats, but a TRACE_EVENT
has a unique format, which means we have some unused data in a trace entry.The overhead is minimized by using __dynamic_array() instead of __array().
I've benchmarked the ioctl blktrace vs the splice based TRACE_EVENT tracing:
dd dd + ioctl blktrace dd + TRACE_EVENT (splice)
1 7.36s, 42.7 MB/s 7.50s, 42.0 MB/s 7.41s, 42.5 MB/s
2 7.43s, 42.3 MB/s 7.48s, 42.1 MB/s 7.43s, 42.4 MB/s
3 7.38s, 42.6 MB/s 7.45s, 42.2 MB/s 7.41s, 42.5 MB/sSo the overhead of tracing is very small, and no regression when using
those trace events vs blktrace.And the binary output of TRACE_EVENT is much smaller than blktrace:
# ls -l -h
-rw-r--r-- 1 root root 8.8M 06-09 13:24 sda.blktrace.0
-rw-r--r-- 1 root root 195K 06-09 13:24 sda.blktrace.1
-rw-r--r-- 1 root root 2.7M 06-09 13:25 trace_splice.outFollowing are some comparisons between TRACE_EVENT and blktrace:
plug:
kjournald-480 [000] 303.084981: block_plug: [kjournald]
kjournald-480 [000] 303.084981: 8,0 P N [kjournald]unplug_io:
kblockd/0-118 [000] 300.052973: block_unplug_io: [kblockd/0] 1
kblockd/0-118 [000] 300.052974: 8,0 U N [kblockd/0] 1remap:
kjournald-480 [000] 303.085042: block_remap: 8,0 W 102736992 + 8 v3:- use the newly introduced __dynamic_array().
Changelog from v1 -> v2:
- use __string() instead of __array() to minimize the memory required
to store hex dump of rq->cmd().- support large pc requests.
- add missing blk_fill_rwbs_rq() in block_rq_requeue TRACE_EVENT.
- some cleanups.
Signed-off-by: Li Zefan
LKML-Reference:
Signed-off-by: Steven Rostedt
06 May, 2009
1 commit
-
This attempts to clarify names utilized during block I/O remap
operations (partition, volume manager). It correctly matches up the
/from/ information for both device & sector. This takes in the concept
from Kosaki Motohiro and extends it to include better naming for the
"device_from" field.[ Impact: cleanup ]
Signed-off-by: Alan D. Brunelle
Reviewed-by: Li Zefan
Reviewed-by: KOSAKI Motohiro
Cc: Jens Axboe
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Ingo Molnar
16 Apr, 2009
2 commits
-
Impact: allow ftrace-plugin blktrace to trace device-mapper devices
To trace a single partition:
# echo 1 > /sys/block/sda/sda1/enableTo trace the whole sda instead:
# echo 1 > /sys/block/sda/enableThus we also fix an issue reported by Ted, that ftrace-plugin blktrace
can't be used to trace device-mapper devices.Now:
# echo 1 > /sys/block/dm-0/trace/enable
echo: write error: No such device or address
# mount -t ext4 /dev/dm-0 /mnt
# echo 1 > /sys/block/dm-0/trace/enable
# echo blk > /debug/tracing/current_tracerReported-by: Theodore Tso
Signed-off-by: Li Zefan
Acked-by: "Theodore Ts'o"
Cc: Arnaldo Carvalho de Melo
Cc: Shawn Du
Cc: Jens Axboe
LKML-Reference:
Signed-off-by: Ingo Molnar -
Though one can specify '-d /dev/sda1' when using blktrace, it still
traces the whole sda.To support per-partition tracing, when we start tracing, we initialize
bt->start_lba and bt->end_lba to the start and end sector of that
partition.Note some actions are per device, thus we don't filter 0-sector events.
The original patch and discussion can be found here:
http://marc.info/?l=linux-btrace&m=122949374214540&w=2Signed-off-by: Shawn Du
Signed-off-by: Li Zefan
Acked-by: "Theodore Ts'o"
Cc: Arnaldo Carvalho de Melo
Cc: Jens Axboe
LKML-Reference:
Signed-off-by: Ingo Molnar
19 Feb, 2009
1 commit
-
Conflicts:
block/blktrace.cSemantic merge:
kernel/trace/blktrace.cSigned-off-by: Ingo Molnar
18 Feb, 2009
1 commit
-
We can't OR shift values, so get rid of BIO_RW_SYNC and use BIO_RW_SYNCIO
and BIO_RW_UNPLUG explicitly. This brings back the behaviour from before
213d9417fec62ef4c3675621b9364a667954d4dd.Signed-off-by: Jens Axboe
03 Feb, 2009
1 commit
31 Jan, 2009
1 commit
-
fix the following 'make headers_check' warning:
usr/include/linux/blktrace_api.h:96: found __[us]{8,16,32,64} type without #include
Signed-off-by: Jaswinder Singh Rajput
27 Jan, 2009
1 commit
-
Also make sure sparse (make C=2 block/blktrace.o) is happy too.
Reported-by: Ingo Molnar
Signed-off-by: Arnaldo Carvalho de Melo
Signed-off-by: Ingo Molnar
26 Nov, 2008
1 commit
-
This was a forward port of work done by Mathieu Desnoyers, I changed it to
encode the 'what' parameter on the tracepoint name, so that one can register
interest in specific events and not on classes of events to then check the
'what' parameter.Signed-off-by: Arnaldo Carvalho de Melo
Signed-off-by: Jens Axboe
Signed-off-by: Ingo Molnar
17 Oct, 2008
1 commit
-
This patch adds the new api call blk_add_driver_data() to blktrace.
It allows to trace device driver-specific binary data.Signed-off-by: Stefan Raspl
Signed-off-by: Martin Peschke
Signed-off-by: Jens Axboe
09 Oct, 2008
4 commits
-
Define as 32, which is is what BDEVNAME_SIZE is/was as well. This keeps
the user interface the same and gets rid of the difference between
kernel and user api here.Signed-off-by: Jens Axboe
-
This header file is of interest for user space programming, i.e.
for tools that process blktrace data.We would like to use it for a tool on-top of blktrace which processes
data provided by blktrace. For this purpose, it would be helpful
if the blktrace API would make it to /usr/include/linux.The git tree for the blktrace tools comes with its own copy of this header
file. I didn't manage to replace that copy with the file generated
by the patch below yet. A few more cleanups would be needed.
For example, the blktrace ioctl numbers, which are currently defined in
usr/include/fs.h, might need to be moved. Should be feasible, though.Signed-off-by: Sven Schuetz
Signed-off-by: Martin Peschke
Signed-off-by: Jens Axboe -
Signed-off-by: Mike Anderson
Signed-off-by: Jens Axboe -
Signed-off-by: David Woodhouse
Signed-off-by: Jens Axboe
03 Jul, 2008
1 commit
-
This allows a user to annotate the blk trace stream: writing a suitable
message to {/sys/kernel/debug}/block//msg will have it propagated
into the trace stream.Signed-off-by: Alan D. Brunelle
Signed-off-by: Jens Axboe
28 May, 2008
2 commits
-
Currently it uses a single static char array, but that risks
being corrupted when multiple users issue message notes at the
same time. Make the buffers dynamically allocated when the trace
is setup and make them per-cpu instead.The default max message size of 1k is also very large, the
interface is mainly for small text notes. So shrink it to 128 bytes.Signed-off-by: Jens Axboe
-
Allows messages to be inserted into blktrace streams.
Signed-off-by: Alan D. Brunelle
Signed-off-by: Jens Axboe
30 Jan, 2008
1 commit
-
request_queue_t is deprecated
Signed-off-by: Martin K. Petersen
Signed-off-by: Jens Axboe
28 Jan, 2008
1 commit
-
Since the SCSI layer uses the request queues from the block layer, blktrace can
also be used to trace the requests to all SCSI devices (like SCSI tape drives),
not only disks. The only missing part is the ioctl interface to start and stop
tracing.This patch adds the SETUP, START, STOP and TEARDOWN ioctls from blktrace to the
sg device files. With this change, blktrace can be used for SCSI devices like
for disks, e.g.: blktrace -d /dev/sg1 -o - | blkparse -i -Signed-off-by: Christof Schmitt
Signed-off-by: Jens Axboe
12 Oct, 2007
2 commits
-
We don't have the request queue definition, so just make it a
macro instead.Signed-off-by: Jens Axboe
-
I get a compilation error in sglist-arch branch
with BLK_DEV_IO_TRACE=n:CC block/compat_ioctl.o
/usr0/export/dev/bharrosh/git/pub/linux-2.6-block/block/compat_ioctl.c: In
function ?compat_blk_trace_setup?:
/usr0/export/dev/bharrosh/git/pub/linux-2.6-block/block/compat_ioctl.c:568:
error: expected expression before ?do?
make[2]: *** [block/compat_ioctl.o] Error 1Signed-off-by: Jens Axboe