From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934542AbcI2SLx (ORCPT ); Thu, 29 Sep 2016 14:11:53 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51680 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934432AbcI2SLp (ORCPT ); Thu, 29 Sep 2016 14:11:45 -0400 Date: Thu, 29 Sep 2016 11:11:32 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, dsahern@gmail.com, williams@redhat.com, mingo@kernel.org, adrian.hunter@intel.com, bristot@redhat.com, jolsa@kernel.org, wangnan0@huawei.com, rostedt@goodmis.org, namhyung@kernel.org, acme@redhat.com Reply-To: jolsa@kernel.org, wangnan0@huawei.com, rostedt@goodmis.org, namhyung@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, dsahern@gmail.com, williams@redhat.com, mingo@kernel.org, adrian.hunter@intel.com, bristot@redhat.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf trace: Beautify sched_[gs]et_attr return value Git-Commit-ID: f0bbd602268e69f4f428075c645391d64bdd6c9f 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: f0bbd602268e69f4f428075c645391d64bdd6c9f Gitweb: http://git.kernel.org/tip/f0bbd602268e69f4f428075c645391d64bdd6c9f Author: Arnaldo Carvalho de Melo AuthorDate: Wed, 28 Sep 2016 13:45:38 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 28 Sep 2016 13:48:04 -0300 perf trace: Beautify sched_[gs]et_attr return value Both return errno, show the string associated then. More work needed to capture the sched_attr arg to beautify it in turn, probably using BPF. Before: 0.210 ( 0.001 ms): sched_setattr(uattr: 0x7ffc684f02b0) = -22 After the patch, for this sched_attr, all other parms are zero, so not shown: struct sched_attr attr = { .size = sizeof(attr), .sched_policy = SCHED_DEADLINE, .sched_runtime = 10 * USECS_PER_SEC, .sched_period = 30 * USECS_PER_SEC, .sched_deadline = attr.sched_period, }; 0.321 ( 0.002 ms): sched_setattr(uattr: 0x7ffc44116da0) = -1 EINVAL Invalid argument [root@jouet c]# perf trace -e sched_setattr ./sched_deadline Couldn't negotiate deadline: Invalid argument 0.229 ( 0.003 ms): sched_setattr(uattr: 0x7ffd8dcd8df0) = -1 EINVAL Invalid argument [root@jouet c]# Now to figure out the reason for this EINVAL. Cc: Adrian Hunter Cc: Clark Williams Cc: Daniel Bristot de Oliveira Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Steven Rostedt Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-tyot2n7e48zm8pdw8tbcm3sl@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index b4fc1ab..1a54ce9 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -742,6 +742,8 @@ static struct syscall_fmt { .arg_scnprintf = { [1] = SCA_SIGNUM, /* sig */ }, }, { .name = "rt_tgsigqueueinfo", .errmsg = true, .arg_scnprintf = { [2] = SCA_SIGNUM, /* sig */ }, }, + { .name = "sched_getattr", .errmsg = true, }, + { .name = "sched_setattr", .errmsg = true, }, { .name = "sched_setscheduler", .errmsg = true, .arg_scnprintf = { [1] = SCA_SCHED_POLICY, /* policy */ }, }, { .name = "seccomp", .errmsg = true,