Skip to content

Commit 3705b97

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-urgent-for-mingo-20161222' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: Fixes for 'perf sched timehist': (Namhyung Kim) - Define a larger initial alignment value for the COMM column and make it be more consistently honoured, for instance in the header. - Fix invalid period calculation when using the --time option to select a time slice, when events outside that slice were being considered for the per cpu idle stats summary. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 1134c2b + bdd7572 commit 3705b97

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tools/perf/builtin-sched.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ static u64 perf_evsel__get_time(struct perf_evsel *evsel, u32 cpu)
17751775
return r->last_time[cpu];
17761776
}
17771777

1778-
static int comm_width = 20;
1778+
static int comm_width = 30;
17791779

17801780
static char *timehist_get_commstr(struct thread *thread)
17811781
{
@@ -1817,7 +1817,7 @@ static void timehist_header(struct perf_sched *sched)
18171817
printf(" ");
18181818
}
18191819

1820-
printf(" %-20s %9s %9s %9s",
1820+
printf(" %-*s %9s %9s %9s", comm_width,
18211821
"task name", "wait time", "sch delay", "run time");
18221822

18231823
printf("\n");
@@ -1830,7 +1830,8 @@ static void timehist_header(struct perf_sched *sched)
18301830
if (sched->show_cpu_visual)
18311831
printf(" %*s ", ncpus, "");
18321832

1833-
printf(" %-20s %9s %9s %9s\n", "[tid/pid]", "(msec)", "(msec)", "(msec)");
1833+
printf(" %-*s %9s %9s %9s\n", comm_width,
1834+
"[tid/pid]", "(msec)", "(msec)", "(msec)");
18341835

18351836
/*
18361837
* separator
@@ -1840,7 +1841,7 @@ static void timehist_header(struct perf_sched *sched)
18401841
if (sched->show_cpu_visual)
18411842
printf(" %.*s ", ncpus, graph_dotted_line);
18421843

1843-
printf(" %.20s %.9s %.9s %.9s",
1844+
printf(" %.*s %.9s %.9s %.9s", comm_width,
18441845
graph_dotted_line, graph_dotted_line, graph_dotted_line,
18451846
graph_dotted_line);
18461847

@@ -2404,7 +2405,7 @@ static int timehist_sched_change_event(struct perf_tool *tool,
24042405
if (ptime->start && ptime->start > t)
24052406
goto out;
24062407

2407-
if (ptime->start > tprev)
2408+
if (tprev && ptime->start > tprev)
24082409
tprev = ptime->start;
24092410

24102411
/*
@@ -2626,9 +2627,6 @@ static void timehist_print_summary(struct perf_sched *sched,
26262627

26272628
memset(&totals, 0, sizeof(totals));
26282629

2629-
if (comm_width < 30)
2630-
comm_width = 30;
2631-
26322630
if (sched->idle_hist) {
26332631
printf("\nIdle-time summary\n");
26342632
printf("%*s parent sched-out ", comm_width, "comm");

0 commit comments

Comments
 (0)