Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp354576img; Thu, 28 Feb 2019 00:08:06 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibe8WvrGCEIDR6yRYidPiDpYiRvpuE0ttsl0sZesJUgYUEouTRq1aYf8AC9tJo9AcJ9jFOD X-Received: by 2002:a63:7403:: with SMTP id p3mr7167311pgc.343.1551341286752; Thu, 28 Feb 2019 00:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551341286; cv=none; d=google.com; s=arc-20160816; b=NDdorHptTy3Q7qhSL+23P4k8D5iTbUa1xx2qVZi6kYVZfbpK1N2N2NPYFskDe5Zmyz c2zneL5jzf5ejmCJtMTXtTESBmxhoAf0RdfrABJTwdPOFCSZlzKgsSzyE0+XK/q9CHXA i0wuwPT8bGJaTpXX40quyJFzmZ8hV3nSr7qXEsKOtFymuCqOYQ277Kg/ndQqRgqqDPKN AS1cOiXf6gOteOMPJ4IinrWwFVmDgtvZqFamur2hvgrjTl+m8R5cxRoTCJebObI+v6m5 BcA3zITHcbOzuuEtPui65mZxZ2H7+YDP9TtW7i0FABZdsDEbnSbH+beJTB2XyMwB95Hm yIaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=VxMCcHg3bfWZAhUuSNt899CMb3ZViaRGCL5pTTma/LE=; b=M+9qexJTT7FVseLpuovZMNX3mKLAHCkQ9XbUOFZzBNG0J6wW5KNIEshofLRqaJ9q+g ll4+/TTDQM5OZE26qeZUI7HSPcNvdPBiKXkGSiZIPj7mOHdPmZnPQ9quz5YVa7/WWlrr MSE+yJwiJflRAOF4cpvBL4rmb803n77oDcqXV9lWa0nPKso9we0/wygruOWiC4jhbkwp pXqVptWL0XvqhbFjhqXO0lCztbP+KzOGtat/FEWePLQOvLWKbqiGO5IPQJkUZeQ5duY4 yoRU7LTF/3w5fJ+SsWSv6Ivu5N51nVwmtFuAfs2IYrc5Bt5YtENOC9GvUWRrflhhfhyy FbHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37si17551181pla.71.2019.02.28.00.07.51; Thu, 28 Feb 2019 00:08:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731748AbfB1Hmy (ORCPT + 99 others); Thu, 28 Feb 2019 02:42:54 -0500 Received: from terminus.zytor.com ([198.137.202.136]:47243 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbfB1Hmx (ORCPT ); Thu, 28 Feb 2019 02:42:53 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x1S7gbmp2948045 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Feb 2019 23:42:37 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x1S7gaEf2948042; Wed, 27 Feb 2019 23:42:36 -0800 Date: Wed, 27 Feb 2019 23:42:36 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Thomas Richter Message-ID: Cc: brueckner@linux.vnet.ibm.com, hpa@zytor.com, heiko.carstens@de.ibm.com, acme@redhat.com, tglx@linutronix.de, schwidefsky@de.ibm.com, linux-kernel@vger.kernel.org, mingo@kernel.org, tmricht@linux.ibm.com Reply-To: linux-kernel@vger.kernel.org, schwidefsky@de.ibm.com, tglx@linutronix.de, acme@redhat.com, heiko.carstens@de.ibm.com, hpa@zytor.com, brueckner@linux.vnet.ibm.com, tmricht@linux.ibm.com, mingo@kernel.org In-Reply-To: <20190219153639.31267-1-tmricht@linux.ibm.com> References: <20190219153639.31267-1-tmricht@linux.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf test: Fix failure of 'evsel-tp-sched' test on s390 Git-Commit-ID: 03d309711d687460d1345de8a0363f45b1c8cd11 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 03d309711d687460d1345de8a0363f45b1c8cd11 Gitweb: https://git.kernel.org/tip/03d309711d687460d1345de8a0363f45b1c8cd11 Author: Thomas Richter AuthorDate: Tue, 19 Feb 2019 16:36:39 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Feb 2019 13:43:29 -0300 perf test: Fix failure of 'evsel-tp-sched' test on s390 Commit 489338a717a0 ("perf tests evsel-tp-sched: Fix bitwise operator") causes test case 14 "Parse sched tracepoints fields" to fail on s390. This test succeeds on x86. In fact this test now fails on all architectures with type char treated as type unsigned char. The root cause is the signed-ness of character arrays in the tracepoints sched_switch for structure members prev_comm and next_comm. On s390 the output of: [root@m35lp76 perf]# cat /sys/kernel/debug/tracing/events/sched/sched_switch/format name: sched_switch ID: 287 format: field:unsigned short common_type; offset:0; size:2; signed:0; ... field:char prev_comm[16]; offset:8; size:16; signed:0; ... field:char next_comm[16]; offset:40; size:16; signed:0; reveals the character arrays prev_comm and next_comm are per default unsigned char and have values in the range of 0..255. On x86 both fields are signed as this output shows: [root@f29]# cat /sys/kernel/debug/tracing/events/sched/sched_switch/format name: sched_switch ID: 287 format: field:unsigned short common_type; offset:0; size:2; signed:0; ... field:char prev_comm[16]; offset:8; size:16; signed:1; ... field:char next_comm[16]; offset:40; size:16; signed:1; and the character arrays prev_comm and next_comm are per default signed char and have values in the range of -1..127. The implementation of type char is architecture specific. Since the character arrays in both tracepoints sched_switch and sched_wakeup should contain ascii characters, simply omit the check for signedness in the test case. Output before: [root@m35lp76 perf]# ./perf test -F 14 14: Parse sched tracepoints fields : --- start --- sched:sched_switch: "prev_comm" signedness(0) is wrong, should be 1 sched:sched_switch: "next_comm" signedness(0) is wrong, should be 1 sched:sched_wakeup: "comm" signedness(0) is wrong, should be 1 ---- end ---- 14: Parse sched tracepoints fields : FAILED! [root@m35lp76 perf]# Output after: [root@m35lp76 perf]# ./perf test -Fv 14 14: Parse sched tracepoints fields : --- start --- ---- end ---- Parse sched tracepoints fields: Ok [root@m35lp76 perf]# Fixes: 489338a717a0 ("perf tests evsel-tp-sched: Fix bitwise operator") Signed-off-by: Thomas Richter Cc: Heiko Carstens Cc: Hendrik Brueckner Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20190219153639.31267-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/evsel-tp-sched.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c index 5cbba70bcdd0..ea7acf403727 100644 --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -43,7 +43,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes return -1; } - if (perf_evsel__test_field(evsel, "prev_comm", 16, true)) + if (perf_evsel__test_field(evsel, "prev_comm", 16, false)) ret = -1; if (perf_evsel__test_field(evsel, "prev_pid", 4, true)) @@ -55,7 +55,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes if (perf_evsel__test_field(evsel, "prev_state", sizeof(long), true)) ret = -1; - if (perf_evsel__test_field(evsel, "next_comm", 16, true)) + if (perf_evsel__test_field(evsel, "next_comm", 16, false)) ret = -1; if (perf_evsel__test_field(evsel, "next_pid", 4, true)) @@ -73,7 +73,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes return -1; } - if (perf_evsel__test_field(evsel, "comm", 16, true)) + if (perf_evsel__test_field(evsel, "comm", 16, false)) ret = -1; if (perf_evsel__test_field(evsel, "pid", 4, true))