From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6719C43381 for ; Tue, 19 Mar 2019 16:39:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FF2E206B7 for ; Tue, 19 Mar 2019 16:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727604AbfCSQj2 (ORCPT ); Tue, 19 Mar 2019 12:39:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:56662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfCSQj1 (ORCPT ); Tue, 19 Mar 2019 12:39:27 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E3FF205F4; Tue, 19 Mar 2019 16:39:26 +0000 (UTC) Date: Tue, 19 Mar 2019 12:39:25 -0400 From: Steven Rostedt To: Al Viro Cc: Rasmus Villemoes , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2/resend] tracing: eliminate const char[] auto variables Message-ID: <20190319123925.30fbbe9c@gandalf.local.home> In-Reply-To: <20190318215356.GJ2217@ZenIV.linux.org.uk> References: <20181102205442.7758-1-linux@rasmusvillemoes.dk> <20190318213427.22108-1-linux@rasmusvillemoes.dk> <20190318215356.GJ2217@ZenIV.linux.org.uk> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Mar 2019 21:53:57 +0000 Al Viro wrote: > On Mon, Mar 18, 2019 at 10:34:27PM +0100, Rasmus Villemoes wrote: > > > I didn't get any response to this; just let me know if you don't want > > this kind of microoptimization patches. It got lost in my inbox, which should happen less, now that I got patchwork running on it ;-) > > Umm... What's wrong with "%*s", width, "" instead of those games? > As in > { > bool tgid = flags & TRACE_ITER_RECORD_TGID; > int width = tgid ? 10 : 2; > > print_event_info(buf, m); > > seq_printf(m, "# %*s _-----=> irqs-off\n", > width, ""); > seq_printf(m, "# %*s / _----=> need-resched\n", > width, ""); > seq_printf(m, "# %*s| / _---=> hardirq/softirq\n", > width, ""); > seq_printf(m, "# %*s|| / _--=> preempt-depth\n", > width, ""); > seq_printf(m, "# %*s||| / delay\n", > width, ""); > seq_printf(m, "# TASK-PID %*sCPU# |||| TIMESTAMP FUNCTION\n", > width, tgid ? "TGID " : ""); > seq_printf(m, "# | | %*s | |||| | |\n", > width, ""); > } > and bugger those constants... That's a possibility. > > PS: it's very tempting to add some warlording to that piece of... ASCII art Yeah, this code all came from the original "latency-tracer" that was in the PREEMPT_RT patch set, and had some historical crud attached. I'm fine with switching it to use the *s notation. Rasmus, want to send another patch? I have no issues with your other changes. -- Steve