Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5583352img; Wed, 27 Mar 2019 11:08:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqywB0QgM4I1mwT1Whh7dXB7UKeZMPlyTAdBtC1QI94EyAiQpf2O2ZXpSAmaOh2diriSFH/i X-Received: by 2002:a17:902:968a:: with SMTP id n10mr38945515plp.283.1553710094332; Wed, 27 Mar 2019 11:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710094; cv=none; d=google.com; s=arc-20160816; b=m4be4iX5e98xP61I64+y1hIGeuKy5Dn9Bk0US0cmZYHJH9q5UK7ddKDkDypVAmM46S dh+0B8lMO0ei1sRVY3ihpdWXTX2i/qAYXMOHfk6mVWHf/u3NwW7m3NBb3ADAf60bA4Zm Yr7R6qbe8Q8toBwIGVuENXIiH3Rtf+EV6GJx9pFGCmZc6l178APdYW81Pgt4T6pKsTYf G1ARNlZ5brd1lPPvbTnrnl6WmYlwk/Uv519ZD9LgTDZRIsVp0sfsG0m3O8x5wEJyKDyh 1g+6ZBky59iQFq7SmlQxdscpriP1wpBk2WuQ98vApH3CVMc/g3JHzvVTnG6Ybgx2LwO9 d4bw== 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=yrnNB5v4omNd5Klv2piRsbS3h/ccGzRc/NDSV35fRN4=; b=z+zcMAjSvdWZtaqvy8oEb2nHkKs6cLiWp3G2PJS2w3VCXuNfsp09DDHZfqe45OXztl savgJsX1F455RDQ1k3vWnMlyKqts8uad7OAupBrDVrpzHCRo3Gp7344e/+5rO9uUGNtb BpceOAcF1SNk3nvHfUKxGVqONY62SRsBeBiVTGbMgIP8l4+nqTieITzfLkp634jTLtDK vb/iW8PJNfaGn/QjOW5z9TRxc7ROzk9epvHLgWH3CGqCei9Aj3U3utL0tl8s7aki+IFy HOViSbUsWLDYMjMwRCeUd7QiTifqekkk5gS+peondiiCvxrsyb1FDes+cZ4Sx7akVhQH H6kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GPNFtww2; 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 r12si18325077pgv.293.2019.03.27.11.07.58; Wed, 27 Mar 2019 11:08:14 -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=GPNFtww2; 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 S2387701AbfC0SF2 (ORCPT + 99 others); Wed, 27 Mar 2019 14:05:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:46560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387674AbfC0SFZ (ORCPT ); Wed, 27 Mar 2019 14:05:25 -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 3D0962075C; Wed, 27 Mar 2019 18:05:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709924; bh=HJGvBuaXPYvkiJgtICL0SGVjZC5YdKICtLAeVf4HRPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GPNFtww2fyU0v2W/vfzSuX2NuQPNsu30mpedjmneMkbgEQF8eu9u4IrFxP6ZPCreH hsAslPnBJ9QmGgA6TOSzgZY4/Fm68KVl8S1zbpVQ7gPwSVrd3EKhUhn1iz1ut1bdp6 SGrZ4H152uh0RH/U1V+jdAhjCIFQuv7QXb096Ku8= 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 5.0 115/262] perf test: Fix failure of 'evsel-tp-sched' test on s390 Date: Wed, 27 Mar 2019 13:59:30 -0400 Message-Id: <20190327180158.10245-115-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-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 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)) -- 2.19.1