Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB7CB3C38; Wed, 29 Jan 2025 14:02:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738159324; cv=none; b=nDBZHJFPHeBoCfCLVR3AdRVX3Rf30AkgTf4yYAa4hEPOHYF2TnZ4DZphA+ZX5h4Bc+NCMLD8BXFk5IX8gCQEKblvrznPIeSSKUv/PS6p3K2nDYSK1CF3OSAnoj0tI/x8ELJMJk2GrLTsA781TIe372e0hlkLun4oXAX49AMvpc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738159324; c=relaxed/simple; bh=8Pewjumr59BfpIyDUhEf+teBjecSIpo4g2FVBg5b5aU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=p6BFqjgsr8jiiJUk/LuawyRwGSJ00KGsimM5nFtQhJzGVSLs/dDg+tiOA0IXOBdXIXpJryYsSsXVTE1J1fmo5UoKj9s3P7MQ+GI+AZfwGgVme+VUWBIPPXTCTTWIXOcN40Bk1t6uZ3o1nyWZoyC5M2c5NZ4DahOCRfugxFlVdSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GLSMzRuS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GLSMzRuS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83B6EC4CED1; Wed, 29 Jan 2025 14:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738159324; bh=8Pewjumr59BfpIyDUhEf+teBjecSIpo4g2FVBg5b5aU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GLSMzRuSU6nSbm0ilcogOIO0ocaPilFu6pJdhW2wpEUhVqGVZvJ0PjygmngWv425T q1YM/pACIUG9rLDh2xJTaYYKAxem6gkTc5NfeH/EfKMmUZhi3dTfUvbAmCMwljbfZC kgW9rZg/P+Y0KcmetOR84UV04xChW02w/z9mMWcui1QKhDq44YyTODKSlXrw/ZSn6E JXZDnNR9nD7GYjIszWPGx51EvwG7DRyEhENuHC1Iyebl6wW7LnWLloc0jDu0ImmKlE JlOGC/JlczCtXHauROE4RrJPDCOkp1aBnXpNuNFoqtnMeNfgwKfqE7Yr0dXdZ3WZo1 Ow3h+pbhEvr+g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tomas Glozar , John Kacur , Luis Goncalves , Gabriele Monaco , Steven Rostedt , Sasha Levin , bristot@kernel.org, costa.shul@redhat.com, linux-trace-kernel@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 3/4] rtla/timerlat_hist: Abort event processing on second signal Date: Wed, 29 Jan 2025 07:58:12 -0500 Message-Id: <20250129125813.1272819-3-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250129125813.1272819-1-sashal@kernel.org> References: <20250129125813.1272819-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.127 Content-Transfer-Encoding: 8bit From: Tomas Glozar [ Upstream commit d6899e560366e10141189697502bc5521940c588 ] If either SIGINT is received twice, or after a SIGALRM (that is, after timerlat was supposed to stop), abort processing events currently left in the tracefs buffer and exit immediately. This allows the user to exit rtla without waiting for processing all events, should that take longer than wanted, at the cost of not processing all samples. Cc: John Kacur Cc: Luis Goncalves Cc: Gabriele Monaco Link: https://lore.kernel.org/20250116144931.649593-5-tglozar@redhat.com Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) Signed-off-by: Sasha Levin --- tools/tracing/rtla/src/timerlat_hist.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c index ed08295bfa12c..2dd271102c0da 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -785,6 +785,14 @@ static struct osnoise_tool static int stop_tracing; static void stop_hist(int sig) { + if (stop_tracing) { + /* + * Stop requested twice in a row; abort event processing and + * exit immediately + */ + tracefs_iterate_stop(hist_inst->inst); + return; + } stop_tracing = 1; } -- 2.39.5