Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp654145lqa; Sat, 27 Apr 2024 20:11:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtzKBPnn7mdaKdJXnR3U0zfK0GW8UEfWNbKBlnxA94pD48OQdS8Wodp/otZ6DyQ+bNQo63uDiD8zVRXbYsrdLQNZgyR6/Up8wPVca8AQ== X-Google-Smtp-Source: AGHT+IFW1B6aDYRlW+70QX3Km0wMCeloVyK3pi8E4u7RxiUsX4CrSWj6hWgzHVmdCfb/nUG/sbnR X-Received: by 2002:a05:6870:e3c9:b0:22e:b2da:af39 with SMTP id y9-20020a056870e3c900b0022eb2daaf39mr7325516oad.47.1714273863072; Sat, 27 Apr 2024 20:11:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714273863; cv=pass; d=google.com; s=arc-20160816; b=0CggZRGZawU9L0BeRJ8V0XKCbgJvx0CmiowI+lwPzoj+i5YWwLEMDQa2swYP4huXPm x2E+/qVmdD9maYHWY1wNV4tuMYIRyyQwjKuDCf7K7EbK0T+HCBR4C9Kjb0QEYGVeU0hu 6dCXPJeko5G2fdGf8TTS5+4t8Xn9JfTjh86WnPzENddcr6iaI9D6/OqC1jOQELmR6Trk pdTMzWPQG/C3wT6+e7KjgGU+JkyNIiZldmqPcGVTUGGvx0rxNaUtLqHbK2FHLqkWahTP NVZkAgNyglktfsheabfq6o2JSpEjKlSiFPS8RKnYo5VQ91rPkgj+7C6D3DxV9l1Hg4QJ 7EMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=UukY9nQc3qw4BKefURT/tEgmLwFdqacUKxPmWazx+2Y=; fh=qYBgL0xDXiZbrLeipx8X/fz2jSxMbqgYzzneIVPF86s=; b=dn+z98TTgz/Kh0fO1X50gBZThFFWXTUcGyRaMsrGrfv+v8K9CQrXoDM7XZ5UMtKcQS fhNYdHs3TiZcbg/B10IjSMGXL8DkOhcKCvjQG60I3tCKgnECbCpEUv9iySMia6NryUzh QzveTYIl2+hqkH0MwMtWDD22wR0Tck+EBHm8Aq68YWyGTcd/zROAh5sibxl0O13oF255 zLJ60YytAJ+SH3oJD2ShNQl7h9A/b9xctqEexid0nzzSUOzWP3yN9kNTCkSBHDoiMEmT XNN2EIGrJQ9TJ7mHq9z8I3jUC4NoI9/b2QXkPso1yQcWk1Xcpoja9Q3Kd5SeqXG2Xb/e J3AQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-161237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e16-20020a62aa10000000b006ecef1eec86si17121151pff.239.2024.04.27.20.11.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 20:11:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-161237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A94FEB20E1A for ; Sun, 28 Apr 2024 03:10:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80BBF8C1E; Sun, 28 Apr 2024 03:10:30 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F11438BFC; Sun, 28 Apr 2024 03:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714273830; cv=none; b=Y5tfveqi/j91mybssbhMjomC7DHeZyaKWyP5bJ6aD0MNW8CJ3meUyqumix32NwAFu2c91TofWM0pkrmFDJjHCjUbDRXrVmVTy+H7BnjlAoQxSCjGC3KIWTYO9KGsUsM8ao0VrkjltEGPcLGXBXgTdkZifGUpg8RnIchbTxCUkaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714273830; c=relaxed/simple; bh=Xkb858840JSpgt73J/+K8NkWTXhVSsceTUY+W6NiCQk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XbMUhPJprTxSog3bukld70zeAj6ShYnVW+aO+6Syo1hqgQmNd7W6mrhkW2enA9x3MeQq7xRb+PkwO6numLz6X4+4rGWyOwAh0Dwj28aEZJOPHLLYgICnXGFuUu+rivfjcwor8hbSf6ELk0hQK2kU1pNDWQipztfuZg5Hb0/dWuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VRryx2PCtzccF1; Sun, 28 Apr 2024 11:09:13 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id 9D0FB180080; Sun, 28 Apr 2024 11:10:19 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemd100011.china.huawei.com (7.221.188.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Sun, 28 Apr 2024 11:10:18 +0800 From: Changbin Du To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim CC: Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , , , Changbin Du Subject: [PATCH v3 2/2] perf trace beauty: Always show mmap prot even though PROT_NONE Date: Sun, 28 Apr 2024 11:10:08 +0800 Message-ID: <20240428031008.1535765-3-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240428031008.1535765-1-changbin.du@huawei.com> References: <20240428031008.1535765-1-changbin.du@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemd100011.china.huawei.com (7.221.188.204) PROT_NONE is also useful information, so do not omit the mmap prot even though it is 0. syscall_arg__scnprintf_mmap_prot() could print PROT_NONE for prot 0. Before: PROT_NONE is not shown. $ sudo perf trace -e syscalls:sys_enter_mmap --filter prot==0 -- ls 0.000 ls/2979231 syscalls:sys_enter_mmap(len: 4220888, flags: PRIVATE|ANONYMOUS) After: PROT_NONE is displayed. $ sudo perf trace -e syscalls:sys_enter_mmap --filter prot==0 -- ls 0.000 ls/2975708 syscalls:sys_enter_mmap(len: 4220888, prot: NONE, flags: PRIVATE|ANONYMOUS) Signed-off-by: Changbin Du --- tools/perf/builtin-trace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 915dcd258002..919a462a7cb5 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1033,7 +1033,7 @@ static const struct syscall_fmt syscall_fmts[] = { #if defined(__s390x__) .alias = "old_mmap", #endif - .arg = { [2] = { .scnprintf = SCA_MMAP_PROT, /* prot */ }, + .arg = { [2] = { .scnprintf = SCA_MMAP_PROT, .show_zero = true, /* prot */ }, [3] = { .scnprintf = SCA_MMAP_FLAGS, /* flags */ .strtoul = STUL_STRARRAY_FLAGS, .parm = &strarray__mmap_flags, }, @@ -1050,7 +1050,7 @@ static const struct syscall_fmt syscall_fmts[] = { [4] = { .scnprintf = SCA_MOVE_MOUNT_FLAGS, /* flags */ }, }, }, { .name = "mprotect", .arg = { [0] = { .scnprintf = SCA_HEX, /* start */ }, - [2] = { .scnprintf = SCA_MMAP_PROT, /* prot */ }, }, }, + [2] = { .scnprintf = SCA_MMAP_PROT, .show_zero = true, /* prot */ }, }, }, { .name = "mq_unlink", .arg = { [0] = { .scnprintf = SCA_FILENAME, /* u_name */ }, }, }, { .name = "mremap", .hexret = true, @@ -1084,7 +1084,7 @@ static const struct syscall_fmt syscall_fmts[] = { .arg = { [0] = { .scnprintf = SCA_INT, /* key */ }, }, }, { .name = "pkey_mprotect", .arg = { [0] = { .scnprintf = SCA_HEX, /* start */ }, - [2] = { .scnprintf = SCA_MMAP_PROT, /* prot */ }, + [2] = { .scnprintf = SCA_MMAP_PROT, .show_zero = true, /* prot */ }, [3] = { .scnprintf = SCA_INT, /* pkey */ }, }, }, { .name = "poll", .timeout = true, }, { .name = "ppoll", .timeout = true, }, -- 2.34.1