Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp998559yba; Thu, 4 Apr 2019 02:05:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkBjqB4qbQirjPHaRlRhKKJcvSxhMZGiUS+5tZ8zA3RPCXwNK2YLlsdCqA3ZaS16LPPvlS X-Received: by 2002:a63:d256:: with SMTP id t22mr4488041pgi.80.1554368716555; Thu, 04 Apr 2019 02:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368716; cv=none; d=google.com; s=arc-20160816; b=A+wi1naL05L0osRRCZadphG6PvmqrQ/o199xQJpLYQtpUyJWOF9/IEy7okixCAkXUb 8s5TbYaJQn14IxdlXfCNB16I0Qq7k+Lk1GtqaXhDeTwJRYpxLQo3vjSRXJ948TpWNGrR mUtPD3KqEvcDyHkjffKSxf5gs7fpoSE8TYs25N0Q2/CIUNTs9ixIw/eQth44AzNZkyty Ht524OQu+0ljopmGFYV0e3CLkyz9U7ty+7tgQOeZCZgMoPg6JRtuEbkgb4u+OsqF+7he YVRZwFhIZXaL61s/x6NlNjWJE0zMSx8Wsz6+1biuf46BH6Fv51uW8nkpc3YHbFPq0rYc B2tw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lxpf5gTy5iKQCFsQG2wVpw1C3epQgHlzNxjXhhuHMTQ=; b=zBxQ3D5N3WVxC2yzohXUT+nfl7CGeU8Gkx6e6c5iYSC3THMj7aSVa+EnyIXS2cf43Z yHgXIkwaIZ5N+BdNgN0mVV5s7CqNfUVUyQ8g8GiHGE3+FbiblzvoTbTAPJH1z9Xf+sqj jIMCNa8xP6IH17j/CjyiddRNxXQL3Iz5Q2lndsNxkHoowaixD60tGrDcJBg40vG3U+Ip pHl+s9AFZfPTSB10zluiZb7qYkihuFVW4COJZrgQIL3s8MXM5ApIkUQjPwXNdvpZ8ghT O5WO7qF/d37nsFxmkrxhj6VOjk9G9tKTql7BLDyJkByxwagmEcmW295cb6cdJohP7OPY rwnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="c/ah5jZX"; 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 q20si15719146plr.136.2019.04.04.02.05.01; Thu, 04 Apr 2019 02:05:16 -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="c/ah5jZX"; 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 S1731091AbfDDJDQ (ORCPT + 99 others); Thu, 4 Apr 2019 05:03:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:40836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731298AbfDDJDN (ORCPT ); Thu, 4 Apr 2019 05:03:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CF5C21741; Thu, 4 Apr 2019 09:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368592; bh=7NDfHRaTJhouqymtoBF6xEd6XEewJK1r8hJ/aXLLfDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c/ah5jZXlJzxoqhWegVm+5Cfw5Rr3Iegbs+qwVka9aMQefYMsGZW8vobiGPrBYOTc 6B1rj/m3sWv3A1VDdo8jtxv4R3Xz7pUwV6iO1wZbvlKczshVc2AYv1GiPGyN66lj8Z mZ8C9viaCHbbEnRI8JPdcuUCk2ELxfxdKM7ytAmg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Richter , Heiko Carstens , Hendrik Brueckner , Martin Schwidefsky , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.19 080/187] perf test: Fix failure of evsel-tp-sched test on s390 Date: Thu, 4 Apr 2019 10:46:57 +0200 Message-Id: <20190404084606.807541533@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 67bcbf876776..d0406116c905 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