From patchwork Wed Jan 10 21:50:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10156201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2ACEA60231 for ; Wed, 10 Jan 2018 21:50:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B4642853A for ; Wed, 10 Jan 2018 21:50:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F8A12854A; Wed, 10 Jan 2018 21:50:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87A402853C for ; Wed, 10 Jan 2018 21:50:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751062AbeAJVuH (ORCPT ); Wed, 10 Jan 2018 16:50:07 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:34710 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238AbeAJVuH (ORCPT ); Wed, 10 Jan 2018 16:50:07 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0ALlHei109783 for ; Wed, 10 Jan 2018 21:50:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=qrQ++N3PTTAxz8hSzxAl/L9uyiuBFP5tAZU3PTbCXfQ=; b=AVoTkgqia/YJLdS4NXFIwfc6RVcMa5FEKG0CDPDYf/UvNZRdVDyxsjt0rtrTJf9LvnKp g8CUf8hkgJr2EbHHhYTb0KWQTNbt8mQ7zxqe5NdLyjWXxKU4fm/HdV6LpdKNdKgUcrrs qjO9+aIqDuRqUNWQlnHJdYuSktnwqouCKIJaXBmE0SMtY33m8tIn3aMC2ZHPAYqAjgqh vU0WrFRDpPRIOPnIzyK2BVn2XfhFc6oKfin6TuUx4OAJZqFgZf0oZnhvPbgDtVoqPf5u Gng9KhAn4pk0bRydo+Zn5uNtnPF/9O1QO3tUJ7yw2ZWQ9PDpHQR0M7JnrSt2roCoUOEk 4g== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2fdtjur527-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 10 Jan 2018 21:50:06 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0ALo5Dt012929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 10 Jan 2018 21:50:05 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0ALo4Oc030225 for ; Wed, 10 Jan 2018 21:50:04 GMT Received: from localhost (/65.154.186.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 10 Jan 2018 13:50:04 -0800 Date: Wed, 10 Jan 2018 13:50:03 -0800 From: "Darrick J. Wong" To: xfs Subject: [PATCH] xfs: record whichfork in iext tracepoints Message-ID: <20180110215003.GT5602@magnolia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8770 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801100298 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Record the whichfork number of the fork being operated on in iext tracepoints. This makes it easier to trace our way through complex remapping operations like copy on write. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_trace.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index cd87985..1c38b79 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -233,6 +233,7 @@ DECLARE_EVENT_CLASS(xfs_bmap_class, __field(xfs_exntst_t, state) __field(int, bmap_state) __field(unsigned long, caller_ip) + __field(int, whichfork) ), TP_fast_assign( struct xfs_ifork *ifp; @@ -250,11 +251,19 @@ DECLARE_EVENT_CLASS(xfs_bmap_class, __entry->state = r.br_state; __entry->bmap_state = state; __entry->caller_ip = caller_ip; - ), - TP_printk("dev %d:%d ino 0x%llx state %s cur 0x%p/%d " + if (ifp == XFS_IFORK_PTR(ip, XFS_DATA_FORK)) + __entry->whichfork = XFS_DATA_FORK; + else if (ifp == XFS_IFORK_PTR(ip, XFS_ATTR_FORK)) + __entry->whichfork = XFS_ATTR_FORK; + else if (ifp == XFS_IFORK_PTR(ip, XFS_COW_FORK)) + __entry->whichfork = XFS_COW_FORK; + else + __entry->whichfork = -1; + ), + TP_printk("dev %d:%d ino 0x%llx fork %d state %s cur 0x%p/%d " "offset %lld block %lld count %lld flag %d caller %ps", MAJOR(__entry->dev), MINOR(__entry->dev), - __entry->ino, + __entry->ino, __entry->whichfork, __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), __entry->leaf, __entry->pos,