Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2864323pxv; Mon, 12 Jul 2021 03:55:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMtA6PjRO1SCHqF4a+SXZPb0bI0dBT8AsdiUUTVKPzwzRLUsgL7Y/cOBVyNd9HFKr05soG X-Received: by 2002:a02:a80f:: with SMTP id f15mr5709764jaj.142.1626087312720; Mon, 12 Jul 2021 03:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626087312; cv=none; d=google.com; s=arc-20160816; b=BGPwKJ8zNuu0+DfI8fdig8K5d+AbzNP4z3jLzbnEV4TJmZNn7i0+wYTIvL3dcWBHza 2X/YhysoEalRFXleFMUosOxiuMlFykAI7AIyGvoTPyQsbE2aUa4ta4LP2sIKJdYCj4qe LYrUCwDMMKLjMiQFP76SbCNNCMiV8I6k1OaNoblLUum2awOYJ1G2JgrfV4oRRG2Z1JJ1 aW4UUFhCi8+SuHEvsnWs8zT51IVnviFfMSItXw/w8/TJvJQe54rhRC/MvmzeMvRCKXPL kftIEjGNrIGplGOrQckgGyDfe7+QLioNHkfWmpjQstzOFLXGLZ9A6Jp0qDK6Zr6Tepps ACDw== 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=ES76TrbiTCxBflpHJhWFNQFEGp+6MbpE+ENLT7ZlEvJj90C33N020BFeK761C8THY6 hYIyB7uV6l6AkWEcEtZH5rPjnhdeieAn4N7hNU79MYFYNQUkGQ6yLUUjMNNXp+eMHMeb 6GyC331rJmlnU74I09ezvM/kQf78JRdzseAW1N9pTP7kwzWKyy7xAq52OTkBQEFEVsbd AAswN0Y/0inLzJaHsssXE3dtzZA/NDWG/+h2lmR72pSS/nqVbxuHWhdf3ojbCxVXmXi/ QmXXlIdMZT0ys4V9MlIWYvKG0PSwaz8Tol0nPmupiMySwV7x+2SSEHi1+upI4/4+OUaD Oeyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QcGEohqK; 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 i13si19481657ilm.45.2021.07.12.03.55.01; Mon, 12 Jul 2021 03:55:12 -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=QcGEohqK; 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 S1382025AbhGLJAX (ORCPT + 99 others); Mon, 12 Jul 2021 05:00:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:55108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353920AbhGLIDI (ORCPT ); Mon, 12 Jul 2021 04:03:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 299B461D1A; Mon, 12 Jul 2021 07:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626076721; bh=lehlT4m/InziezWCU44sOcqIerWh2hOgXlby/PasnhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QcGEohqKXnVDbWMSH1FyPtKxFnfWMSBwPHhvBWU/4ca6WUcwY3MMCSLktu7llFlXC xhSXFiLz9AWpDL5Kf3bU09/d+1mbXWv0T/OuNOc2GMTmGZCDtKFoAybstZRlAyKSf1 95zeSGrmMA/bdwAia8k7dnbQYszMyHJhaU5Z7vWI= 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.13 748/800] selftests/ftrace: fix event-no-pid on 1-core machine Date: Mon, 12 Jul 2021 08:12:51 +0200 Message-Id: <20210712061046.388103874@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060912.995381202@linuxfoundation.org> References: <20210712060912.995381202@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