From mboxrd@z Thu Jan 1 00:00:00 1970 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 B1AA3224B07 for ; Fri, 24 Jan 2025 18:48:46 +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=1737744526; cv=none; b=EveVM0ut/oXXh76qJp+fYq5mWtdf9iOFSYsy3PEbY3CtdpO27PkrsQi/gswYnTRLlWsEAUsVu0hMha4ilCaVEU+ssRe6Pxn1UhNGkR22AAo3KsEntyryHU/HrBPVwpsSmD1+Xnx7t50yV5VSvuauBKjI+ff9qs3VEMJdaBm0mh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737744526; c=relaxed/simple; bh=1rzYF/MfUxRmbL6IpBZOCKBkD2AAKmX3JS9qlmsgqec=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=tQor4NYvn9mEujvklHGWekExuMXTY/6c2xpbe9bsv9V68468bQFwfw0+A+walfJX8pBe31ryOnBhIEnRY20HuIMnlSRwd3zRktMNCHUXikFMhIibH7szsN+P3bcOloXjbqFpVcCy3jiF1LLGzbXbt+RRmqdCuTW5IoQDbEfU40Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39808C4CEDD; Fri, 24 Jan 2025 18:48:46 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1tbOjh-00000001FBc-1XRY; Fri, 24 Jan 2025 13:48:57 -0500 Message-ID: <20250124184857.222577823@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 24 Jan 2025 13:48:41 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Luis Goncalves , Gabriele Monaco Subject: [for-next][PATCH 06/14] rtla/timerlat_top: Abort event processing on second signal References: <20250124184835.052017152@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: Tomas Glozar 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-6-tglozar@redhat.com Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/src/timerlat_top.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c index d21a21053917..d358cd39f360 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -903,6 +903,14 @@ static int stop_tracing; static struct trace_instance *top_inst = NULL; static void stop_top(int sig) { + if (stop_tracing) { + /* + * Stop requested twice in a row; abort event processing and + * exit immediately + */ + tracefs_iterate_stop(top_inst->inst); + return; + } stop_tracing = 1; if (top_inst) trace_instance_stop(top_inst); -- 2.45.2