Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3158848rdb; Sat, 9 Dec 2023 14:10:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHHzIvv9tUOajSb51lotCmhHgzZQv4E0WXU2M5byPYDA8PRrXBkqijo5CySBE1HiVg8+kf X-Received: by 2002:a17:902:f546:b0:1d0:90cb:5adb with SMTP id h6-20020a170902f54600b001d090cb5adbmr1256715plf.52.1702159847314; Sat, 09 Dec 2023 14:10:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702159847; cv=none; d=google.com; s=arc-20160816; b=qWi9EjfjZJ2W9KR/GdMUM/FC0I5ylV80KovUFwxUCGqlu9/NNYZhpZgLWaBxy2t0Kx JFWxOTPMEJXX1gbmR+RGS8cXcEzzNPEn+clHWnajRMAUKmISfhPlKkjy0UmqsQm8lfJm vs74ByvVx9xLrJo2DwycvPud+otnAlUkDNtB7Jwz56uxCDCHbX4sp3It/TABL1duqaqi 6W3b1bsVjHF4Egye6Slc9VM4DLARdv8zW5crdBGAX9kE01IMZGW+CCppNmIsMSIVuNes hGjUpvvSv1jIVb8ux0nPx1JkFKmxQz4PPhJIncFJ9eBZYeaHlnAoucRhqzuAghH96+bh psYQ== 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=rKfV38E36hWTSO33q9Uxt8yFswZ1po1Ma3tV5WnQG28=; fh=R8JZsVKDlS7lXIAvTNV55bsjlDBI0i4sqiOYXO4tZQA=; b=JJpw9Atw7nCLD9dLsAcgSboUvb7Zk4TEY9L8qYVmf9vB8fibfDvP3N7AQfBlZpkWin IO4Giv69W3jxS2DRZ9HinDta/LRTDLp59R+9nirxC2Sv3n1eybiBqiVGtlFhFhsuBPtI wQM0XCxesgLrwO6+NbJB2jIY93POSG2B+k7Vajl+9cvbppD2smB/PDOrU8/2rjDF+gay G+9Y1fRElnYFRfBEHcCHRvvEBEAXax51Aq71ZVIc6efLqJoCg76DH4o0juC+gbNaBCnE hyTdUmMBAqBUB6lIW95MjQ6+rqazBj9V6KL0gfpcCSEOC8uYxoYGnO2ol3H5b7nw0Hk6 okfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p18-20020a170902e75200b001bf0b29d935si2873433plf.34.2023.12.09.14.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 14:10:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id E597580615D1; Sat, 9 Dec 2023 14:10:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbjLIWKS (ORCPT + 99 others); Sat, 9 Dec 2023 17:10:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjLIWKR (ORCPT ); Sat, 9 Dec 2023 17:10:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50DC7125 for ; Sat, 9 Dec 2023 14:10:24 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A4D4C433C7; Sat, 9 Dec 2023 22:10:23 +0000 (UTC) Date: Sat, 9 Dec 2023 17:10:58 -0500 From: Steven Rostedt To: LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers Subject: [PATCH] tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing Message-ID: <20231209171058.78c1a026@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 agentk.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 (agentk.vger.email [0.0.0.0]); Sat, 09 Dec 2023 14:10:45 -0800 (PST) From: "Steven Rostedt (Google)" If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output: ~# cat /sys/kernel/tracing/trace # tracer: nop # # entries-in-buffer/entries-written: 2/2 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | <...>-859 [001] ..... 141.118951: tracing_mark_write <...>-859 [001] ..... 141.148201: tracing_mark_write: 78901234 Instead, catch this case and add some context: ~# cat /sys/kernel/tracing/trace # tracer: nop # # entries-in-buffer/entries-written: 2/2 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | <...>-852 [001] ..... 121.550551: tracing_mark_write[LINE TOO BIG] <...>-852 [001] ..... 121.550581: tracing_mark_write: 78901234 This now emulates the same output as trace_pipe. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index fbcd3bafb93e..aa8f99f3e5de 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4722,7 +4722,11 @@ static int s_show(struct seq_file *m, void *v) iter->leftover = ret; } else { - print_trace_line(iter); + ret = print_trace_line(iter); + if (ret == TRACE_TYPE_PARTIAL_LINE) { + iter->seq.full = 0; + trace_seq_puts(&iter->seq, "[LINE TOO BIG]\n"); + } ret = trace_print_seq(m, &iter->seq); /* * If we overflow the seq_file buffer, then it will -- 2.42.0