Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2661022lqt; Mon, 22 Apr 2024 18:54:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUCaKM1XPZNhlo4j3PZfMJ1L+HLBoLgXIBMmdvEaUq0kJYqRNiyLe333NRLIZR1GX8/TYrvRNJk7Qw76TROAVfPHwLOldpLhg4kw0ZPzw== X-Google-Smtp-Source: AGHT+IGrvQjB/P9cgY+i1v4Ssl9m3yK8Xs+bEFucJG2Xsqs08VDbwTx6fkxf5jf9QkyE/AQ6mEmd X-Received: by 2002:a17:90a:d50f:b0:2a6:c503:95f2 with SMTP id t15-20020a17090ad50f00b002a6c50395f2mr8857340pju.16.1713837264001; Mon, 22 Apr 2024 18:54:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713837263; cv=pass; d=google.com; s=arc-20160816; b=hQOTAxiwc4xg/VpN9iaqVyG34/iWPTVHF8Bd9ai7BddfEbvgSoI6FSIXkntrYDGQ9w 9Qe580Gq09qguRc5q73eATL5/F8mR93BXNYNK5fXhM4vVriBmQm5RG+Kdtt2iJ5C8iEw ctWr8OUjPdC6puAw6kpAUEF7Kk+IBBXXX7EgpO+2q/6FhFE+YtCCF8OQHL/btU+Auwrw /7AUThKVJafdKtYwQxpQiHufwxa4SHkQDoGzFGhDzJ+7yCabcTBEUFgonq6qzfxuJkpH xJTxNceGxWjEzMd8NXU5QBtXLyVPvcjvQen+crJmwSU3LbpVIsEmLh89Co3XgKtoFh8E zPuw== 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=Ib2H8OHHzgvQUm0Hls9zPq8P4T9J8/wlpI+QcKpQzKo=; fh=qYBgL0xDXiZbrLeipx8X/fz2jSxMbqgYzzneIVPF86s=; b=qOZLrl3EkOzPl+jCJ+EIf32YgyIEOcClF5i44IYNz1vR4QCWePt87WVOvPJMy7JNv3 R0aTbQj9E+drmY7SJ9Yx1sN1GcnxGyfNV84fmFwwEiv+E/R3PeW/jTodvmWoz0D0CmRe Kl5wn/wBtNajSyMmhgWJLJJR+SeawJzLQE1OR5EgLsjxPu/D9TJ8qs/5L3s3VPfOeepp T/ekohE7m8wGiMpun6supqQ4THVfrwOWgZENdw5FopHy/9qp+iee+cmcrcZoLac1u57S yrv2UnXtJgWiIFM8eo3hdZrXnDSyYED2NGSBgx5Sht7vZibKZUlm0Acvg2BVkrIsd4yi vNAA==; 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-154407-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154407-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 v15-20020a17090a6b0f00b002a21269c4fdsi10551146pjj.119.2024.04.22.18.54.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 18:54:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154407-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-154407-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154407-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 1E41DB22C31 for ; Tue, 23 Apr 2024 01:54:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A577B17BB7; Tue, 23 Apr 2024 01:53:44 +0000 (UTC) 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: 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) 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 == SCA_STRARRAY || - sc->arg_fmt[arg.idx].scnprintf == SCA_STRARRAYS) && - sc->arg_fmt[arg.idx].parm)) + ((sc->arg_fmt[arg.idx].scnprintf == SCA_STRARRAY || + sc->arg_fmt[arg.idx].scnprintf == SCA_STRARRAYS) && + sc->arg_fmt[arg.idx].parm)))) continue; printed += 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 == 0 && !trace->show_zeros && - !((arg->show_zero || - arg->scnprintf == SCA_STRARRAY || + !arg->show_zero && + !((arg->scnprintf == SCA_STRARRAY || arg->scnprintf == SCA_STRARRAYS) && arg->parm)) continue; -- 2.34.1