From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757739AbbEEWY6 (ORCPT ); Tue, 5 May 2015 18:24:58 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:37668 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753304AbbEEWYz (ORCPT ); Tue, 5 May 2015 18:24:55 -0400 Message-ID: <55494336.4060709@gmail.com> Date: Tue, 05 May 2015 16:24:54 -0600 From: David Ahern User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Rabin Vincent , Yunlong Song CC: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com, Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, wangnan0@huawei.com Subject: Re: [Question] How does perf still record the stack of a specified pid even when that process is interrupted and CPU is scheduled to other process References: <553A45CA.8020808@huawei.com> <553A4C18.3030609@gmail.com> <553B9F30.1040100@huawei.com> <553BB895.20800@gmail.com> <20150505215328.GA3397@debian> In-Reply-To: <20150505215328.GA3397@debian> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/5/15 3:53 PM, Rabin Vincent wrote: > The commands above will identify the sys_write which takes time but only > provide the stacktrace at the entry and exit of the syscall, but this do > not show why the process blocked or what it did inside the system call. > > So a way to get what is required for the use case would be to make the > following changes to the above sequence: > > (1) include the sched:* events when perf trace record is run > > (2) around the time of interest, look at the kernel stack st the sched:switch > events between the entry and the exit. This will show what the process was > waiting for when it when it blocked. The stacktraces at the > stat_runtime events in the process may also be useful to understand what > was going on. agreed.