Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2834185ybc; Wed, 13 Nov 2019 23:05:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwXtNYC0NcJN+OsGQjhcuruc3lscNKbSAl3Aczl+T5TGcmQQ/CaDBUrCZv6D3S/VHRg+ZDl X-Received: by 2002:a50:9fcb:: with SMTP id c69mr8256135edf.163.1573715108184; Wed, 13 Nov 2019 23:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573715108; cv=none; d=google.com; s=arc-20160816; b=q8F1dEvqmDlGjEtEuF/fjOSjCSx9CawEmHjrTKDEO5FSOpPWQPGvIe/Of99eGqNn/w t5MbR17ozkRsWLwdBMo8G/kPgbzAvf+Ki89r4m+nTtFXOeYn2TDYb6blqP2oFr9zOrmG JPVd9B+BYPRFlp8Tr7qhGx7mSHtl3Dwv8nVGabKYeFR1SzXmPY36tIGImAp7tArcgqjq FvdgRCMHhXmDwFbV7Awb66fh8GFXJu+9njCLshW9bW1ruuxcjsyTivZuXYN4PUQKgVSh oPyT9qeqoLVQnao+Q8WvnB5D8YfYKJyToY15zAZJpxM9h+0TZn9EbhDrEsSpIHHokuVG VeFg== 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=svihJ3/3cnY/1btnNipQz/Ijg4CCt1aoyogk0lSbG3o=; b=a3RBReL4xbmvSlKezZ+7lO0Tf3BlPQ0bbA1p6pyfFd+xCLH+5a8aLsAACQy9JgOn4/ nktJXFknCQQjsBifWujarxRbidKY8Si49F4yXTHe/T0iLJ1IjImN7tvyqUKyxNxFNv5t B7Dp8feRD7BUBex1r1pkMDdP2TudGiI2LoO/FC/QhYl70ZJ9kyVh5fjHR1bg2BYK1P53 LPew+EOUmsyKJLAU8JOiFRXw9pMNVozE8qHOQpg2MdhODo9I7QQdotQgT+ThfutayCyk V2eecX/OGla5tcXECySXnshfxiEq1Fxlcr0VDwGHIe/StxwLVQTgZHDtAeiDbqC0M2UG 2Z6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=lOgGxknp; 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 w42si3491029edc.440.2019.11.13.23.04.35; Wed, 13 Nov 2019 23:05:08 -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=lOgGxknp; 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 S1726655AbfKNHDl (ORCPT + 99 others); Thu, 14 Nov 2019 02:03:41 -0500 Received: from forwardcorp1j.mail.yandex.net ([5.45.199.163]:34398 "EHLO forwardcorp1j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725914AbfKNHDl (ORCPT ); Thu, 14 Nov 2019 02:03:41 -0500 Received: from mxbackcorp2j.mail.yandex.net (mxbackcorp2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::119]) by forwardcorp1j.mail.yandex.net (Yandex) with ESMTP id 2790C2E0B08; Thu, 14 Nov 2019 10:03:38 +0300 (MSK) Received: from vla1-5826f599457c.qloud-c.yandex.net (vla1-5826f599457c.qloud-c.yandex.net [2a02:6b8:c0d:35a1:0:640:5826:f599]) by mxbackcorp2j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id eGSxQyNzyJ-3bteExrw; Thu, 14 Nov 2019 10:03:38 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1573715018; bh=svihJ3/3cnY/1btnNipQz/Ijg4CCt1aoyogk0lSbG3o=; h=Message-Id:Date:Subject:To:From:Cc; b=lOgGxknpwF/oL41IeWr1HVWAfe00UMXfNRLYnRWx0BeZC4vX0D5QZo+8xWVLOGqPx neyzHAq5U8ORFZDTCbrcuIkNRXU1yy2I+IIsOCZHe6E7lbVCNvMd+Y/1gTnQ+wNddF Ld5pXoszSZ4EpoHsKzhAcdMXJcPbP6dg/q4zJ9cE= Authentication-Results: mxbackcorp2j.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 vla1-5826f599457c.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 1C2DjkEI6P-3bVOWrMS; Thu, 14 Nov 2019 10:03:37 +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: tytso@mit.edu, Dmitry Monakhov Subject: [PATCH 0/2] ext4: Workaround trace event flag decoding issues Date: Thu, 14 Nov 2019 07:03:28 +0000 Message-Id: <20191114070330.14115-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. For example trace_ext4_map_blocks_exit() has two __print_flags tables, one for EXT4_GET_BLOCKS_XX, and second for EXT4_MAP_XXX cat /sys/kernel/debug/tracing/events/ext4/ext4_ext_map_blocks_exit/format .. print fmt: "dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u mflags %s ret %d", .... __print_flags(REC->flags, "|", { 0x0001, "CREATE" }, { 0x0002, "UNWRIT" },... __print_flags(REC->mflags, "", { (1 << BH_New), "N" }, { (1 << BH_Mapped), "M" }.. First macro expanded w/o issued because EXT4_GET_BLOCKS_XXX flags are explicit numbers, but second macro stil contains text fields because it depends on implicit enum values. It is important to note that this is exact representation of event's binary format. This means that perf-script can not decode bintrace file because BH_XXX is just a text token which is unknown to userspace. As result perf fail to decode it and fallback to dump it as raw hex number. For example: ext4:ext4_ext_map_blocks_exit: dev 253,0 ino 12 flags CREATE lblk 0 pblk 34304 len 1 mflags 0x60 ret 1 I tend to agree that this is likely to be trace API issue, but it looks like that EXT4 is the only subsystem which is affected. Others already workaround this by using explicit numbers. Let's do the same trick. TOC: ext4: Use raw numbers for EXT4_MAP_XXX flags ext4: Fix extent_status trace events