diff options
author | Kent Overstreet <koverstreet@google.com> | 2013-04-26 18:39:55 -0400 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2013-06-26 20:09:15 -0400 |
commit | c37511b863f36c1cc6e18440717fd4cc0e881b8a (patch) | |
tree | 64d82c648bd092f38c35c4b808411bc1cdb3a9f0 /drivers/md/bcache/movinggc.c | |
parent | 5794351146199b9ac67a5ab1beab82be8bfd7b5d (diff) |
bcache: Fix/revamp tracepoints
The tracepoints were reworked to be more sensible, and fixed a null
pointer deref in one of the tracepoints.
Converted some of the pr_debug()s to tracepoints - this is partly a
performance optimization; it used to be that with DEBUG or
CONFIG_DYNAMIC_DEBUG pr_debug() was an empty macro; but at some point it
was changed to an empty inline function.
Some of the pr_debug() statements had rather expensive function calls as
part of the arguments, so this code was getting run unnecessarily even
on non debug kernels - in some fast paths, too.
Signed-off-by: Kent Overstreet <koverstreet@google.com>
Diffstat (limited to 'drivers/md/bcache/movinggc.c')
-rw-r--r-- | drivers/md/bcache/movinggc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/md/bcache/movinggc.c b/drivers/md/bcache/movinggc.c index 8589512c972e..04f6b97ffda6 100644 --- a/drivers/md/bcache/movinggc.c +++ b/drivers/md/bcache/movinggc.c | |||
@@ -9,6 +9,8 @@ | |||
9 | #include "debug.h" | 9 | #include "debug.h" |
10 | #include "request.h" | 10 | #include "request.h" |
11 | 11 | ||
12 | #include <trace/events/bcache.h> | ||
13 | |||
12 | struct moving_io { | 14 | struct moving_io { |
13 | struct keybuf_key *w; | 15 | struct keybuf_key *w; |
14 | struct search s; | 16 | struct search s; |
@@ -49,9 +51,8 @@ static void write_moving_finish(struct closure *cl) | |||
49 | while (bv-- != bio->bi_io_vec) | 51 | while (bv-- != bio->bi_io_vec) |
50 | __free_page(bv->bv_page); | 52 | __free_page(bv->bv_page); |
51 | 53 | ||
52 | pr_debug("%s %s", io->s.op.insert_collision | 54 | if (io->s.op.insert_collision) |
53 | ? "collision moving" : "moved", | 55 | trace_bcache_gc_copy_collision(&io->w->key); |
54 | pkey(&io->w->key)); | ||
55 | 56 | ||
56 | bch_keybuf_del(&io->s.op.c->moving_gc_keys, io->w); | 57 | bch_keybuf_del(&io->s.op.c->moving_gc_keys, io->w); |
57 | 58 | ||
@@ -94,8 +95,6 @@ static void write_moving(struct closure *cl) | |||
94 | struct moving_io *io = container_of(s, struct moving_io, s); | 95 | struct moving_io *io = container_of(s, struct moving_io, s); |
95 | 96 | ||
96 | if (!s->error) { | 97 | if (!s->error) { |
97 | trace_bcache_write_moving(&io->bio.bio); | ||
98 | |||
99 | moving_init(io); | 98 | moving_init(io); |
100 | 99 | ||
101 | io->bio.bio.bi_sector = KEY_START(&io->w->key); | 100 | io->bio.bio.bi_sector = KEY_START(&io->w->key); |
@@ -122,7 +121,6 @@ static void read_moving_submit(struct closure *cl) | |||
122 | struct moving_io *io = container_of(s, struct moving_io, s); | 121 | struct moving_io *io = container_of(s, struct moving_io, s); |
123 | struct bio *bio = &io->bio.bio; | 122 | struct bio *bio = &io->bio.bio; |
124 | 123 | ||
125 | trace_bcache_read_moving(bio); | ||
126 | bch_submit_bbio(bio, s->op.c, &io->w->key, 0); | 124 | bch_submit_bbio(bio, s->op.c, &io->w->key, 0); |
127 | 125 | ||
128 | continue_at(cl, write_moving, bch_gc_wq); | 126 | continue_at(cl, write_moving, bch_gc_wq); |
@@ -162,7 +160,7 @@ static void read_moving(struct closure *cl) | |||
162 | if (bch_bio_alloc_pages(bio, GFP_KERNEL)) | 160 | if (bch_bio_alloc_pages(bio, GFP_KERNEL)) |
163 | goto err; | 161 | goto err; |
164 | 162 | ||
165 | pr_debug("%s", pkey(&w->key)); | 163 | trace_bcache_gc_copy(&w->key); |
166 | 164 | ||
167 | closure_call(&io->s.cl, read_moving_submit, NULL, &c->gc.cl); | 165 | closure_call(&io->s.cl, read_moving_submit, NULL, &c->gc.cl); |
168 | 166 | ||