diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-12-26 18:03:07 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-12-28 09:57:14 -0500 |
commit | f4848303ce125999886535323a64db26dba68293 (patch) | |
tree | 6b2981ae3c98b926260756e8556518112f3809b9 | |
parent | f2dd436edb2b38b555f3ff7257308bb56fa4eea5 (diff) |
pNFS: Modify pnfs_update_layout tracepoints to use layout stateid
Instead of displaying a layout segment pointer in these tracepoints,
let's use the layout stateid, now that Olga gave us a set of tools for
displaying them.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/nfs4trace.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4trace.h | 23 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 20 |
3 files changed, 28 insertions, 16 deletions
diff --git a/fs/nfs/nfs4trace.c b/fs/nfs/nfs4trace.c index d774335cc8bc..2850bce19244 100644 --- a/fs/nfs/nfs4trace.c +++ b/fs/nfs/nfs4trace.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include "internal.h" | 6 | #include "internal.h" |
7 | #include "nfs4session.h" | 7 | #include "nfs4session.h" |
8 | #include "callback.h" | 8 | #include "callback.h" |
9 | #include "pnfs.h" | ||
9 | 10 | ||
10 | #define CREATE_TRACE_POINTS | 11 | #define CREATE_TRACE_POINTS |
11 | #include "nfs4trace.h" | 12 | #include "nfs4trace.h" |
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 238925c1aafd..d08d0c84b778 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h | |||
@@ -1461,10 +1461,10 @@ TRACE_EVENT(pnfs_update_layout, | |||
1461 | loff_t pos, | 1461 | loff_t pos, |
1462 | u64 count, | 1462 | u64 count, |
1463 | enum pnfs_iomode iomode, | 1463 | enum pnfs_iomode iomode, |
1464 | struct pnfs_layout_segment *lseg, | 1464 | struct pnfs_layout_hdr *lo, |
1465 | enum pnfs_update_layout_reason reason | 1465 | enum pnfs_update_layout_reason reason |
1466 | ), | 1466 | ), |
1467 | TP_ARGS(inode, pos, count, iomode, lseg, reason), | 1467 | TP_ARGS(inode, pos, count, iomode, lo, reason), |
1468 | TP_STRUCT__entry( | 1468 | TP_STRUCT__entry( |
1469 | __field(dev_t, dev) | 1469 | __field(dev_t, dev) |
1470 | __field(u64, fileid) | 1470 | __field(u64, fileid) |
@@ -1472,7 +1472,8 @@ TRACE_EVENT(pnfs_update_layout, | |||
1472 | __field(loff_t, pos) | 1472 | __field(loff_t, pos) |
1473 | __field(u64, count) | 1473 | __field(u64, count) |
1474 | __field(enum pnfs_iomode, iomode) | 1474 | __field(enum pnfs_iomode, iomode) |
1475 | __field(struct pnfs_layout_segment *, lseg) | 1475 | __field(int, layoutstateid_seq) |
1476 | __field(u32, layoutstateid_hash) | ||
1476 | __field(enum pnfs_update_layout_reason, reason) | 1477 | __field(enum pnfs_update_layout_reason, reason) |
1477 | ), | 1478 | ), |
1478 | TP_fast_assign( | 1479 | TP_fast_assign( |
@@ -1482,18 +1483,28 @@ TRACE_EVENT(pnfs_update_layout, | |||
1482 | __entry->pos = pos; | 1483 | __entry->pos = pos; |
1483 | __entry->count = count; | 1484 | __entry->count = count; |
1484 | __entry->iomode = iomode; | 1485 | __entry->iomode = iomode; |
1485 | __entry->lseg = lseg; | ||
1486 | __entry->reason = reason; | 1486 | __entry->reason = reason; |
1487 | if (lo != NULL) { | ||
1488 | __entry->layoutstateid_seq = | ||
1489 | be32_to_cpu(lo->plh_stateid.seqid); | ||
1490 | __entry->layoutstateid_hash = | ||
1491 | nfs_stateid_hash(&lo->plh_stateid); | ||
1492 | } else { | ||
1493 | __entry->layoutstateid_seq = 0; | ||
1494 | __entry->layoutstateid_hash = 0; | ||
1495 | } | ||
1487 | ), | 1496 | ), |
1488 | TP_printk( | 1497 | TP_printk( |
1489 | "fileid=%02x:%02x:%llu fhandle=0x%08x " | 1498 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
1490 | "iomode=%s pos=%llu count=%llu lseg=%p (%s)", | 1499 | "iomode=%s pos=%llu count=%llu " |
1500 | "layoutstateid=%d:0x%08x (%s)", | ||
1491 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1501 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1492 | (unsigned long long)__entry->fileid, | 1502 | (unsigned long long)__entry->fileid, |
1493 | __entry->fhandle, | 1503 | __entry->fhandle, |
1494 | show_pnfs_iomode(__entry->iomode), | 1504 | show_pnfs_iomode(__entry->iomode), |
1495 | (unsigned long long)__entry->pos, | 1505 | (unsigned long long)__entry->pos, |
1496 | (unsigned long long)__entry->count, __entry->lseg, | 1506 | (unsigned long long)__entry->count, |
1507 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, | ||
1497 | show_pnfs_update_layout_reason(__entry->reason) | 1508 | show_pnfs_update_layout_reason(__entry->reason) |
1498 | ) | 1509 | ) |
1499 | ); | 1510 | ); |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 1489065bb051..6095a8d42766 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -1521,19 +1521,19 @@ pnfs_update_layout(struct inode *ino, | |||
1521 | bool first; | 1521 | bool first; |
1522 | 1522 | ||
1523 | if (!pnfs_enabled_sb(NFS_SERVER(ino))) { | 1523 | if (!pnfs_enabled_sb(NFS_SERVER(ino))) { |
1524 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1524 | trace_pnfs_update_layout(ino, pos, count, iomode, NULL, |
1525 | PNFS_UPDATE_LAYOUT_NO_PNFS); | 1525 | PNFS_UPDATE_LAYOUT_NO_PNFS); |
1526 | goto out; | 1526 | goto out; |
1527 | } | 1527 | } |
1528 | 1528 | ||
1529 | if (iomode == IOMODE_READ && i_size_read(ino) == 0) { | 1529 | if (iomode == IOMODE_READ && i_size_read(ino) == 0) { |
1530 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1530 | trace_pnfs_update_layout(ino, pos, count, iomode, NULL, |
1531 | PNFS_UPDATE_LAYOUT_RD_ZEROLEN); | 1531 | PNFS_UPDATE_LAYOUT_RD_ZEROLEN); |
1532 | goto out; | 1532 | goto out; |
1533 | } | 1533 | } |
1534 | 1534 | ||
1535 | if (pnfs_within_mdsthreshold(ctx, ino, iomode)) { | 1535 | if (pnfs_within_mdsthreshold(ctx, ino, iomode)) { |
1536 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1536 | trace_pnfs_update_layout(ino, pos, count, iomode, NULL, |
1537 | PNFS_UPDATE_LAYOUT_MDSTHRESH); | 1537 | PNFS_UPDATE_LAYOUT_MDSTHRESH); |
1538 | goto out; | 1538 | goto out; |
1539 | } | 1539 | } |
@@ -1544,14 +1544,14 @@ lookup_again: | |||
1544 | lo = pnfs_find_alloc_layout(ino, ctx, gfp_flags); | 1544 | lo = pnfs_find_alloc_layout(ino, ctx, gfp_flags); |
1545 | if (lo == NULL) { | 1545 | if (lo == NULL) { |
1546 | spin_unlock(&ino->i_lock); | 1546 | spin_unlock(&ino->i_lock); |
1547 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1547 | trace_pnfs_update_layout(ino, pos, count, iomode, NULL, |
1548 | PNFS_UPDATE_LAYOUT_NOMEM); | 1548 | PNFS_UPDATE_LAYOUT_NOMEM); |
1549 | goto out; | 1549 | goto out; |
1550 | } | 1550 | } |
1551 | 1551 | ||
1552 | /* Do we even need to bother with this? */ | 1552 | /* Do we even need to bother with this? */ |
1553 | if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) { | 1553 | if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) { |
1554 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1554 | trace_pnfs_update_layout(ino, pos, count, iomode, lo, |
1555 | PNFS_UPDATE_LAYOUT_BULK_RECALL); | 1555 | PNFS_UPDATE_LAYOUT_BULK_RECALL); |
1556 | dprintk("%s matches recall, use MDS\n", __func__); | 1556 | dprintk("%s matches recall, use MDS\n", __func__); |
1557 | goto out_unlock; | 1557 | goto out_unlock; |
@@ -1560,7 +1560,7 @@ lookup_again: | |||
1560 | /* if LAYOUTGET already failed once we don't try again */ | 1560 | /* if LAYOUTGET already failed once we don't try again */ |
1561 | if (pnfs_layout_io_test_failed(lo, iomode) && | 1561 | if (pnfs_layout_io_test_failed(lo, iomode) && |
1562 | !pnfs_should_retry_layoutget(lo)) { | 1562 | !pnfs_should_retry_layoutget(lo)) { |
1563 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1563 | trace_pnfs_update_layout(ino, pos, count, iomode, lo, |
1564 | PNFS_UPDATE_LAYOUT_IO_TEST_FAIL); | 1564 | PNFS_UPDATE_LAYOUT_IO_TEST_FAIL); |
1565 | goto out_unlock; | 1565 | goto out_unlock; |
1566 | } | 1566 | } |
@@ -1584,7 +1584,7 @@ lookup_again: | |||
1584 | */ | 1584 | */ |
1585 | lseg = pnfs_find_lseg(lo, &arg); | 1585 | lseg = pnfs_find_lseg(lo, &arg); |
1586 | if (lseg) { | 1586 | if (lseg) { |
1587 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1587 | trace_pnfs_update_layout(ino, pos, count, iomode, lo, |
1588 | PNFS_UPDATE_LAYOUT_FOUND_CACHED); | 1588 | PNFS_UPDATE_LAYOUT_FOUND_CACHED); |
1589 | goto out_unlock; | 1589 | goto out_unlock; |
1590 | } | 1590 | } |
@@ -1604,13 +1604,13 @@ lookup_again: | |||
1604 | dprintk("%s retrying\n", __func__); | 1604 | dprintk("%s retrying\n", __func__); |
1605 | goto lookup_again; | 1605 | goto lookup_again; |
1606 | } | 1606 | } |
1607 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1607 | trace_pnfs_update_layout(ino, pos, count, iomode, lo, |
1608 | PNFS_UPDATE_LAYOUT_RETURN); | 1608 | PNFS_UPDATE_LAYOUT_RETURN); |
1609 | goto out_put_layout_hdr; | 1609 | goto out_put_layout_hdr; |
1610 | } | 1610 | } |
1611 | 1611 | ||
1612 | if (pnfs_layoutgets_blocked(lo)) { | 1612 | if (pnfs_layoutgets_blocked(lo)) { |
1613 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1613 | trace_pnfs_update_layout(ino, pos, count, iomode, lo, |
1614 | PNFS_UPDATE_LAYOUT_BLOCKED); | 1614 | PNFS_UPDATE_LAYOUT_BLOCKED); |
1615 | goto out_unlock; | 1615 | goto out_unlock; |
1616 | } | 1616 | } |
@@ -1638,7 +1638,7 @@ lookup_again: | |||
1638 | lseg = send_layoutget(lo, ctx, &arg, gfp_flags); | 1638 | lseg = send_layoutget(lo, ctx, &arg, gfp_flags); |
1639 | pnfs_clear_retry_layoutget(lo); | 1639 | pnfs_clear_retry_layoutget(lo); |
1640 | atomic_dec(&lo->plh_outstanding); | 1640 | atomic_dec(&lo->plh_outstanding); |
1641 | trace_pnfs_update_layout(ino, pos, count, iomode, lseg, | 1641 | trace_pnfs_update_layout(ino, pos, count, iomode, lo, |
1642 | PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET); | 1642 | PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET); |
1643 | out_put_layout_hdr: | 1643 | out_put_layout_hdr: |
1644 | if (first) | 1644 | if (first) |