Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755020AbbEFEK2 (ORCPT ); Wed, 6 May 2015 00:10:28 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:8022 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750903AbbEFEK1 (ORCPT ); Wed, 6 May 2015 00:10:27 -0400 Message-ID: <5549941C.6040901@huawei.com> Date: Wed, 6 May 2015 12:10:04 +0800 From: Yunlong Song User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: David Ahern , , , , Arnaldo Carvalho de Melo CC: , 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> In-Reply-To: <553BB895.20800@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.74.205] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.55499431.0052,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 74c813c4f1ec380f59569ad0e845b2e4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2109 Lines: 56 On 2015/4/25 23:53, David Ahern wrote: > On 4/25/15 8:05 AM, Yunlong Song wrote: >> On 2015/4/24 21:58, David Ahern wrote: >>> On 4/24/15 7:31 AM, Yunlong Song wrote: >>>> Now we are profiling the performance of ext4 and f2fs on an eMMC card with iozone, >>>> we find a case that ext4 is better than f2fs in random write under the test of >>>> "iozone -s 262144 -r 64 -i 0 -i 2". We want to analyze the I/O delay of the two >>>> file systems. We have got a conclusion that 1% of sys_write takes up 60% time of >>>> the overall sys_write (262144/64=4096). We want to find out the call stack during >>>> this specific 1% sys_write. Our idea is to record the stack in a certain time period >>>> and since the specific 1% case takes up 60% time, the total number of records of its >>>> stack should also takes up 60% of the total records, then we can recognize those stacks >>>> and figure out what the I/O stack of f2fs is doing in the 1% case. >>> >>> And to address this specific profiling problem have you tried: >>> >>> perf trace record -- iozone ... >>> perf trace -i perf.data -S >>> >>> >>> >>> >> >> But this only shows the system call like strace, but we want the call stack of kernel functions >> in fact. >> > > We haven't added the callchain option yet; on the to-do list. > > perf trace record -g -- iozone ... > perf trace -i perf.data -s > --> summary of system calls, max/min/average times > > perf trace -i perf.data --duration 10.0 -T > --> note the timestamp where the write took a "long" time > > perf script > --> search down to *around* the time of interest; you want the syscall entry; timestamp is for exit > > . > Hi, David, It's almost what we want, we are eager to see it can work as a callchain option, since it's really a useful tool in analyzing latency of I/O performance in production case. -- Thanks, Yunlong Song -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/