From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752098AbcEGEzK (ORCPT ); Sat, 7 May 2016 00:55:10 -0400 Received: from terminus.zytor.com ([198.137.202.10]:42256 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbcEGEzI (ORCPT ); Sat, 7 May 2016 00:55:08 -0400 Date: Fri, 6 May 2016 21:54:38 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: milian.wolff@kdab.com, namhyung@kernel.org, mingo@kernel.org, hpa@zytor.com, dsahern@gmail.com, adrian.hunter@intel.com, tglx@linutronix.de, acme@redhat.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, wangnan0@huawei.com Reply-To: milian.wolff@kdab.com, mingo@kernel.org, namhyung@kernel.org, tglx@linutronix.de, adrian.hunter@intel.com, hpa@zytor.com, dsahern@gmail.com, wangnan0@huawei.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, acme@redhat.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf trace: Do not print raw args list for syscalls with no args Git-Commit-ID: 4c4d6e519091a3551a0ad2e2e8423d77f3000400 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4c4d6e519091a3551a0ad2e2e8423d77f3000400 Gitweb: http://git.kernel.org/tip/4c4d6e519091a3551a0ad2e2e8423d77f3000400 Author: Arnaldo Carvalho de Melo AuthorDate: Thu, 5 May 2016 23:38:05 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 6 May 2016 08:44:30 -0300 perf trace: Do not print raw args list for syscalls with no args The test to check if the arg format had been read from the syscall:sys_enter_name/format file was looking at the list of non-commom fields, and if that is empty, it would think it had failed to read it, because it doesn't exist, for instance, for the clone() syscall. So instead before dumping the raw syscall args list check IS_ERR(sc->tp_format), if that is true, then an attempt was made to read the format file and failed, in which case dump the raw arg list values. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Milian Wolff Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-ls7pmdqb2xy9339vdburwvnk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 66aa2a0..9d23edc 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1606,7 +1606,12 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size, "%ld", val); } } - } else { + } else if (IS_ERR(sc->tp_format)) { + /* + * If we managed to read the tracepoint /format file, then we + * may end up not having any args, like with gettid(), so only + * print the raw args when we didn't manage to read it. + */ int i = 0; while (i < 6) {