From: Steven Rostedt <rostedt@goodmis.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2/resend] tracing: eliminate const char[] auto variables
Date: Tue, 19 Mar 2019 12:39:25 -0400 [thread overview]
Message-ID: <20190319123925.30fbbe9c@gandalf.local.home> (raw)
In-Reply-To: <20190318215356.GJ2217@ZenIV.linux.org.uk>
On Mon, 18 Mar 2019 21:53:57 +0000
Al Viro <viro@zeniv.linux.org.uk> 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
next prev parent reply other threads:[~2019-03-19 16:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 20:54 [PATCH] tracing: eliminate const char[] auto variables Rasmus Villemoes
2019-03-18 21:34 ` [PATCH v2/resend] " Rasmus Villemoes
2019-03-18 21:53 ` Al Viro
2019-03-19 16:39 ` Steven Rostedt [this message]
2019-03-20 8:17 ` [PATCH v3] " Rasmus Villemoes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190319123925.30fbbe9c@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mingo@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).