lkml.org 
[lkml]   [2019]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2/resend] tracing: eliminate const char[] auto variables
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.

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...

PS: it's very tempting to add some warlording to that piece of... ASCII art

\
 
 \ /
  Last update: 2019-03-18 22:54    [W:0.099 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site