From nobody Fri Dec 19 12:14:50 2025 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: quoted-printable X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemd100011.china.huawei.com (7.221.188.204) Content-Type: text/plain; charset="utf-8" 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=3D=3D0 -- 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=3D=3D0 -- ls 0.000 ls/2975708 syscalls:sys_enter_mmap(len: 4220888, prot: NONE, fla= gs: 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[] =3D { #if defined(__s390x__) .alias =3D "old_mmap", #endif - .arg =3D { [2] =3D { .scnprintf =3D SCA_MMAP_PROT, /* prot */ }, + .arg =3D { [2] =3D { .scnprintf =3D SCA_MMAP_PROT, .show_zero =3D true,= /* prot */ }, [3] =3D { .scnprintf =3D SCA_MMAP_FLAGS, /* flags */ .strtoul =3D STUL_STRARRAY_FLAGS, .parm =3D &strarray__mmap_flags, }, @@ -1050,7 +1050,7 @@ static const struct syscall_fmt syscall_fmts[] =3D { [4] =3D { .scnprintf =3D SCA_MOVE_MOUNT_FLAGS, /* flags */ }, }, }, { .name =3D "mprotect", .arg =3D { [0] =3D { .scnprintf =3D SCA_HEX, /* start */ }, - [2] =3D { .scnprintf =3D SCA_MMAP_PROT, /* prot */ }, }, }, + [2] =3D { .scnprintf =3D SCA_MMAP_PROT, .show_zero =3D true, /* prot = */ }, }, }, { .name =3D "mq_unlink", .arg =3D { [0] =3D { .scnprintf =3D SCA_FILENAME, /* u_name */ }, }, }, { .name =3D "mremap", .hexret =3D true, @@ -1084,7 +1084,7 @@ static const struct syscall_fmt syscall_fmts[] =3D { .arg =3D { [0] =3D { .scnprintf =3D SCA_INT, /* key */ }, }, }, { .name =3D "pkey_mprotect", .arg =3D { [0] =3D { .scnprintf =3D SCA_HEX, /* start */ }, - [2] =3D { .scnprintf =3D SCA_MMAP_PROT, /* prot */ }, + [2] =3D { .scnprintf =3D SCA_MMAP_PROT, .show_zero =3D true, /* prot = */ }, [3] =3D { .scnprintf =3D SCA_INT, /* pkey */ }, }, }, { .name =3D "poll", .timeout =3D true, }, { .name =3D "ppoll", .timeout =3D true, }, --=20 2.34.1