Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp639818pxb; Tue, 19 Oct 2021 09:53:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2OpyfSOUzonIiLsYEhw2zSetjHQEIsePmkyBNRM42F5hJtVMm9DAbtPQV3tUEeRQ8LcjA X-Received: by 2002:a63:dc42:: with SMTP id f2mr30032288pgj.152.1634662401685; Tue, 19 Oct 2021 09:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634662401; cv=none; d=google.com; s=arc-20160816; b=lKMOL0QVSXZzHIvwB366u1zgart0jARajDxeM+5yeo8dPamGa73z/uGUDw4E5TYr84 b3a5lpFz7fS388PGUsyyvyjD8C3VG7ESpIRgwGbqDNeFSQM8bFF/Dw6/bUJvtJdhBa6T /V/T1V24PO7R26LuFbEafmgsjMnfW0g4wLGXnGbic3CzV/4w1BFTs2fQWv4hdjTidocN axHjMvH+u2Ma+IxXkUs6LvizM9QA+GkbAVGQik/AjHFvrr0w3g0SIUvIAYsrlNMMlRhY xQsNCMaYu3BqRb6Vac2udD1nnTvjxNrb6U5LiH9/MGTFs8WEG7lCaR3akMT5BJ5QVoIw fUZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hF1rAhHFebMjUOz1oODfbxJ/fRE71D6KWD10t0ZR0ws=; b=YhBLrPbqgZceHG7yQca73rgCvPEnctNXSCqvMEx3wCA6LtOs5OHbraVnAM1GxjqR+Z zSMvBGiVepLFDnw6qw+Le6RWgKbCNfx4UhEfc7P8xtt5I4hgROch55RNl6EbO8+aq2rV MT7WzWaLC08PEJ0Q2dy/hCQERzQBTNNgBsOyOADtugbsmfIYE6+S8D0lu2LtW97mLyan 47Ds+/Y65tUw0sm1IL9k02J/xp5xZUsKuqO8Lkato2rNA/voIYYdNAltpFmtfY76vqEH GcRA7hni4/RtBHGujCYmax8SPF3sddGIXgarFSp4A9bUXAdo4NQU3gNJEetJ4PL/rvqB IaAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Va78o910; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id r14si27769552pgv.155.2021.10.19.09.53.07; Tue, 19 Oct 2021 09:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Va78o910; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231495AbhJSQxo (ORCPT + 99 others); Tue, 19 Oct 2021 12:53:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:38108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhJSQxo (ORCPT ); Tue, 19 Oct 2021 12:53:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8D0161175; Tue, 19 Oct 2021 16:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634662291; bh=DfTQJs64LQ8BFMva0fsuPqpILcNUsBEcTHtydyZExOo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Va78o910x+zTOVrNzgaURxPgJkVqKi+sM2NXvpj6TvxZ9GuO2e8fQ4zc53qS9W0G4 sdKrjckd77aMgt40aDLPWO9T1960oAgwqboSaRTIpNzoXPs0rSs7I4XwYXjh76LYNs zJaIjJqr6SyRF2XvQpyVsbFZXqdJgRA4GYPehxxbLTP0SWGTCwSt6eVCDUNWtEngcX EZQvzoTGDXiGQIuW5to2O/dIh2ldzxnSYEmaPtaTpA4IjoWiKNmy3uLNJ+iLOe63Yc yQYc1rLfq/KMj3jmaLYC6Gg0+SHqtrR11JRJberBAYyxdttKlTaqoQ0ZuUcq4d5pfp FQf7k6fPP3ZCA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 91D54410A1; Tue, 19 Oct 2021 13:51:27 -0300 (-03) Date: Tue, 19 Oct 2021 13:51:27 -0300 From: Arnaldo Carvalho de Melo To: Mathieu Desnoyers Cc: Yafang Shao , rostedt , kernel test robot , 0day robot , Petr Mladek , Kees Cook , Peter Zijlstra , Alexander Viro , linux-kernel , lkp , Andrew Morton , Valentin Schneider , Qiang Zhang , robdclark@chromium.org, christian@brauner.io, Dietmar Eggemann , Ingo Molnar , Juri Lelli , Vincent Guittot , Ben Segall , Mel Gorman , bristot , aubrey li , yu c chen Subject: Re: [sched.h] 317419b91e: perf-sanity-tests.Parse_sched_tracepoints_fields.fail Message-ID: References: <20211010102429.99577-4-laoar.shao@gmail.com> <20211014072707.GA18719@xsang-OptiPlex-9020> <1529739526.13983.1634215325995.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529739526.13983.1634215325995.JavaMail.zimbra@efficios.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Oct 14, 2021 at 08:42:05AM -0400, Mathieu Desnoyers escreveu: > ----- On Oct 14, 2021, at 5:24 AM, Yafang Shao laoar.shao@gmail.com wrote: > > On Thu, Oct 14, 2021 at 3:08 PM kernel test robot wrote: > > That issue is caused by another hardcode 16 ... > > Seems we should make some change as below, > > diff --git a/tools/perf/tests/evsel-tp-sched.c > > b/tools/perf/tests/evsel-tp-sched.c > > index f9e34bd26cf3..401a737b1d85 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(struct test > > *test __maybe_unused, int subtes > > return -1; > > } > > - if (evsel__test_field(evsel, "prev_comm", 16, false)) > > + if (evsel__test_field(evsel, "prev_comm", TASK_COMM_LEN, false)) > > tools/perf/tests/* contains userspace test programs. This means it gets the > TASK_COMM_LEN from the uapi. The fix you propose won't do any good here. That specific test is just checking if the parsing is being done as expected, i.e. we know beforehand that COMMs have 16 bytes, so the test expects that. Now that it can have a different size, then the test should accept the two sizes as possible and pass if it is 16 or 24. Like in this patch: diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c index f9e34bd26cf33536..182328f3f7f70e0e 100644 --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -5,7 +5,7 @@ #include "tests.h" #include "debug.h" -static int evsel__test_field(struct evsel *evsel, const char *name, int size, bool should_be_signed) +static int evsel__test_field_alt(struct evsel *evsel, const char *name, int size, int alternate_size, bool should_be_signed) { struct tep_format_field *field = evsel__field(evsel, name); int is_signed; @@ -23,15 +23,23 @@ static int evsel__test_field(struct evsel *evsel, const char *name, int size, bo ret = -1; } - if (field->size != size) { - pr_debug("%s: \"%s\" size (%d) should be %d!\n", + if (field->size != size && field->size != alternate_size) { + pr_debug("%s: \"%s\" size (%d) should be %d", evsel->name, name, field->size, size); + if (alternate_size > 0) + pr_debug(" or %d", alternate_size); + pr_debug("!\n"); ret = -1; } return ret; } +static int evsel__test_field(struct evsel *evsel, const char *name, int size, bool should_be_signed) +{ + return evsel__test_field_alt(evsel, name, size, -1, should_be_signed); +} + int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtest __maybe_unused) { struct evsel *evsel = evsel__newtp("sched", "sched_switch"); @@ -42,7 +50,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes return -1; } - if (evsel__test_field(evsel, "prev_comm", 16, false)) + if (evsel__test_field_alt(evsel, "prev_comm", 16, 24, false)) ret = -1; if (evsel__test_field(evsel, "prev_pid", 4, true)) @@ -54,7 +62,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes if (evsel__test_field(evsel, "prev_state", sizeof(long), true)) ret = -1; - if (evsel__test_field(evsel, "next_comm", 16, false)) + if (evsel__test_field_alt(evsel, "next_comm", 16, 24, false)) ret = -1; if (evsel__test_field(evsel, "next_pid", 4, true)) @@ -72,7 +80,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes return -1; } - if (evsel__test_field(evsel, "comm", 16, false)) + if (evsel__test_field_alt(evsel, "comm", 16, 24, false)) ret = -1; if (evsel__test_field(evsel, "pid", 4, true))