Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp99135lqp; Tue, 21 May 2024 20:36:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVs7s+CZNCM6WjIGdFcjvo7madexIzQrVvbvCxPRpkr1nP90HYz6+tvp9q5Z26TX+ui6FZ3Pl3mYCLIkwj07RkFPHXvapAwni4nMwQdXQ== X-Google-Smtp-Source: AGHT+IFDB/bj5KRGk4A9feVvGk46HcKorpk8IbaRLmXtOg039qPFd9FTIeFWdLF2xjOahQ1RVsaF X-Received: by 2002:a05:6a20:6a10:b0:1b1:f7a1:dfa6 with SMTP id adf61e73a8af0-1b1f8ac718amr1024262637.38.1716349003509; Tue, 21 May 2024 20:36:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716349003; cv=pass; d=google.com; s=arc-20160816; b=rIgQnzsOSUaEALaRrQv/TQcg62gw9SkBsSuJKxWsgl+At/ogGET2jtyo8eAxUe0lUX TtqsjiCxjHzQydqpw93omSkzn73ei7j9zNDJciR1h/i27I34E9U/VXypphVZyESk1xWK w9mIRCsL9Ru90wVVzjosBoY1um+3JzMGqE8ujA35Fp4MxytoI3CH4TJ5cLC9Z9VD1XXJ ZuTZjZk7LWXeuhJSymzB8nc2f4Y8ohmE0vwI0ZO4S9qRZa9qfHNe29yTlPQpd7FH+Hmq fkyjrJneTbLvj8j54MPUtOCnp89kZ6te6OMo5z0tIzfekN79UeI0Dln8VkqqpjUpjeXm iHPQ== 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=+Q16ErutRxHQQEHjuoEGl8aqpab1vAWpslQ7l/d2MLQ=; fh=XwBvdQQTkYoNB7v5rOVvEg+j2lphfRJuZlgC8Q0lImg=; b=LMJC76y+kZ9wg8A8AW44AZxIC1tOOKxpuHvi7sNqdh06DtFMs3GJtY802PbbfEaurg qDtg/PzcwwggC2BJdlNAbLHOdNzfZjoPiDiERlt8U/5cp5uayGSEYJYKaLvo108e7Spo qMzi3d7XLnMknaym4AEMrYV/rqVi82vxU7bUlng2adXE6W3iDoq7kfd4peoUuKIdH0mE 7fON7S3WAfUqGrMzrV5ewo1tcZSzoC5t4m6jmjgqzV7bn2oLPK5dtF5YHdgGONxbMSkZ YZGfMBYtR1FpugHmCsrrx+cbKkwdl8lyn1+O+t5rAbSc9aKFslsWrNZWX7ACAaoOIDPu JgSQ==; 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-185726-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185726-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bad798asi24444095ad.138.2024.05.21.20.36.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 20:36:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185726-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-185726-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185726-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6CAD02838A9 for ; Wed, 22 May 2024 03:36:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFADA7581F; Wed, 22 May 2024 03:36:05 +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 2B5765B1E8; Wed, 22 May 2024 03:36:02 +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=1716348965; cv=none; b=DbhaQJG7nHFQBUKUnDDUCFlS6r/trevkaATH7z7NeNPT4fwQP+9DYCBu8Fy3ho3iHv3TpwmnvGTL903yYMaUKyHzvYsoGLTeSSvh3XgbhRl3+GE6EC1dmwD/Cg0ryK9c79VpB6E0prX6hV9Wj+N28gqXcxapNoRo7uj/4CNWN0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716348965; c=relaxed/simple; bh=zRjS4HniSyauajIjylYLbXjWxv2s24OoOrQ1SnYwpBE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ggu4YtWpU88/oYD9F2M8lMM8C2YNSvHieSS7G4540qlFNKJ36t02CzOWMHWDXMYEJ5LkgzHDlk/tCUn8Bo2bhjo12jHBa2iahSCSuhujJB3rgh+WIiMQpYxmRAI58DFpW6cFa/9FICATn+b9cB6ob8t1xVPyw25ddtncf9uJ8Pw= 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 4VkcKx2d1BzXnRy; Wed, 22 May 2024 11:31:49 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id D2ACB1800CB; Wed, 22 May 2024 11:36:00 +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.34; Wed, 22 May 2024 11:35:59 +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 , "Liang, Kan" , , , Changbin Du Subject: [RESEND PATCH v3 1/2] perf trace beauty: Always show param if show_zero is set Date: Wed, 22 May 2024 11:35:41 +0800 Message-ID: <20240522033542.1359421-2-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240522033542.1359421-1-changbin.du@huawei.com> References: <20240522033542.1359421-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: dggems704-chm.china.huawei.com (10.3.19.181) 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. Here we only check the show_zero property and let arg printer handle special cases. Signed-off-by: Changbin Du --- tools/perf/builtin-trace.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index e5fef39c34bf..915dcd258002 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2091,17 +2091,11 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size, val = syscall_arg_fmt__mask_val(&sc->arg_fmt[arg.idx], &arg, val); /* - * Suppress this argument if its value is zero and - * and we don't have a string associated in an - * strarray for it. - */ - if (val == 0 && - !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)) + * Suppress this argument if its value is zero and show_zero + * property isn't set. + */ + if (val == 0 && !trace->show_zeros && + !(sc->arg_fmt && sc->arg_fmt[arg.idx].show_zero)) continue; printed += scnprintf(bf + printed, size - printed, "%s", printed ? ", " : ""); @@ -2796,17 +2790,8 @@ static size_t trace__fprintf_tp_fields(struct trace *trace, struct evsel *evsel, */ val = syscall_arg_fmt__mask_val(arg, &syscall_arg, val); - /* - * Suppress this argument if its value is zero and - * we don't have a string associated in an - * strarray for it. - */ - if (val == 0 && - !trace->show_zeros && - !((arg->show_zero || - arg->scnprintf == SCA_STRARRAY || - arg->scnprintf == SCA_STRARRAYS) && - arg->parm)) + /* Suppress this argument if its value is zero and show_zero property isn't set. */ + if (val == 0 && !trace->show_zeros && !arg->show_zero) continue; printed += scnprintf(bf + printed, size - printed, "%s", printed ? ", " : ""); -- 2.34.1