Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6168353 authored by Michael Ellerman's avatar Michael Ellerman Committed by Ingo Molnar
Browse files

ftrace: make output nicely spaced for up to 999 cpus



Currently some of the ftrace output goes skewiff if you have more
than 9 cpus, and some if you have more than 99.

Twiddle with the headers and format strings to make up to 999 cpus
display without causing spacing problems.

Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarSteven Rostedt <srostedt@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2ff01c6a
Loading
Loading
Loading
Loading
+14 −14
Original line number Original line Diff line number Diff line
@@ -1508,7 +1508,7 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
	comm = trace_find_cmdline(field->pid);
	comm = trace_find_cmdline(field->pid);


	trace_seq_printf(s, "%8.8s-%-5d ", comm, field->pid);
	trace_seq_printf(s, "%8.8s-%-5d ", comm, field->pid);
	trace_seq_printf(s, "%d", cpu);
	trace_seq_printf(s, "%3d", cpu);
	trace_seq_printf(s, "%c%c",
	trace_seq_printf(s, "%c%c",
			(field->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : '.',
			(field->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : '.',
			((field->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.'));
			((field->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.'));
@@ -1598,7 +1598,7 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu)


	if (verbose) {
	if (verbose) {
		comm = trace_find_cmdline(field->pid);
		comm = trace_find_cmdline(field->pid);
		trace_seq_printf(s, "%16s %5d %d %d %08x %08x [%08lx]"
		trace_seq_printf(s, "%16s %5d %3d %d %08x %08x [%08lx]"
				 " %ld.%03ldms (+%ld.%03ldms): ",
				 " %ld.%03ldms (+%ld.%03ldms): ",
				 comm,
				 comm,
				 field->pid, cpu, field->flags,
				 field->pid, cpu, field->flags,
@@ -1694,7 +1694,7 @@ static int print_trace_fmt(struct trace_iterator *iter)
	ret = trace_seq_printf(s, "%16s-%-5d ", comm, field->pid);
	ret = trace_seq_printf(s, "%16s-%-5d ", comm, field->pid);
	if (!ret)
	if (!ret)
		return 0;
		return 0;
	ret = trace_seq_printf(s, "[%02d] ", iter->cpu);
	ret = trace_seq_printf(s, "[%03d] ", iter->cpu);
	if (!ret)
	if (!ret)
		return 0;
		return 0;
	ret = trace_seq_printf(s, "%5lu.%06lu: ", secs, usec_rem);
	ret = trace_seq_printf(s, "%5lu.%06lu: ", secs, usec_rem);