From nobody Tue Feb 10 21:38:31 2026 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (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 9FA1418AED; Tue, 23 Apr 2024 01:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713837224; cv=none; b=uiNAlQWq4job+RXFIFr87r9JouSXGOXVIIUj5kd6FCb5QMDnwOOslAyqe6G2ZHjHg0p7ux0wdfyTj/v2+Mwxt0vGwe02wlPO79XW+RXGP4vCQoLL6lbRNWBVS1Z9bgvTCE4JMm3yKmU9O6h8BxZnA0AWjz+oUpp1if1/xhgPtdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713837224; c=relaxed/simple; bh=ZfEsMl1qaCfp5Oza49PubsjnVa19yJNc6RtRjNl/eTM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iJl0wC3XvwYwbsydAVKQ6JpVZtLDavoCa2DywoB2PCWd2p5KOleCc5s53wN+SlLpuGkYB3aZncsJOpay6MQJGCpPK0VJ9wfX5maKY8S+SSgK3EG1D4FJbH6wCAnXKa/3mDGee4vYN8ABUWjKdZoV2N3Jru+Snb6WXZ4mYElaqik= 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.189 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 szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VNlT907c8zNtRB; Tue, 23 Apr 2024 09:51:09 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id E076318007F; Tue, 23 Apr 2024 09:53:38 +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; Tue, 23 Apr 2024 09:53:37 +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 v2 1/2] perf trace beauty: Always show param if show_zero is set Date: Tue, 23 Apr 2024 09:53:29 +0800 Message-ID: <20240423015330.2206892-2-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423015330.2206892-1-changbin.du@huawei.com> References: <20240423015330.2206892-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" For some parameters, it is best to also display them when they are 0, e.g. flags. Signed-off-by: Changbin Du --- tools/perf/builtin-trace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index e5fef39c34bf..a8407eee58a3 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2099,9 +2099,9 @@ static size_t syscall__scnprintf_args(struct syscall = *sc, char *bf, size_t size, !trace->show_zeros && !(sc->arg_fmt && (sc->arg_fmt[arg.idx].show_zero || - sc->arg_fmt[arg.idx].scnprintf =3D=3D SCA_STRARRAY || - sc->arg_fmt[arg.idx].scnprintf =3D=3D SCA_STRARRAYS) && - sc->arg_fmt[arg.idx].parm)) + ((sc->arg_fmt[arg.idx].scnprintf =3D=3D SCA_STRARRAY || + sc->arg_fmt[arg.idx].scnprintf =3D=3D SCA_STRARRAYS) && + sc->arg_fmt[arg.idx].parm)))) continue; =20 printed +=3D scnprintf(bf + printed, size - printed, "%s", printed ? ",= " : ""); @@ -2803,8 +2803,8 @@ static size_t trace__fprintf_tp_fields(struct trace *= trace, struct evsel *evsel, */ if (val =3D=3D 0 && !trace->show_zeros && - !((arg->show_zero || - arg->scnprintf =3D=3D SCA_STRARRAY || + !arg->show_zero && + !((arg->scnprintf =3D=3D SCA_STRARRAY || arg->scnprintf =3D=3D SCA_STRARRAYS) && arg->parm)) continue; --=20 2.34.1 From nobody Tue Feb 10 21:38:31 2026 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (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 E292F1947D; Tue, 23 Apr 2024 01:53:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713837230; cv=none; b=X4/iB4y45/HzU/NeG4qvkLnKyt+47GO9PH8Jc37WTE9j0klQbGh/Eq3D3epY2vTu6xjkXLYKfKafdK/2NaWBQxF6OFLzMyn0d9GjFMx1U0TAO3nJBHD8DCxJKVtzS3kXN4MC6EnHuig9C9HJAAWTczknFtXC4yDJnWwZS0LadKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713837230; c=relaxed/simple; bh=686Nk4Ui0iCP2dvu4CE6nvTnMNWhH+HUW0Ag95Z7vHo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AcMrJwPz6xbMY/KongcTdHchthN3kl7lHbr+/wKJ4A/OQA2sPML4fl1wZDTfTHo3G21zUW78IlhqIOzfxVS8eyIqHDF3k7aXp0rbbTc9koC58mSYc+7j1I+fnXbq8bFcZ+kv/pcUa8//Ne8C4O0QYmsVcB286EX8T4LyaPKWLuo= 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.190 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.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4VNlTB3WCYz1ypGN; Tue, 23 Apr 2024 09:51:10 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id ED9031A0188; Tue, 23 Apr 2024 09:53:39 +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; Tue, 23 Apr 2024 09:53:38 +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 v2 2/2] perf trace beauty: Always show mmap prot even though PROT_NONE Date: Tue, 23 Apr 2024 09:53:30 +0800 Message-ID: <20240423015330.2206892-3-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423015330.2206892-1-changbin.du@huawei.com> References: <20240423015330.2206892-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. 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 a8407eee58a3..e82ed002890f 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