Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3624940ybc; Thu, 14 Nov 2019 12:02:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwfLuDrOk/rLTQ8AIfDS+IE/hHzoek6/7w1O8I4Lrbrueagck6KTBxtBUDRXWzhJlYKe5zN X-Received: by 2002:a37:2796:: with SMTP id n144mr9082805qkn.403.1573761758283; Thu, 14 Nov 2019 12:02:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573761758; cv=none; d=google.com; s=arc-20160816; b=Cx9GY2SNHVEMPNwyVGOf6rOmwyDV1iiExzEIUCpMqEYpELnzEyafy1/VspobfPmlPc TXUMex7qRca6/t/8WMCJ/cCTvqyI+fMPKycWaCKvjHiEXtHYQmOf/QjCCCh8xV1rR9Cn iJ5jy+ky+LsO9EjRnvJo6IQL45d16XLVXPkkt/IepJHK1+X6tEBkzyr+cqUQr2HALEAK fCorp88XDzR+Etxcsk3gqhgVES8sjlJwRsPmeAIT6GVAwJJ5VMmOZZL6kc4xyIZwVXfO t2ZlGXSh+HpfYcuFoP86WpTQ+O6xEQ0iGS41TvDzc5PXVUZB5axSlnKRRwADBeep6KfN y77Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=GnQFMIkMVjacXA5wEOUiBzHV78Dm9W/eccNJXi+qLiY=; b=EbY/2Dx1qCvIZhitohcUkq/5AxlJGKv9C2Sq2Wq+dCzt4kpUBFev3pz4Mn5Xr4E/dw i/TvCY1O8FFHcN3qHkjh1+/5YmOuOZQW9UQ8zT9lKSpHjpIzZuzwTB7gTtaXNT9pXXgy zb7o8SJH9Bxfxvz0s8175GiXyBFTR54FFA2rup22bZT45V5d+nQGMDMaEfMWuhdGPjTG 12SnDNvkbdVZnx5exA1VAK6rhZBNyhV0CpuZz7Lq6o0Q+8elKlDPDjo6FK90zd8ENAjt A5KsdddrTQVNef5xQ1b4HVyz7g2qbtoDBauSh4LocNslfOGNzuQaJMv+9zRD7BLOttBg eJyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=m7C44Sqm; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z26si4059871ejb.223.2019.11.14.12.02.04; Thu, 14 Nov 2019 12:02:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=m7C44Sqm; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726474AbfKNUB6 (ORCPT + 99 others); Thu, 14 Nov 2019 15:01:58 -0500 Received: from forwardcorp1p.mail.yandex.net ([77.88.29.217]:39724 "EHLO forwardcorp1p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726444AbfKNUB6 (ORCPT ); Thu, 14 Nov 2019 15:01:58 -0500 Received: from mxbackcorp1o.mail.yandex.net (mxbackcorp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::301]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id ACB6D2E152C; Thu, 14 Nov 2019 23:01:54 +0300 (MSK) Received: from sas1-7fab0cd91cd2.qloud-c.yandex.net (sas1-7fab0cd91cd2.qloud-c.yandex.net [2a02:6b8:c14:3a93:0:640:7fab:cd9]) by mxbackcorp1o.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id JJXvP3aroV-1sIeV3Dt; Thu, 14 Nov 2019 23:01:54 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1573761714; bh=GnQFMIkMVjacXA5wEOUiBzHV78Dm9W/eccNJXi+qLiY=; h=Message-Id:Date:Subject:To:From:Cc; b=m7C44SqmoEohpwOfhIkZSbvtdNVM1ayCaf1MHiFydtzXDu/oJgUcWy7EuPPfriC1t IfqDiWyiI4xOtqXmOVat8dKG5c2e0sBtb+26qH72igcI29XOwos1HQxOMIAwi3ijnd ePV99EKC7/ypG/J1rUcuvXkC1EeGc1ZUuIjXU2rQ= Authentication-Results: mxbackcorp1o.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from 95.108.174.193-red.dhcp.yndx.net (95.108.174.193-red.dhcp.yndx.net [95.108.174.193]) by sas1-7fab0cd91cd2.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id weyrU94q4p-1sVGvBCs; Thu, 14 Nov 2019 23:01:54 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Dmitry Monakhov To: linux-ext4@vger.kernel.org Cc: darrick.wong@oracle.com, tytso@mit.edu, Dmitry Monakhov Subject: [PATCH 1/2] ext4: fix symbolic enum printing in trace output Date: Thu, 14 Nov 2019 20:01:46 +0000 Message-Id: <20191114200147.1073-1-dmonakhov@gmail.com> X-Mailer: git-send-email 2.18.0 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Trace's macro __print_flags() produce raw event's decraration w/o knowing actual flags value cat /sys/kernel/debug/tracing/events/ext4/ext4_ext_map_blocks_exit/format .. __print_flags(REC->mflags, "", { (1 << BH_New), For that reason we have to explicitly define it via special macro TRACE_DEFINE_ENUM() Also add missed EXTENT_STATUS_REFERENCED flag. #Before patch ext4:ext4_ext_map_blocks_exit: dev 253,0 ino 2 flags lblk 0 pblk 4177 len 1 mflags 0x20 ret 1 ext4:ext4_ext_map_blocks_exit: dev 253,0 ino 12 flags CREATE lblk 0 pblk 34304 len 1 mflags 0x60 ret 1 #With patch ext4:ext4_ext_map_blocks_exit: dev 253,0 ino 2 flags lblk 0 pblk 4177 len 1 mflags M ret 1 ext4:ext4_ext_map_blocks_exit: dev 253,0 ino 12 flags CREATE lblk 0 pblk 34816 len 1 mflags NM ret 1 Signed-off-by: Dmitry Monakhov --- include/trace/events/ext4.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 182c9fe..3bf7128 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h @@ -48,6 +48,16 @@ struct partial_cluster; { EXT4_GET_BLOCKS_KEEP_SIZE, "KEEP_SIZE" }, \ { EXT4_GET_BLOCKS_ZERO, "ZERO" }) +/* + * __print_flags() requires that all enum values be wrapped in the + * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace + * ring buffer. + */ +TRACE_DEFINE_ENUM(BH_New); +TRACE_DEFINE_ENUM(BH_Mapped); +TRACE_DEFINE_ENUM(BH_Unwritten); +TRACE_DEFINE_ENUM(BH_Boundary); + #define show_mflags(flags) __print_flags(flags, "", \ { EXT4_MAP_NEW, "N" }, \ { EXT4_MAP_MAPPED, "M" }, \ @@ -62,11 +72,18 @@ struct partial_cluster; { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\ { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" }) +TRACE_DEFINE_ENUM(ES_WRITTEN_B); +TRACE_DEFINE_ENUM(ES_UNWRITTEN_B); +TRACE_DEFINE_ENUM(ES_DELAYED_B); +TRACE_DEFINE_ENUM(ES_HOLE_B); +TRACE_DEFINE_ENUM(ES_REFERENCED_B); + #define show_extent_status(status) __print_flags(status, "", \ { EXTENT_STATUS_WRITTEN, "W" }, \ { EXTENT_STATUS_UNWRITTEN, "U" }, \ { EXTENT_STATUS_DELAYED, "D" }, \ - { EXTENT_STATUS_HOLE, "H" }) + { EXTENT_STATUS_HOLE, "H" }, \ + { EXTENT_STATUS_REFERENCED, "R" }) #define show_falloc_mode(mode) __print_flags(mode, "|", \ { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \ -- 2.7.4