From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52E18C433E6 for ; Thu, 14 Jan 2021 07:31:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAED6239CF for ; Thu, 14 Jan 2021 07:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727285AbhANHax (ORCPT ); Thu, 14 Jan 2021 02:30:53 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:11382 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727237AbhANHau (ORCPT ); Thu, 14 Jan 2021 02:30:50 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DGbXf5ZtBz7VFW; Thu, 14 Jan 2021 15:29:06 +0800 (CST) Received: from [10.174.178.140] (10.174.178.140) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Thu, 14 Jan 2021 15:30:00 +0800 Subject: Re: [PATCH 1/2] perf tools: add 'perf irq' to measure the hardware interrupts To: Alexei Budankov , , , , , , , , CC: References: <20210112125558.72989-1-cuibixuan@huawei.com> <20210112125558.72989-2-cuibixuan@huawei.com> <03316fe6-f59b-9911-67e0-2841bb79cac7@huawei.com> From: Bixuan Cui Message-ID: <79790803-8f2e-7fca-d9d9-9c45363ab96c@huawei.com> Date: Thu, 14 Jan 2021 15:29:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <03316fe6-f59b-9911-67e0-2841bb79cac7@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.140] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/1/13 3:50, Alexei Budankov wrote: > Hi Bixuan, > > On 12.01.2021 15:55, Bixuan Cui wrote: >> Add 'perf irq' to trace/measure the hardware interrupts. >> >> Now three functions are provided: >> 1. 'perf irq record ' to record the irq handler events. >> 2. 'perf irq script' to see a detailed trace of the workload that >> was recorded. >> 3. 'perf irq timeconsume' to calculate the time consumed by each >> hardware interrupt processing function. >> >> Signed-off-by: Bixuan Cui > Thanks for the patches. There is still something that could be improved. > >> --- >> tools/perf/Build | 1 + >> tools/perf/builtin-irq.c | 288 +++++++++++++++++++++++++++++++++++++++ >> tools/perf/builtin.h | 1 + >> tools/perf/perf.c | 1 + >> 4 files changed, 291 insertions(+) >> create mode 100644 tools/perf/builtin-irq.c >> > > >> + >> +static int __cmd_record(int argc, const char **argv) >> +{ >> + unsigned int rec_argc, i, j; >> + const char **rec_argv; >> + const char * const record_args[] = { >> + "record", >> + "-a", > I see it works also like this: > > sudo perf record -p PID -c 1 -e irq:irq_handler_entry,irq:irq_handler_exit > sudo perf record -R -c 1 -e irq:irq_handler_entry,irq:irq_handler_exit -- find / > > This -a option jointly with -p option could be made configurable from > the command line for perf irq mode. That's true. We can add a series of commands for 'perf irq',such as record, script and report. So I kept the 'perf irq record'. > >> + "-R", >> + "-m", "1024", > Do you see data losses with default buffer size of 512KB > when capturing trace in your specific use case? > > If not then this -m could be avoided or made configurable > if you still need it. Thank you for your advice, I will delete it.