Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5597665img; Wed, 27 Mar 2019 11:23:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4/3hI1YDiTwh/9Y3BYQYzC9qcT9ASqS9N5QkqXBZUKspjMxVm3r2bUmVKJ+9Hhe/S0LPK X-Received: by 2002:a63:2158:: with SMTP id s24mr27183499pgm.156.1553711037599; Wed, 27 Mar 2019 11:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553711037; cv=none; d=google.com; s=arc-20160816; b=hnzaXfuHulPRVEFbXOcZNcFGQTOLpCcrqSo+Qsj0fZveDu7EhTrId9woIT0yOjJUYs 42J4GKxhLPtGmagAL52Pvac5nCwJjpEIK4WZmqKASmSrPTa5FDhe5ZZ0rUURPbxa73tn ljguPpxSXNSYzruIDqIN41qB3IeC3pK94wjmiu7XtrBjZ5KndfynVcM7kOR+4hGyVIbD ynWww8+/Zn9o/iIqUtOFWpCRvbG0/UuIFirehgOBFtYALVHxpFLwRyXxRn7cOnZgEJG6 bVSCHdcbBH1i/GUyGajvL8teB2fTCEajMotLbR0c5WrhDZoIalswpVsdfJoYx2N7P/S8 vX7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MTrXW0mIa9YIR+dxV7pmn/tKH3Rzzs4BRdwuuihVowQ=; b=fU1hso0kTZjSXf0TnT+aFxot514KYSWeQXYeRGPaE0RsfVQk6Y7tNhF0wnlkppfYQL Ut6dFtKoaABW+gmk40x0QoMVrT+Y1karHowVwDXZp3BzwsiLdwPhEVtstFaofGTVNyJl D/lD2TiVFvquHajcC44wlgpY+ueLdhOaQ16UpwO4I7mEIQhE24Wn21ybbd5imbtLA9EY FfI84n0MmRw4UiCSTpQpkrtavQU4vC6j+CA/XJyGnPGofyHDNchVnZLP5UHe8HzMH02M NLS3oMMmT92UJcZYi2BnaQb0I5spLzBpUhbmTPS0IWnAxVYBgSZ5GHe2z8vQw5mwD7Vi t/xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MX1Hqct2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s26si18383787pfm.143.2019.03.27.11.23.41; Wed, 27 Mar 2019 11:23:57 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=MX1Hqct2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390375AbfC0SVp (ORCPT + 99 others); Wed, 27 Mar 2019 14:21:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:39620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403776AbfC0SVm (ORCPT ); Wed, 27 Mar 2019 14:21:42 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CB5420651; Wed, 27 Mar 2019 18:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710901; bh=AFfioc7Jl/ZYZ1nAZUr7bArBHRtUxAlR67iMr/GBcW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MX1Hqct28HkO8ge+1JcglFoOl4l1RijiIYfZTiKlptgZ6D8BsS6zeuFpAefSQsaYq Kweflc6veA0qUU3OYp+3/9baXTtSc/s9v1C4vzfKVjkyayWM4+L3S/WWdyqPVV9eDD fx+7/pR1VozXQzRc1iHkohq+W/a+PTs7tmA0zrg8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thomas Richter , Heiko Carstens , Hendrik Brueckner , Martin Schwidefsky , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL 4.9 37/87] perf test: Fix failure of 'evsel-tp-sched' test on s390 Date: Wed, 27 Mar 2019 14:19:50 -0400 Message-Id: <20190327182040.17444-37-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Richter [ Upstream commit 03d309711d687460d1345de8a0363f45b1c8cd11 ] 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 Signed-off-by: Sasha Levin --- 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 66b53f10eb18..ea772d41e472 100644 --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -42,7 +42,7 @@ int test__perf_evsel__tp_sched_test(int subtest __maybe_unused) 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)) @@ -54,7 +54,7 @@ int test__perf_evsel__tp_sched_test(int subtest __maybe_unused) 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)) @@ -72,7 +72,7 @@ int test__perf_evsel__tp_sched_test(int subtest __maybe_unused) 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)) -- 2.19.1