Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3746088imj; Tue, 19 Feb 2019 08:43:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IZR0ccbDWJNxDC62LQYvG9+BVXwrOW6Ajt174KsA1k3KkdHpIUQH6uTWz0ZjpHJK8uzVHlL X-Received: by 2002:a17:902:45:: with SMTP id 63mr24353206pla.281.1550594636764; Tue, 19 Feb 2019 08:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550594636; cv=none; d=google.com; s=arc-20160816; b=sAd34MR5ZoDBJVRy2mQ3lrKtDTnIhP+2mJfIUzUp4uHWIosPWJJzM7IntE42qK3eUg zgPSVe38jJwT3T7IluHiDuzp5N5boaMZxJAdFIbZV2ZkC27hI5/PFYeM79XTy9jbP+ZD +ChLQshHLRDaIfYYsT0lNXlvjTlfz14IV69m8I3DEM6SD9noyTJTZTmPhU1RBA8SccMk MWK+ozQZFzuWTUrpcRjpIqSawcO/mX0FXLiynQes7qigwF4i+MAy8Rux/qCXXuZxv/TL IiegNPB8ZG5E9TbR8EjU9wx4PgF0HpNlAeLUIKtTSpsSYyvTUvfpqcGyyQx8mnGIOaH+ RTKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6OMcGkTj5NBxvURmNIW7h5LNaeZWMz0XiAPPWbHs3gI=; b=yM02tGyzJ7W4cdxmRu6paAcGTnZbOtLhYTlV7XoAa/AkhMBHLGzZbtUEZ/PvOSKf0x 1LxGqEq9ZZgPdU8QBX9Cbutd+XV6w6CFCmAVo8r9W7An3m/TbLLls/1HPqq6TsmNdd+V 7qxUB6T7k3UwGvc1+Nx6aTfKjWGaXM5Ra71/q6QirdUF3ZrtfPF6lEnJ6gyaLb3Ol8VO sQ9kLvb/0Og0PmYsS5SL5KuRPYSS1rMpGdyCa9vnjhBCMtLBuNqMYg6WlEk5eAuelhS9 /z8zgCrRP6vQbLnU3XlmwR8ezL3xuE7uflIuiHSTE/BXkdP1sbEaLto4TwQF3FOOmKOa SU3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TETTtNeK; 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 n18si15565041pgm.28.2019.02.19.08.43.41; Tue, 19 Feb 2019 08:43:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=TETTtNeK; 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 S1728201AbfBSQnI (ORCPT + 99 others); Tue, 19 Feb 2019 11:43:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:36382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbfBSQnH (ORCPT ); Tue, 19 Feb 2019 11:43:07 -0500 Received: from quaco.ghostprotocols.net (unknown [179.162.130.119]) (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 7540C21773; Tue, 19 Feb 2019 16:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550594586; bh=3EQiNS8ldx/yNu+QdpNhmCiBMxc5assNF+42bMkaV0w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TETTtNeKwtEcVl27Ki5dGNs21kOtf48jrzXVNa7EndmliV3/sluWABHQ9Z/4Dzugc vOMwhr4SncE6M/gXkHrFeDKfUnFt/cP9rt9Q4ebnddqfeW6CWrRcPz75UngFEcngsx I8FZ9JSvTUz6M383mH+uDrYzl766hxfxjZCwyntc= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 07147410D5; Tue, 19 Feb 2019 13:43:02 -0300 (-03) Date: Tue, 19 Feb 2019 13:43:01 -0300 From: Arnaldo Carvalho de Melo To: Thomas Richter Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com Subject: Re: [PATCH] perf test: Fix failure of test 14 on s390 Message-ID: <20190219164301.GE31177@kernel.org> References: <20190219153639.31267-1-tmricht@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190219153639.31267-1-tmricht@linux.ibm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Feb 19, 2019 at 04:36:39PM +0100, Thomas Richter escreveu: > 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 ---- Please indent command output by two chars to avoid things like lines starting with '---' to break scripts that expect that to be the marker for the end of the commit log message as below... > 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 > --- ... here ^^^ I'm fixing this up now. - Arnaldo > 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 -- - Arnaldo