Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1970951rdb; Thu, 7 Dec 2023 14:16:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvc97IYg3Zo1ZuFEYh3wcAOffBSQfpBx6WXwgo+mL9HJMnb9zZpLs6cl61CE8x6EuEBauB X-Received: by 2002:a17:903:2351:b0:1d0:8be8:bb6a with SMTP id c17-20020a170903235100b001d08be8bb6amr3882457plh.67.1701987367017; Thu, 07 Dec 2023 14:16:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701987367; cv=none; d=google.com; s=arc-20160816; b=S3QXlPVrxJDFt+bsERCrdFy4Ww66G1MoW/E7UVH/f1PmLTrtM5azJAihXK8ZJCOFnf nrGZGohVFhEiLvZ9ycbZ78cs1TNZWB9EAG8pj3A0e2v5CG+6iJm9hugmfZ84ODazIrWZ WNAfttXA64ExPqPF+wVXxZn5taf+gUIeZEGrwJ8vBJo5ljyB97+5jgE1h1ugcN9hf7rg mX/LTDjV+vej3Me6e5gTjgd87YZk7TTnNp8mocXV3XLTvo8+gmW3sbYQzZcFUUjL62BG QU2W5tS5ZuQW0AoIHIdQrfjVB4zzRx8H2KTY6VxH4sOSEFtcdIFuoG8YAygVkqjftoK3 3zlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:cc:to:from:date; bh=YdQnkrJPZPSgMmxsHkfThO0UNuMSAXfrsuPkQYvGcUc=; fh=R8JZsVKDlS7lXIAvTNV55bsjlDBI0i4sqiOYXO4tZQA=; b=kLpBXP1SK4+J/nlgkB/NwA0BsiN/1CCiwYaKZY3I1t/Nij8SK4o7oVW1xPmXOi9NMJ MknCB19VqDxYwsetMx1NOL1H1/wYCV83J6gBgE7fXgXEsoJUSAZy9bhiOdXdFhx8F1g8 /88+s07uJSVI5hrhy6bV5ul7SpXDTMaH9OaFd1YAvesPKGkx/QEug02oa3w/24bcruPF uvMo0GjCHkzBOylZ99UJfPX2lPs36s9Twc4k0lJsPtFC9XkXZWtDZWE6lFApmFLOkW9H WSOz51mkFRwfmHzT4YZ1OHVJFDLmLPBNtYQCKWRioo4yz+7N72qhAr8W9KXKIfxfdjoG 6gSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l15-20020a170903244f00b001d0b06f196asi436243pls.28.2023.12.07.14.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 14:16:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0349C8526814; Thu, 7 Dec 2023 14:16:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444062AbjLGWPk (ORCPT + 99 others); Thu, 7 Dec 2023 17:15:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232521AbjLGWPj (ORCPT ); Thu, 7 Dec 2023 17:15:39 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E066610DE for ; Thu, 7 Dec 2023 14:15:44 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E485CC433C7; Thu, 7 Dec 2023 22:15:43 +0000 (UTC) Date: Thu, 7 Dec 2023 17:16:13 -0500 From: Steven Rostedt To: LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers Subject: [PATCH] ring-buffer: Add offset of events in dump on mismatch Message-ID: <20231207171613.0592087d@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 07 Dec 2023 14:16:04 -0800 (PST) From: "Steven Rostedt (Google)" On bugs that have the ring buffer timestamp get out of sync, the config CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS, that checks for it and if it is detected it causes a dump of the bad sub buffer. It shows each event and their timestamp as well as the delta in the event. But it's also good to see the offset into the subbuffer for that event to know if how close to the end it is. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ring_buffer.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 8d2a4f00eca9..b10deb8a5647 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -3424,23 +3424,27 @@ static void dump_buffer_page(struct buffer_data_page *bpage, case RINGBUF_TYPE_TIME_EXTEND: delta = rb_event_time_stamp(event); ts += delta; - pr_warn(" [%lld] delta:%lld TIME EXTEND\n", ts, delta); + pr_warn(" %x: [%lld] delta:%lld TIME EXTEND\n", + e, ts, delta); break; case RINGBUF_TYPE_TIME_STAMP: delta = rb_event_time_stamp(event); ts = rb_fix_abs_ts(delta, ts); - pr_warn(" [%lld] absolute:%lld TIME STAMP\n", ts, delta); + pr_warn(" %x: [%lld] absolute:%lld TIME STAMP\n", + e, ts, delta); break; case RINGBUF_TYPE_PADDING: ts += event->time_delta; - pr_warn(" [%lld] delta:%d PADDING\n", ts, event->time_delta); + pr_warn(" %x: [%lld] delta:%d PADDING\n", + e, ts, event->time_delta); break; case RINGBUF_TYPE_DATA: ts += event->time_delta; - pr_warn(" [%lld] delta:%d\n", ts, event->time_delta); + pr_warn(" %x: [%lld] delta:%d\n", + e, ts, event->time_delta); break; default: -- 2.42.0