diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2012-08-23 10:37:59 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-09-24 05:47:20 -0400 |
commit | 9e733d3923fb0e4eeae7b827019332d246576a22 (patch) | |
tree | 37fc39212545c6bc3c2de8f0293cb9952802f1e8 /fs/gfs2/trace_gfs2.h | |
parent | 137834a696fd51ef8c710a0ad854b585027c7df0 (diff) |
GFS2: Improve block reservation tracing
This patch improves the tracing of block reservations by
removing some corner cases and also providing more useful
detail in the traces.
A new field is added to the reservation structure to contain
the inode number. This is used since in certain contexts it is
not possible to access the inode itself to obtain this information.
As a result we can then display the inode number for all tracepoints
and also in case we dump the resource group.
The "del" tracepoint operation has been removed. This could be called
with the reservation rgrp set to NULL. That resulted in not printing
the device number, and thus making the information largely useless
anyway. Also, the conditional on the rgrp being NULL can then be
removed from the tracepoint. After this change, all the block
reservation tracepoint calls will be called with the rgrp information.
The existing ins,clm and tdel calls to the block reservation tracepoint
are sufficient to track the entire life of the block reservation.
In gfs2_block_alloc() the error detection is updated to print out
the inode number of the problematic inode. This can then be compared
against the information in the glock dump,tracepoints, etc.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/trace_gfs2.h')
-rw-r--r-- | fs/gfs2/trace_gfs2.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/gfs2/trace_gfs2.h b/fs/gfs2/trace_gfs2.h index b947aa4dfca4..bbdc78af60ca 100644 --- a/fs/gfs2/trace_gfs2.h +++ b/fs/gfs2/trace_gfs2.h | |||
@@ -509,10 +509,9 @@ TRACE_EVENT(gfs2_block_alloc, | |||
509 | /* Keep track of multi-block reservations as they are allocated/freed */ | 509 | /* Keep track of multi-block reservations as they are allocated/freed */ |
510 | TRACE_EVENT(gfs2_rs, | 510 | TRACE_EVENT(gfs2_rs, |
511 | 511 | ||
512 | TP_PROTO(const struct gfs2_inode *ip, const struct gfs2_blkreserv *rs, | 512 | TP_PROTO(const struct gfs2_blkreserv *rs, u8 func), |
513 | u8 func), | ||
514 | 513 | ||
515 | TP_ARGS(ip, rs, func), | 514 | TP_ARGS(rs, func), |
516 | 515 | ||
517 | TP_STRUCT__entry( | 516 | TP_STRUCT__entry( |
518 | __field( dev_t, dev ) | 517 | __field( dev_t, dev ) |
@@ -526,18 +525,17 @@ TRACE_EVENT(gfs2_rs, | |||
526 | ), | 525 | ), |
527 | 526 | ||
528 | TP_fast_assign( | 527 | TP_fast_assign( |
529 | __entry->dev = rs->rs_rbm.rgd ? rs->rs_rbm.rgd->rd_sbd->sd_vfs->s_dev : 0; | 528 | __entry->dev = rs->rs_rbm.rgd->rd_sbd->sd_vfs->s_dev; |
530 | __entry->rd_addr = rs->rs_rbm.rgd ? rs->rs_rbm.rgd->rd_addr : 0; | 529 | __entry->rd_addr = rs->rs_rbm.rgd->rd_addr; |
531 | __entry->rd_free_clone = rs->rs_rbm.rgd ? rs->rs_rbm.rgd->rd_free_clone : 0; | 530 | __entry->rd_free_clone = rs->rs_rbm.rgd->rd_free_clone; |
532 | __entry->rd_reserved = rs->rs_rbm.rgd ? rs->rs_rbm.rgd->rd_reserved : 0; | 531 | __entry->rd_reserved = rs->rs_rbm.rgd->rd_reserved; |
533 | __entry->inum = ip ? ip->i_no_addr : 0; | 532 | __entry->inum = rs->rs_inum; |
534 | __entry->start = gfs2_rbm_to_block(&rs->rs_rbm); | 533 | __entry->start = gfs2_rbm_to_block(&rs->rs_rbm); |
535 | __entry->free = rs->rs_free; | 534 | __entry->free = rs->rs_free; |
536 | __entry->func = func; | 535 | __entry->func = func; |
537 | ), | 536 | ), |
538 | 537 | ||
539 | TP_printk("%u,%u bmap %llu resrv %llu rg:%llu rf:%lu rr:%lu %s " | 538 | TP_printk("%u,%u bmap %llu resrv %llu rg:%llu rf:%lu rr:%lu %s f:%lu", |
540 | "f:%lu", | ||
541 | MAJOR(__entry->dev), MINOR(__entry->dev), | 539 | MAJOR(__entry->dev), MINOR(__entry->dev), |
542 | (unsigned long long)__entry->inum, | 540 | (unsigned long long)__entry->inum, |
543 | (unsigned long long)__entry->start, | 541 | (unsigned long long)__entry->start, |