From patchwork Thu Oct 19 18:15:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10018113 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 E78EB60215 for ; Thu, 19 Oct 2017 18:16:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E251928DCD for ; Thu, 19 Oct 2017 18:16:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D47FB28DEA; Thu, 19 Oct 2017 18:16:14 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 6060F28DCD for ; Thu, 19 Oct 2017 18:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753964AbdJSSQM (ORCPT ); Thu, 19 Oct 2017 14:16:12 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:43966 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752466AbdJSSQJ (ORCPT ); Thu, 19 Oct 2017 14:16:09 -0400 Received: by mail-qt0-f195.google.com with SMTP id j58so15596377qtj.0 for ; Thu, 19 Oct 2017 11:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=kIXZs1JF+ZT3dTk54dmyaeR+aKqXy72oe96SI/CCyDM=; b=RvSqqNyaXyVcqAgLnr2UxTIQd4jfk2nHEtlWviw3tIg7vd6taRpVNb8F0GixxUGI/p /6QHu7kFVtAi1nmwVGVovOAjtWKboDT3e9HHWPxSY+XCMvhc2MlM9PmQHthuwIQlD7RT kuGkON7rMV3S/A4spqc6EbFhjrKnaSdO8Kd0onLdh3xJcJ+LghoR0QFc6X1WwgOoDON9 xxR+1IsLlSThI8yRTdIm3hS5W+Hb8oUmtvO5n7a6PqeMqDKQoGOpQak2C8lZp7D65ca8 xoqiC9Qt15IhnPhugDQl/foAU6HBFnBVe1AWpUXoGRDk2O23iSsWd7iWc9/pfo3biP0+ osIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=kIXZs1JF+ZT3dTk54dmyaeR+aKqXy72oe96SI/CCyDM=; b=NKFtjbD0lioTv9sFK84NYoiHNjC8b+4NbZGSOOKThRSCpjFI6Lb09emf7k2mR7X2H9 4tW14pRVKUIO2NfHhZ1jJ+UNe/kTRcUnyLkvEJg6NJOvUJ9/3zMLYDzl2DYWC506FYN1 pQK0EZuqTWYJHW+uWooUU8/f8i8KIdYmMqOCEp6JO5UV+2MR1F0ABjNzXROJx50oRqdG QOgY6y5mla2SH0es0Di7bDAXNhJcus8An/sTXsU/muo18aean7erX+G3mEeKESNQ4GEV hSiH6zD6mfAYgtjrIET7OW5UarCG/2Zzgq6OrSnBwGOfaEojJ+trAhGoY6Vq+czXx8xx /sQA== X-Gm-Message-State: AMCzsaWfUuUw7Sfa3I2UU64arvyf1pgJX+2S6/fWgeTs2SWHeg3oP5lC Vex3I44bnVTpygL8DQ5eWmj30A== X-Google-Smtp-Source: ABhQp+QSjVXrBHZuWWB6twtjTl6Vjor9Jzv3aU9HM5Oh1VV6Zjjhbit6n3QmX++rbnK60R4zDeSCDg== X-Received: by 10.237.42.27 with SMTP id c27mr3551819qtd.282.1508436968364; Thu, 19 Oct 2017 11:16:08 -0700 (PDT) Received: from localhost ([2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id t24sm9509647qkt.29.2017.10.19.11.16.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 11:16:07 -0700 (PDT) From: Josef Bacik To: kernel-team@fb.com, linux-btrfs@vger.kernel.org Subject: [PATCH 2/8] btrfs: add tracepoints for outstanding extents mods Date: Thu, 19 Oct 2017 14:15:56 -0400 Message-Id: <1508436962-6851-3-git-send-email-josef@toxicpanda.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1508436962-6851-1-git-send-email-josef@toxicpanda.com> References: <1508436962-6851-1-git-send-email-josef@toxicpanda.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is handy for tracing problems with modifying the outstanding extents counters. Signed-off-by: Josef Bacik --- fs/btrfs/btrfs_inode.h | 2 ++ include/trace/events/btrfs.h | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index e3ac29e72714..5ebeafc19936 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -274,6 +274,8 @@ static inline void btrfs_mod_outstanding_extents(struct btrfs_inode *inode, inode->outstanding_extents += mod; if (btrfs_is_free_space_inode(inode)) return; + trace_btrfs_inode_mod_outstanding_extents(inode->root, btrfs_ino(inode), + mod); } static inline void btrfs_mod_reserved_extents(struct btrfs_inode *inode, diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index bfe2f23b578c..567dcf2022bb 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -1695,6 +1695,27 @@ DEFINE_EVENT(btrfs__prelim_ref, btrfs_prelim_ref_insert, TP_ARGS(fs_info, oldref, newref, tree_size) ); +TRACE_EVENT(btrfs_inode_mod_outstanding_extents, + TP_PROTO(struct btrfs_root *root, u64 ino, int mod), + + TP_ARGS(root, ino, mod), + + TP_STRUCT__entry_btrfs( + __field( u64, root_objectid ) + __field( u64, ino ) + __field( int, mod ) + ), + + TP_fast_assign_btrfs(root->fs_info, + __entry->root_objectid = root->objectid; + __entry->ino = ino; + __entry->mod = mod; + ), + + TP_printk_btrfs("root = %llu(%s) ino = %llu mod = %d", + show_root_type(__entry->root_objectid), + (unsigned long long)__entry->ino, __entry->mod) +); #endif /* _TRACE_BTRFS_H */ /* This part must be outside protection */