Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2831764pxv; Mon, 12 Jul 2021 03:02:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxRYdrYvPgzoU60rgbQkRAItHmRzcE6NJet2hZY1MNPHZYpz/9FGWRGw+P2UWOyGj1Diys X-Received: by 2002:a05:6e02:1d8d:: with SMTP id h13mr10320024ila.40.1626084173513; Mon, 12 Jul 2021 03:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626084173; cv=none; d=google.com; s=arc-20160816; b=XvAbJzEuLwD4oYCQ1ApqSHWjF6YAv1p09lZSSlWqifSe9Rf1TQd4JBt5MZ0S4D+RgY csDplYT7E7t9NEYihQ256tqTSt3l7b2UZZPUF3mapw7s80RaVQNvhyMarYOvEUUuLrOc J1h2CFC0tkT2YNIrNNlyjDz0XYRcT+zwBEFkkfNUlUa9M5ydWViG3PUKYuCR3LG4iUBF T4Ctl2+GJD+N6I3nV8v1SJ84ia6AFRyTyObe7TJ1O68YqdUjOKDuByfo81Ir6lfQ4Tda /DN++F7dMnpL40WJScaOrPAhFMg++SrL6YgC+lQ0ZyM2ob+aQNXsoEvKx5SW21A0rWYF P1pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5wrF/37VG5OpltBmHOGJr7VporeJcoKp6nrzoiFV5Ho=; b=rfjkcsRIZQG1eeWfcGNNTjn6YksRbp8KOnnVVc073aYVdp1ClvG07tat1hYUpNwB6q tuGWWSSCp61fymK1BePF1/Ez6V1L2dCT3B+YHFq90WZVjxqJAWnn5eayIVDEJ3xuSZQm cmgdf7GYB7/7EGSx9AFqmPxlXPmovKQ7owuPRuy1RKLGO3uQVSav8TsT47DbhI1FFt/F LeeUeLEsQduETKybH5H5Kg7u+4EACM7C2hhcxn70yoewmufDtlOYR6xFmkdHh8yXoXVv k5YrrCm8L2bVtaake8eufmo/diMmX/JxpIDONYY/NUuQnH4ZVKOw9ppPo3F+YWWASkCz oL6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ioujfjy; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si17818128ilg.4.2021.07.12.03.02.42; Mon, 12 Jul 2021 03:02:53 -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=@linuxfoundation.org header.s=korg header.b=2ioujfjy; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243202AbhGLHQ7 (ORCPT + 99 others); Mon, 12 Jul 2021 03:16:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:52760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239327AbhGLGwr (ORCPT ); Mon, 12 Jul 2021 02:52:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB8296052B; Mon, 12 Jul 2021 06:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626072599; bh=lehlT4m/InziezWCU44sOcqIerWh2hOgXlby/PasnhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ioujfjyL2icU0iz3qowxc5Ne0yq5xl8VXCVCQoMtVkEDXcp+a7WqgyGmwkFdGUdK 2tO7BaT6UZ8jULI2xBz0e8qdb9JW23h0HU50MeCKhRqoS/zeXz7CZ2lX3XC6iMfSrX oI/6jUjaPyiBTyzFOTquRLMaLAnsMYka1i60lktY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , "Steven Rostedt (VMware)" , Shuah Khan , Sasha Levin Subject: [PATCH 5.10 550/593] selftests/ftrace: fix event-no-pid on 1-core machine Date: Mon, 12 Jul 2021 08:11:50 +0200 Message-Id: <20210712060954.808789890@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060843.180606720@linuxfoundation.org> References: <20210712060843.180606720@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit 07b60713b57a8f952d029a2b6849d003d9c16108 ] When running event-no-pid test on small machines (e.g. cloud 1-core instance), other events might not happen: + cat trace + cnt=0 + [ 0 -eq 0 ] + fail No other events were recorded [15] event tracing - restricts events based on pid notrace filtering [FAIL] Schedule a simple sleep task to be sure that some other process events get recorded. Fixes: ebed9628f5c2 ("selftests/ftrace: Add test to test new set_event_notrace_pid file") Signed-off-by: Krzysztof Kozlowski Acked-by: Steven Rostedt (VMware) Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- .../testing/selftests/ftrace/test.d/event/event-no-pid.tc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc b/tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc index e6eb78f0b954..9933ed24f901 100644 --- a/tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc +++ b/tools/testing/selftests/ftrace/test.d/event/event-no-pid.tc @@ -57,6 +57,10 @@ enable_events() { echo 1 > tracing_on } +other_task() { + sleep .001 || usleep 1 || sleep 1 +} + echo 0 > options/event-fork do_reset @@ -94,6 +98,9 @@ child=$! echo "child = $child" wait $child +# Be sure some other events will happen for small systems (e.g. 1 core) +other_task + echo 0 > tracing_on cnt=`count_pid $mypid` -- 2.30.2