Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp67495pxb; Wed, 13 Jan 2021 23:33:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwo2LpYm/Wy7Z+SU+za7GbaWNxNkzZtUTyKQEicrDa6G8JNiqE6Ivlx3nPJS+sUGqmTSFwm X-Received: by 2002:a05:6402:1041:: with SMTP id e1mr5055684edu.54.1610609596410; Wed, 13 Jan 2021 23:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610609596; cv=none; d=google.com; s=arc-20160816; b=gQpFteIGJMxvHmnbEEC3tQ+Vl3ZYMURIEMWgY2VOTEUZahp2HL9TxF6dbb91j9xK+O uOm4ZJwHiByWmwyDPPyDI5OY6MjYusL5a5kqrLSJp1YJLICtWt0ABt3iIsta4w0aYxvT TCIyUGB+j4dQGeUvVovj7AFCg2tj6NKKYW1U9yEOt+jLzYEzTb4F7IGR0Vr3Dsvt7J+a a9GOJ2ACLx/h587wzKd/PqlOQHSIVCrnKBM76D3sY98IG7w0j63cVfL38cCNZFOhN2tl 7yRUz0GosdLYXCMNKNcN+m5iBjXcbJ6ZTPB6w4OTUIfGJW6mvYSq4TfiS9jqWJE5Ju/5 Mxuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=4ogsMdgs8z8X28thZOcUv+bQkHwecBS4iTkDkyCIqK8=; b=Py03xU7RqTIkaAoFo7Sd0dFssFCAZzv4pxiq4QZ5fmdoTRxHdz2HWhof7BJeVS73Qu DluGZBA73w3nSc/hyUs0RGb4hcch7ywmwpyA50AuzvoHex/qidNHuY1J02MP6mMO8sEr I5jOzVS4xokl1lmXw8t7VvmDWXucWovJ8WJI2TbIr5ERae9eNRTshnA9kVt4zEFyWbF5 gQAoIlbJUALtneqxIctK3QMrMBp0qHtD4sRFHNhPhheGC6TV5FIYXpfO78SUIFp/a5jh uXTM0P8w98heCvCnjtvAJEJQD9QqjIddk0O0GM85coTctNMQLNzCoyoqDemlLukZ4EBu x5bA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s17si1761695edi.568.2021.01.13.23.32.52; Wed, 13 Jan 2021 23:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727250AbhANHax (ORCPT + 99 others); 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.