From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 966E73A5443 for ; Sat, 30 May 2026 10:55:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780138559; cv=none; b=TJnkx9JSpLrdEH3cwdt7vFWpSPGjLL6JL99sj8dGnMN49epOBb/MkcW9OlDmOZE0i7GPugWppDOLc0+b6yKbrmqrzVH+ou/wlrggHDlQIigklmC4WGOfc9utGoLJP15h3NNqwhLPrLp1layY0mqK8D5FocTi/zjsh1Dnf8KBTK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780138559; c=relaxed/simple; bh=7DeHpkZu37aaxJSx0mbryrusOf/EE4h5YjWj9hZ9MSg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=FSgAgCIn9l1ehJzcJob+550AVFrv3k4ZZI9PzGUWSLJp96fmPuAxqJyANVsFiMrrQnxT/ssv2RTjIJoYVflfsLXWOiTZ1eYWEATjVT5WMXJyUgp5XBlSa+kvIz++d7Y7/MmIxDLtNulHSV9auTw5ttZOUR6RWQZ9dFtxRbo+4Tk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y5SxDuon; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y5SxDuon" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51F8A1F00893; Sat, 30 May 2026 10:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780138558; bh=TQlLU1+2xsZYaeD1xzbIsmb3Dq5cZDTO5AE3ZUAnaYM=; h=Date:From:To:Cc:Subject:References; b=Y5SxDuonGK7044OwIvou27O1uz3v0RMDaLF2s3LPluIWKmCws3PBddP4zsbdxJvbO r2lGbFrleePngKvs+k3Rk9lAvXj+4JI+efjXyPftqJgfTGDDPpzgYMfAt0y7t8pYBJ JTHSXJctPToYAjpidg0nYICsf9R/k2GW16Faf5kx3H8o/IhtNE/tp1l7SLcrGtrRPw 7awj/FARWl7wlV+CeqaFKEx7UPiO9EjxwB/K5Cjo8nmsFYlVxDCjMITqk8R1b6AviZ AFSv0Z3jg+Hl7YQ6BvNmIk5xBpA0Ka63OIpnvW8CEeQP13nf/29aiHVcYH0Z7VwuRn 182Bdg+yperwg== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wTHMt-0000000AsHr-20hb; Sat, 30 May 2026 06:56:39 -0400 Message-ID: <20260530105639.334261506@kernel.org> User-Agent: quilt/0.69 Date: Sat, 30 May 2026 06:56:16 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , John Kacur , Tomas Glozar , Costa Shulyupin , Wander Lairson Costa , Crystal Wood Subject: [for-next][PATCH 1/2] tracing/osnoise: Dump stack on timerlat uret threshold event References: <20260530105615.512858463@kernel.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: Crystal Wood Dump the saved IRQ stack trace regardless of whether the event was THREAD_CONTEXT or THREAD_URET. In the uret case, the latency presumably had not yet crossed the threshold at IRQ time (or else it would have dumped the stack at thread wakeup time, unless we're racing with a change to the threshold), but it may have at least contributed -- and this is possible with THREAD_CONTEXT as well. In any case, it helps with writing reliable rtla tests if we always get a stack trace on a threshold event. Cc: John Kacur Cc: Tomas Glozar Cc: Costa Shulyupin Cc: Wander Lairson Costa Link: https://patch.msgid.link/20260511223143.1477332-1-crwood@redhat.com Signed-off-by: Crystal Wood Signed-off-by: Steven Rostedt --- kernel/trace/trace_osnoise.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 75678053b21c..62c2667d97fa 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -2544,9 +2544,12 @@ timerlat_fd_read(struct file *file, char __user *ubuf, size_t count, notify_new_max_latency(diff); tlat->tracing_thread = false; - if (osnoise_data.stop_tracing_total) - if (time_to_us(diff) >= osnoise_data.stop_tracing_total) + if (osnoise_data.stop_tracing_total) { + if (time_to_us(diff) >= osnoise_data.stop_tracing_total) { + timerlat_dump_stack(time_to_us(diff)); osnoise_stop_tracing(); + } + } } else { tlat->tracing_thread = false; tlat->kthread = current; -- 2.53.0