From nobody Tue May 21 18:36:36 2024 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 C9D2615FA9F; Thu, 18 Apr 2024 13:29:00 +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=1713446943; cv=none; b=f46uYa+B2xQAOIYIko6xk8l5lizhpmDVKfZEcIJxkgSydx9vkKYEfcsY1FEvlXRTSs+Fx6QsL83ZEN11PrcafHhdWFT5kI2e4YvHV0JgSYo/WCBslvFywk1arVjK8OnDxzUf923n+lqsc5ssRe4j6h8O//K/UznLxPAJ3hg1wvM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713446943; c=relaxed/simple; bh=C3BIxOYSx6Edn78b6t4WlyI2Ut5N1AqMlgcYCcsxom4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OPB97QaFehb3Mpa25yRana94Fp4zjXPxcz2eaZsBAnL067+us8tnkH2RGXcViPif4NYeKRkXRk/sDJjJz6EDtPtsAyMjM+/NQSHxNNqZY4SqR2OOf2sAhOqdz9bL5r5OEznmPCuTl5VOuy5Wlye0e6tqjQjMFE8i5g7tAQYb08Q= 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.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VKyqK5btzzJsf9; Thu, 18 Apr 2024 21:12:13 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id A23681800C3; Thu, 18 Apr 2024 21:13:15 +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; Thu, 18 Apr 2024 21:13:14 +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 1/4] perf trace beauty: Fix statx flags printing Date: Thu, 18 Apr 2024 21:13:01 +0800 Message-ID: <20240418131304.3188385-2-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240418131304.3188385-1-changbin.du@huawei.com> References: <20240418131304.3188385-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: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd100011.china.huawei.com (7.221.188.204) Content-Type: text/plain; charset="utf-8" Missed a string specifier '%s' in format string. Signed-off-by: Changbin Du --- tools/perf/trace/beauty/statx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/trace/beauty/statx.c b/tools/perf/trace/beauty/stat= x.c index dc5943a6352d..c61f2be53bda 100644 --- a/tools/perf/trace/beauty/statx.c +++ b/tools/perf/trace/beauty/statx.c @@ -21,7 +21,7 @@ size_t syscall_arg__scnprintf_statx_flags(char *bf, size_= t size, struct syscall_ return scnprintf(bf, size, "%s%s", show_prefix ? "AT_STATX_" : "", "SYNC= _AS_STAT"); #define P_FLAG(n) \ if (flags & AT_##n) { \ - printed +=3D scnprintf(bf + printed, size - printed, "%s%s", printed ? "= |" : "", show_prefix ? prefix : "", #n); \ + printed +=3D scnprintf(bf + printed, size - printed, "%s%s%s", printed ?= "|" : "", show_prefix ? prefix : "", #n); \ flags &=3D ~AT_##n; \ } =20 --=20 2.34.1 From nobody Tue May 21 18:36:36 2024 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 5CDEB2C68C; Thu, 18 Apr 2024 13:13:19 +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=1713446005; cv=none; b=XIiLUDgHLZ6ll11HSWapdY6EgL9hFb+LJ9cpm5b0EQLT5gg0AeKmsk7nRcIAjR/OFF8iDUjJw2LzR1lYfrskWSfk0Sxikam9XpgHIZYLjAwUDriU7S7Y4JNHXLxE8hlxOInYKxM5zzqN+BDP2Lo3p4V12odDFioDAPSeSmBLxcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713446005; c=relaxed/simple; bh=vI/bactSSihewyPgC9byNk05aRJzbjeiW+DD9zyu6y4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jNMzXWUyA0Cg5jZxlmkcq64d0Huog9K3zKFf6S8az71OCY5dve2ZWXjCJvutS9sTgj5SZRyMVc30xBAAXYNxW96guaALX8zJZduSTL7PX33fci5iFgJAIQsLGYhcWArsP4VDnzz1mS/k0psL178RgB0B8CrICf7j2MuVO1Q9AtQ= 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.48]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VKynl6GkxzNsWY; Thu, 18 Apr 2024 21:10:51 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id C1E2518006B; Thu, 18 Apr 2024 21:13:16 +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; Thu, 18 Apr 2024 21:13:15 +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 2/4] perf trace beauty: Beautify newfstatat flags Date: Thu, 18 Apr 2024 21:13:02 +0800 Message-ID: <20240418131304.3188385-3-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240418131304.3188385-1-changbin.du@huawei.com> References: <20240418131304.3188385-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: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd100011.china.huawei.com (7.221.188.204) Content-Type: text/plain; charset="utf-8" Beautify the flags argument of newfstatat() using the same scnprintf of statx(). Signed-off-by: Changbin Du --- tools/perf/builtin-trace.c | 3 ++- tools/perf/trace/beauty/statx.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 90eaff8c0f6e..19e81a467d6a 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1050,7 +1050,8 @@ static const struct syscall_fmt syscall_fmts[] =3D { { .name =3D "name_to_handle_at", .arg =3D { [0] =3D { .scnprintf =3D SCA_FDAT, /* dfd */ }, }, }, { .name =3D "newfstatat", - .arg =3D { [0] =3D { .scnprintf =3D SCA_FDAT, /* dfd */ }, }, }, + .arg =3D { [0] =3D { .scnprintf =3D SCA_FDAT, /* dfd */ }, + [3] =3D { .scnprintf =3D SCA_STATX_FLAGS, /* flags */ }, }, }, { .name =3D "open", .arg =3D { [1] =3D { .scnprintf =3D SCA_OPEN_FLAGS, /* flags */ }, }, }, { .name =3D "open_by_handle_at", diff --git a/tools/perf/trace/beauty/statx.c b/tools/perf/trace/beauty/stat= x.c index c61f2be53bda..dd83a2a95d89 100644 --- a/tools/perf/trace/beauty/statx.c +++ b/tools/perf/trace/beauty/statx.c @@ -30,6 +30,7 @@ size_t syscall_arg__scnprintf_statx_flags(char *bf, size_= t size, struct syscall_ P_FLAG(SYMLINK_FOLLOW); P_FLAG(NO_AUTOMOUNT); P_FLAG(EMPTY_PATH); + P_FLAG(STATX_SYNC_AS_STAT); P_FLAG(STATX_FORCE_SYNC); P_FLAG(STATX_DONT_SYNC); =20 --=20 2.34.1 From nobody Tue May 21 18:36:36 2024 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 4421513C3FF; Thu, 18 Apr 2024 13:13:20 +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=1713446004; cv=none; b=Yatd20flO+134NEr/e9dNhqpB3WPndUL3V4sO9uD4DnJVdmww4e3FMr7JdE+CqA1f70aDcW2O9KIRVMU6d65I98pRkrMhCEyRWUhfInd9GAxnuUrXAsIYJZkflXmPyLKJRIPHM1sFevHkn/7RDGfGM2vHtbdYHoiyACaEM3Ixns= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713446004; c=relaxed/simple; bh=FzJPan2NAFjCC04AmFBOdGDeNlf6oAypFIRmzBRbrQY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tVFBgV+zhA3H8M0oFgzp2LTKNaZDCBd8AYbYd8aa+qE6xQ5UZUGZuX6Tvfz/2ro1eMGJlz476/EeWfbQcNYClMfVHLo8U0OvuRfEtHRHpIqwg0AMHxAJiEGkrLt/dO3k1OYUHJNcB6DzJwN62HDKRnl5wfwD3gFJsJ0DlOR0/NY= 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.174]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VKynm6RhjzNsWj; Thu, 18 Apr 2024 21:10:52 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id D2DF214044F; Thu, 18 Apr 2024 21:13:17 +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; Thu, 18 Apr 2024 21:13:16 +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 3/4] perf trace beauty: Always show param if show_zero is set Date: Thu, 18 Apr 2024 21:13:03 +0800 Message-ID: <20240418131304.3188385-4-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240418131304.3188385-1-changbin.du@huawei.com> References: <20240418131304.3188385-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: dggems704-chm.china.huawei.com (10.3.19.181) 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 19e81a467d6a..349550b02f79 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2086,9 +2086,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 ? ",= " : ""); @@ -2790,8 +2790,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 May 21 18:36:36 2024 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 0727E15D5AE; Thu, 18 Apr 2024 13:29:01 +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=1713446945; cv=none; b=mNgaeMwlBo/fV19B3+9NRU7gX9Vy0ugAVZTYpf4+WZF+wIb3X5zxBPjhFj7iwZMASTAfX0BnHO2b1yxxyE9g7V3lhYL3n6CZHZ4M1yuGmECGCeDqjqgQFkPDfhmaPZYQNoF87uamEyk9fgkGEP4STwNWiH8wXEFoH8VJBOppQ58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713446945; c=relaxed/simple; bh=u9rORQi/V386pgsRzfTDjDY7hWfcKdADQPxluxHnPP8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SKJYi06+kGZWUX/zDb8brx7y6DW11MGB4EUr5cFPjiPhDH5stJ6U/0Y6AyjScYI0BneJDJgJmgPR9xTVDRvqWwwYXRytbnU3iQdEPbMBrnAaTNkqFKnZDWo54ps3IO6xk8OxKEwGkTi5gnUtzKUS1jwcNTYHsSZEm29xbeN/Zck= 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 4VKymk39JvzXljn; Thu, 18 Apr 2024 21:09:58 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id EAB9D18006D; Thu, 18 Apr 2024 21:13:18 +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; Thu, 18 Apr 2024 21:13:17 +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 4/4] perf trace beauty: Always show mprotect prot even though PROT_NONE Date: Thu, 18 Apr 2024 21:13:04 +0800 Message-ID: <20240418131304.3188385-5-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240418131304.3188385-1-changbin.du@huawei.com> References: <20240418131304.3188385-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: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd100011.china.huawei.com (7.221.188.204) Content-Type: text/plain; charset="utf-8" Do not omit the flags even though it is PROT_NONE. Signed-off-by: Changbin Du --- tools/perf/builtin-trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 349550b02f79..7f936f1b5519 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1042,7 +1042,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, --=20 2.34.1