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 70479224AE9 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=CcgpBPfoI/26EU6kpOiJBomV5JcgXnJxY+4v+S0u7rZeUFk/PS3dX+JJM4FyOBOU8QT/C0utu264vMe4nZqo1RVMuPTKjHPWcoxRtDAIzS3xiz2YGFlSZxwrszgTNcKHSpiFv56+CoSdBK8k6jj1S3UCq6XSUwSAb1Wrmj5CTXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737744526; c=relaxed/simple; bh=0Nrq3nsbvZYNmz+BN2Djx6zQsw6h+0wTOtDT4BGcwHM=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=DnBF29tJUM/INu/G93dlt5BIFl0VsRbBjiHEBOcLEDIH3963+kg8avk++cJ9G15nCUaUZXVCLRCWTEagsvWUgGqzu6NV2VNXSPq+YpEHv288lJoGWJjeJIOSPYU/jsYxlfVdELG709wreT+uUKasmRctjbGgwwoH9gnYT0Sl008= 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 0CE58C4CED2; Fri, 24 Jan 2025 18:48:46 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1tbOjh-00000001FB8-0qN4; Fri, 24 Jan 2025 13:48:57 -0500 Message-ID: <20250124184857.053745778@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 24 Jan 2025 13:48:40 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Luis Goncalves , Gabriele Monaco Subject: [for-next][PATCH 05/14] rtla/timerlat_hist: 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-5-tglozar@redhat.com Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) --- 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 f1edf1c8a7b0..53ded187b33a 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -1134,6 +1134,14 @@ static int stop_tracing; static struct trace_instance *hist_inst = NULL; 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; if (hist_inst) trace_instance_stop(hist_inst); -- 2.45.2