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 C0C36296BBC for ; Sat, 4 Apr 2026 02:25:33 +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=1775269533; cv=none; b=hpaS6STlbzTr0kNg4DBWeNU7QJfLIPyS/iz8KKsLo6iHGgFjaqXAwh3d6vWiFeGfnyPd6fcOWzKqmzkRES9d0sH3nVXNYn7FPQ5GsdiehKUnU5b+nAJYh6fMH6AtvzsaQXzEsaRDY9msRnp6K+Fhyo6PcBJWTowxwZYppDZzE3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775269533; c=relaxed/simple; bh=f693D/SPUG6YUzBtB3hmnFTfWKBWezOeD+zZ1c2CXF0=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=d8N/5xQUY0seU1f9zXC54MLnwfL5NvuG8plNt2D5BJ00yMFMJnOal473hsYdLiH7oavV1tIB11ziQ+NguWrz+1zEiAoTNQMCF87nvGDVTo4yxmCnM3L0pSzCKZ4IOV0SO/y7qZFI1hW9vfUrnuxJ4e/PembUZauuIMeAamb1Zdk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BkM7myjS; 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="BkM7myjS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B13BC19423; Sat, 4 Apr 2026 02:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775269533; bh=f693D/SPUG6YUzBtB3hmnFTfWKBWezOeD+zZ1c2CXF0=; h=Date:From:To:Cc:Subject:References:From; b=BkM7myjSJVYssLF7AOpvkHMfCvOCZDGbgFGOoM7MI5Gc3DRRJgQFiDBUkhlKbsjsc wlhYrcNpLyjyh9KZywzw3e6U+2RWqy6SvhNAy1NRiW0m3XNmVAp+ClwaEycIofG86l LIIuCDZDiNlpYv/QYfZZdPzi0tsEL9+kLR5FmfydLtiOe8DmDihCnoSpf+cbqst8f8 hqqZ3nBY9ZfaFUEANu4BRgo1HGr9Y//fjdTOhKC0jXctpZBGw0dVYp/NJ7PohGHB7W 7ytjtMy6ibPIJXnzwlYAkdzDM+/EJ6Wss/X5unpK3Zp5v1NN0r6dDJedGelKKJLACC Zs9r1RnVK4tXg== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1w8qid-00000001642-2se5; Fri, 03 Apr 2026 22:26:39 -0400 Message-ID: <20260404022639.546384239@kernel.org> User-Agent: quilt/0.69 Date: Fri, 03 Apr 2026 22:26:18 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-next][PATCH 1/6] ring-buffer: Show what clock function is used on timestamp errors References: <20260404022617.436859059@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: Steven Rostedt The testing for tracing was triggering a timestamp count issue that was always off by one. This has been happening for some time but has never been reported by anyone else. It was finally discovered to be an issue with the "uptime" (jiffies) clock that happened to be traced and the internal recursion caused the discrepancy. This would have been much easier to solve if the clock function being used was displayed when the error was detected. Add the clock function to the error output. Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260323202212.479bb288@gandalf.local.home Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ring_buffer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index d6bebb782efc..8b6c39bba56d 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -4506,18 +4506,20 @@ static void check_buffer(struct ring_buffer_per_cpu *cpu_buffer, ret = rb_read_data_buffer(bpage, tail, cpu_buffer->cpu, &ts, &delta); if (ret < 0) { if (delta < ts) { - buffer_warn_return("[CPU: %d]ABSOLUTE TIME WENT BACKWARDS: last ts: %lld absolute ts: %lld\n", - cpu_buffer->cpu, ts, delta); + buffer_warn_return("[CPU: %d]ABSOLUTE TIME WENT BACKWARDS: last ts: %lld absolute ts: %lld clock:%pS\n", + cpu_buffer->cpu, ts, delta, + cpu_buffer->buffer->clock); goto out; } } if ((full && ts > info->ts) || (!full && ts + info->delta != info->ts)) { - buffer_warn_return("[CPU: %d]TIME DOES NOT MATCH expected:%lld actual:%lld delta:%lld before:%lld after:%lld%s context:%s\n", + buffer_warn_return("[CPU: %d]TIME DOES NOT MATCH expected:%lld actual:%lld delta:%lld before:%lld after:%lld%s context:%s\ntrace clock:%pS", cpu_buffer->cpu, ts + info->delta, info->ts, info->delta, info->before, info->after, - full ? " (full)" : "", show_interrupt_level()); + full ? " (full)" : "", show_interrupt_level(), + cpu_buffer->buffer->clock); } out: atomic_dec(this_cpu_ptr(&checking)); -- 2.51.0