From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753227AbcKPHww (ORCPT ); Wed, 16 Nov 2016 02:52:52 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34690 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752784AbcKPHwu (ORCPT ); Wed, 16 Nov 2016 02:52:50 -0500 Date: Wed, 16 Nov 2016 08:52:45 +0100 From: Ingo Molnar To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , David Ahern , Peter Zijlstra , Jiri Olsa , LKML , Stephane Eranian , Andi Kleen Subject: Re: [PATCHSET 0/7] perf sched: Introduce timehist command, again (v2) Message-ID: <20161116075245.GA1270@gmail.com> References: <20161116060634.28477-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161116060634.28477-1-namhyung@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Namhyung Kim wrote: > Hello, > > This patchset is a rebased version of David's sched timehist work [1]. > I plan to improve perf sched command more and think that having > timehist command before the work looks good. It seems David is busy > these days, so I'm retrying it by myself. > > * changes in v2) > - change name 'b/n time' to 'wait time' (Ingo) > - show arrow between functions in the callchain (Ingo) > - fix a bug in calculating initial run time > > This implements only basic feature and a few options. I just split > the patch to make it easier to review and did some cosmetic changes. > More patches will come later. > > The below is from the David's original description (w/ slight change): > > ------------------------8<------------------------- > 'perf sched timehist' provides an analysis of scheduling events. > > Example usage: > perf sched record -- sleep 1 > perf sched timehist > > By default it shows the individual schedule events, including the time between > sched-in events for the task, the task scheduling delay (time between wakeup > and actually running) and run time for the task: > > time cpu task name[tid/pid] wait time sch delay run time > ------------- ---- -------------------- --------- --------- --------- > 79371.874569 [11] gcc[31949] 0.014 0.000 1.148 > 79371.874591 [10] gcc[31951] 0.000 0.000 0.024 > 79371.874603 [10] migration/10[59] 3.350 0.004 0.011 > 79371.874604 [11] 1.148 0.000 0.035 > 79371.874723 [05] 0.016 0.000 1.383 > 79371.874746 [05] gcc[31949] 0.153 0.078 0.022 > ... > > Times are in msec.usec. > > If callchains were recorded they are appended to the line with a default stack depth of 5: > > 79371.874569 [11] gcc[31949] 0.014 0.000 1.148 wait_for_completion_killable <- do_fork <- sys_vfork <- stub_vfork <- __vfork > 79371.874591 [10] gcc[31951] 0.000 0.000 0.024 __cond_resched <- _cond_resched <- wait_for_completion <- stop_one_cpu <- sched_exec > 79371.874603 [10] migration/10[59] 3.350 0.004 0.011 smpboot_thread_fn <- kthread <- ret_from_fork > 79371.874604 [11] 1.148 0.000 0.035 cpu_startup_entry <- start_secondary > 79371.874723 [05] 0.016 0.000 1.383 cpu_startup_entry <- start_secondary > 79371.874746 [05] gcc[31949] 0.153 0.078 0.022 do_wait sys_wait4 <- system_call_fastpath <- __GI___waitpid > > --no-call-graph can be used to not show the callchains. --max-stack is used > to control the number of frames shown (default of 5). -x/--excl options can > be used to collapse redundant callchains to get more relevant data on screen. > > Similar to perf-trace -s and -S can be used to dump a statistical summary > without or with events (respectively). Statistics include min run time, > average run time and max run time. Stats are also shown for run time by > cpu. > > The cpu-visual option provides a visual aid for sched switches by cpu: > ... > 79371.874569 [11] s gcc[31949] 0.014 0.000 1.148 > 79371.874591 [10] s gcc[31951] 0.000 0.000 0.024 > 79371.874603 [10] s migration/10[59] 3.350 0.004 0.011 > 79371.874604 [11] i 1.148 0.000 0.035 > 79371.874723 [05] i 0.016 0.000 1.383 > 79371.874746 [05] s gcc[31949] 0.153 0.078 0.022 > ... Looks great to me! Acked-by: Ingo Molnar Thanks, Ingo