From patchwork Fri Sep 29 19:43:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9978541 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 DBB9860311 for ; Fri, 29 Sep 2017 19:44:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE2772766D for ; Fri, 29 Sep 2017 19:44:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C31EB28448; Fri, 29 Sep 2017 19:44:19 +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 47DE628446 for ; Fri, 29 Sep 2017 19:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752475AbdI2ToQ (ORCPT ); Fri, 29 Sep 2017 15:44:16 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:55990 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380AbdI2ToM (ORCPT ); Fri, 29 Sep 2017 15:44:12 -0400 Received: by mail-qt0-f195.google.com with SMTP id x54so896531qth.12 for ; Fri, 29 Sep 2017 12:44:12 -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=pCqGHOApLHStX9ye1e5u8hDTLKN9eg/tlLKZQJyuaIM=; b=HNakwEBHtTpMOS19oGBhm6JxzmhQdnKWYaf4VNfrLpXesV2R3iQbVL2/QHSL2/DlCv OY20p/v1iHQtBMCgtYqi+lAIBVCTICI+wF3HGcaZeWtAjtC4EIqFYUMyED8b4EfchR+3 ddGh6YOH3r4m5dfRjsfrFEcXE+3rMTvK6Bb6spPR8l98arDp1n/ubQDvB2taDJ29nG0g BLBGNw4baEWBPLT5IMdX4llItbM0Jt6kwMhQaS/Azk4boX+frGxicTeL1beG9rfQaiN3 uT/JVoHFJfMzsMl1wZHV2dXwqQDcXnyYiCop+qml7Azbl77ny8Exfa/wakd459lXOizR zylA== 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=pCqGHOApLHStX9ye1e5u8hDTLKN9eg/tlLKZQJyuaIM=; b=rvZchLV7UfbEcZbiddMIF1YU5QLny3xJNDgcyuQR/cuTYu8IU4OUqCSlxIcg+Q1Fwd eWFriQth9Nb5kStWoersJ7x2ose/xSKgPHz1jHoOLMwBrEquyXxXpPEDoSnXN09Icb0x qCWBNgGSUQfjvgGPYdjMMzneFhQj8sePTrFoXOH89O5OPVx6FOEdNgbTB4OoVRTv2+yx QLzsN0KcE9SEz3GUL7HsrzsFJxqC/P8WRBAiTZbarqv0wRIztP4vjiC2phVrM33jK9u/ bsVykpTU8Np0OrSGyWXAAD+ZKZhczIJLeYeTMLsRB9+SNLonfscNSKiTnoAE2TBa9Ahr u7Eg== X-Gm-Message-State: AMCzsaX87+xxreK3nmmbsZUaeeRtV4WE4Anxu4M0T8BCjJnBDfcZFmYs QQSwtCb+iQh5ByyjUQt6ZliEqouS X-Google-Smtp-Source: AOwi7QB6+0sOK0YJURsXqeK701GBE01WAJnDu/6l0KKN5mVRjCup4x9W0b4sbyIYdDE8zCk6uT5OrQ== X-Received: by 10.237.59.25 with SMTP id p25mr7400241qte.99.1506714251889; Fri, 29 Sep 2017 12:44:11 -0700 (PDT) Received: from localhost ([2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id u4sm3153487qtg.14.2017.09.29.12.44.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 12:44:11 -0700 (PDT) From: Josef Bacik X-Google-Original-From: Josef Bacik To: kernel-team@fb.com, linux-btrfs@vger.kernel.org Subject: [PATCH 02/21] btrfs: add tracepoints for outstanding extents mods Date: Fri, 29 Sep 2017 15:43:46 -0400 Message-Id: <1506714245-23072-3-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506714245-23072-1-git-send-email-jbacik@fb.com> References: <1506714245-23072-1-git-send-email-jbacik@fb.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 a6a22ef41f91..22daa79e77b8 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 77437f545c63..f0a374a720b0 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -1698,6 +1698,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 */