summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Pestov <sp@daterainc.com>2015-01-31 21:40:05 -0800
committerKent Overstreet <kmo@daterainc.com>2015-02-12 23:43:39 -0800
commite5db677cbaf80db41437b94ce13414a62a131830 (patch)
treef03ebaf297135a798b44e710e2573f32e897f8ba
parentc56aa97932e8d5666e0d49e751f4d0f10652907e (diff)
bcache: improve journal tracepoints
Change-Id: I0893e6555d399757a24d51c0495180ed87069479
-rw-r--r--drivers/md/bcache/journal.c3
-rw-r--r--include/trace/events/bcache.h31
2 files changed, 28 insertions, 6 deletions
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index 171b0676f3ac..027293ba9bba 100644
--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -840,6 +840,8 @@ static void journal_next_bucket(struct cache_set *c)
ja->cur_idx)),
ca->sb.nr_this_dev);
+ trace_bcache_journal_next_bucket(ca, ja->cur_idx,
+ ja->last_idx, ja->discard_idx);
bch_set_extent_ptrs(e, bch_extent_ptrs(e) + 1);
}
@@ -1182,6 +1184,7 @@ static bool __journal_res_get(struct cache_set *c, struct journal_res *res,
if (!journal_bucket_has_room(c)) {
/* Still no room, we have to wait */
spin_unlock(&c->journal.lock);
+ trace_bcache_journal_full(c);
return false;
}
}
diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
index 66c2653267c6..4edfd7ed78c6 100644
--- a/include/trace/events/bcache.h
+++ b/include/trace/events/bcache.h
@@ -251,6 +251,30 @@ DEFINE_EVENT(bkey, bcache_journal_replay_key,
TP_ARGS(k)
);
+TRACE_EVENT(bcache_journal_next_bucket,
+ TP_PROTO(struct cache *ca, unsigned cur_idx,
+ unsigned last_idx, unsigned discard_idx),
+ TP_ARGS(ca, cur_idx, last_idx, discard_idx),
+
+ TP_STRUCT__entry(
+ __array(char, uuid, 16 )
+ __field(unsigned, cur_idx )
+ __field(unsigned, last_idx )
+ __field(unsigned, discard_idx )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->uuid, ca->sb.disk_uuid.b, 16);
+ __entry->cur_idx = cur_idx;
+ __entry->last_idx = last_idx;
+ __entry->discard_idx = discard_idx;
+ ),
+
+ TP_printk("%pU cur %u last %u discard %u",
+ __entry->uuid, __entry->cur_idx,
+ __entry->last_idx, __entry->discard_idx)
+);
+
TRACE_EVENT(bcache_journal_write_oldest,
TP_PROTO(struct cache_set *c, u64 seq),
TP_ARGS(c, seq),
@@ -288,12 +312,7 @@ TRACE_EVENT(bcache_journal_write_oldest_done,
__entry->written)
);
-DEFINE_EVENT(cache_set, bcache_journal_discard_wait,
- TP_PROTO(struct cache_set *c),
- TP_ARGS(c)
-);
-
-DEFINE_EVENT(cache_set, bcache_journal_fifo_full,
+DEFINE_EVENT(cache_set, bcache_journal_full,
TP_PROTO(struct cache_set *c),
TP_ARGS(c)
);