diff options
author | Hans Holmberg <hans.holmberg@cnexlabs.com> | 2018-10-09 07:11:52 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-10-09 10:25:07 -0400 |
commit | 4c44abf43d00d81f5c648f376c436a9405980efc (patch) | |
tree | 667edc9d1354b56dd4b71755c298f5911fbac871 /drivers/lightnvm/pblk-write.c | |
parent | 43241cfe470850a590913a86e590fd4ad9939d59 (diff) |
lightnvm: pblk: add trace events for chunk states
Introduce trace points for tracking chunk states in pblk - this is
useful for inspection of the entire state of the drive, and real handy
for both fw and pblk debugging.
Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-write.c')
-rw-r--r-- | drivers/lightnvm/pblk-write.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c index 674ba4d1a9f4..61fe22ccc7a1 100644 --- a/drivers/lightnvm/pblk-write.c +++ b/drivers/lightnvm/pblk-write.c | |||
@@ -16,6 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "pblk.h" | 18 | #include "pblk.h" |
19 | #include "pblk-trace.h" | ||
19 | 20 | ||
20 | static unsigned long pblk_end_w_bio(struct pblk *pblk, struct nvm_rq *rqd, | 21 | static unsigned long pblk_end_w_bio(struct pblk *pblk, struct nvm_rq *rqd, |
21 | struct pblk_c_ctx *c_ctx) | 22 | struct pblk_c_ctx *c_ctx) |
@@ -251,11 +252,13 @@ static void pblk_end_io_write(struct nvm_rq *rqd) | |||
251 | if (rqd->error) { | 252 | if (rqd->error) { |
252 | pblk_end_w_fail(pblk, rqd); | 253 | pblk_end_w_fail(pblk, rqd); |
253 | return; | 254 | return; |
254 | } | 255 | } else { |
256 | if (trace_pblk_chunk_state_enabled()) | ||
257 | pblk_check_chunk_state_update(pblk, rqd); | ||
255 | #ifdef CONFIG_NVM_PBLK_DEBUG | 258 | #ifdef CONFIG_NVM_PBLK_DEBUG |
256 | else | ||
257 | WARN_ONCE(rqd->bio->bi_status, "pblk: corrupted write error\n"); | 259 | WARN_ONCE(rqd->bio->bi_status, "pblk: corrupted write error\n"); |
258 | #endif | 260 | #endif |
261 | } | ||
259 | 262 | ||
260 | pblk_complete_write(pblk, rqd, c_ctx); | 263 | pblk_complete_write(pblk, rqd, c_ctx); |
261 | atomic_dec(&pblk->inflight_io); | 264 | atomic_dec(&pblk->inflight_io); |
@@ -276,6 +279,9 @@ static void pblk_end_io_write_meta(struct nvm_rq *rqd) | |||
276 | pblk_log_write_err(pblk, rqd); | 279 | pblk_log_write_err(pblk, rqd); |
277 | pblk_err(pblk, "metadata I/O failed. Line %d\n", line->id); | 280 | pblk_err(pblk, "metadata I/O failed. Line %d\n", line->id); |
278 | line->w_err_gc->has_write_err = 1; | 281 | line->w_err_gc->has_write_err = 1; |
282 | } else { | ||
283 | if (trace_pblk_chunk_state_enabled()) | ||
284 | pblk_check_chunk_state_update(pblk, rqd); | ||
279 | } | 285 | } |
280 | 286 | ||
281 | sync = atomic_add_return(rqd->nr_ppas, &emeta->sync); | 287 | sync = atomic_add_return(rqd->nr_ppas, &emeta->sync); |