aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-12-23 14:23:29 -0500
committerIngo Molnar <mingo@kernel.org>2016-12-23 14:23:29 -0500
commit3705b97505bcbf6440f38119c0e7d6058f585b54 (patch)
treeb8d201504f40df5cbd22e4727e59a03b650e2546
parent1134c2b5cb840409ffd966d8c2a9468f64e6a494 (diff)
parentbdd75729e5d279d734e8d3fb41ef4818ac1598ab (diff)
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>
-rw-r--r--tools/perf/builtin-sched.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index c1c07bfe132c..d53e706a6f17 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1775,7 +1775,7 @@ static u64 perf_evsel__get_time(struct perf_evsel *evsel, u32 cpu)
1775 return r->last_time[cpu]; 1775 return r->last_time[cpu];
1776} 1776}
1777 1777
1778static int comm_width = 20; 1778static int comm_width = 30;
1779 1779
1780static char *timehist_get_commstr(struct thread *thread) 1780static char *timehist_get_commstr(struct thread *thread)
1781{ 1781{
@@ -1817,7 +1817,7 @@ static void timehist_header(struct perf_sched *sched)
1817 printf(" "); 1817 printf(" ");
1818 } 1818 }
1819 1819
1820 printf(" %-20s %9s %9s %9s", 1820 printf(" %-*s %9s %9s %9s", comm_width,
1821 "task name", "wait time", "sch delay", "run time"); 1821 "task name", "wait time", "sch delay", "run time");
1822 1822
1823 printf("\n"); 1823 printf("\n");
@@ -1830,7 +1830,8 @@ static void timehist_header(struct perf_sched *sched)
1830 if (sched->show_cpu_visual) 1830 if (sched->show_cpu_visual)
1831 printf(" %*s ", ncpus, ""); 1831 printf(" %*s ", ncpus, "");
1832 1832
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)");
1834 1835
1835 /* 1836 /*
1836 * separator 1837 * separator
@@ -1840,7 +1841,7 @@ static void timehist_header(struct perf_sched *sched)
1840 if (sched->show_cpu_visual) 1841 if (sched->show_cpu_visual)
1841 printf(" %.*s ", ncpus, graph_dotted_line); 1842 printf(" %.*s ", ncpus, graph_dotted_line);
1842 1843
1843 printf(" %.20s %.9s %.9s %.9s", 1844 printf(" %.*s %.9s %.9s %.9s", comm_width,
1844 graph_dotted_line, graph_dotted_line, graph_dotted_line, 1845 graph_dotted_line, graph_dotted_line, graph_dotted_line,
1845 graph_dotted_line); 1846 graph_dotted_line);
1846 1847
@@ -2404,7 +2405,7 @@ static int timehist_sched_change_event(struct perf_tool *tool,
2404 if (ptime->start && ptime->start > t) 2405 if (ptime->start && ptime->start > t)
2405 goto out; 2406 goto out;
2406 2407
2407 if (ptime->start > tprev) 2408 if (tprev && ptime->start > tprev)
2408 tprev = ptime->start; 2409 tprev = ptime->start;
2409 2410
2410 /* 2411 /*
@@ -2626,9 +2627,6 @@ static void timehist_print_summary(struct perf_sched *sched,
2626 2627
2627 memset(&totals, 0, sizeof(totals)); 2628 memset(&totals, 0, sizeof(totals));
2628 2629
2629 if (comm_width < 30)
2630 comm_width = 30;
2631
2632 if (sched->idle_hist) { 2630 if (sched->idle_hist) {
2633 printf("\nIdle-time summary\n"); 2631 printf("\nIdle-time summary\n");
2634 printf("%*s parent sched-out ", comm_width, "comm"); 2632 printf("%*s parent sched-out ", comm_width, "comm");