Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp299981iog; Mon, 13 Jun 2022 03:02:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxATt3nCbwfhBW6lMvFK6RUOJ5jdVzXNWZL4FYnHZvtAugfC+GZZBzCryEMok9+YtgecXmu X-Received: by 2002:a17:906:530b:b0:718:c256:3933 with SMTP id h11-20020a170906530b00b00718c2563933mr2848340ejo.142.1655114563603; Mon, 13 Jun 2022 03:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655114563; cv=none; d=google.com; s=arc-20160816; b=pbzQ9uKhRBjtwjcmCcQ23guRsz6P7Df6Sojh4OXDpMtPcBX0NmbO/bz+aWMRnFCIf3 M3gnfsycQxGPqaDk6scNSR8Cx3hEfEIbnv5pdH3Qd/c7DZKFz3DKwNj7ghw3JfkMWsCs efodTm250InzeEPKVsMDD05YCZ1GtBXKJNP6qwZMPRfgEy2UMBfkV5BRciaK/anZv7Xh NC13d6KU/H0hRPyZ6pnj9vfJWI7kfOIqzkJrwyH72uWN656SILqqVdRu9Knh/oUK1Drh vytnuUb0G2NebcF37rXebbEdoY+PQdX+jRhamtSnlGVDnbe98midPveLZrDzHloGL99i VCBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=inaZh7D9usUvSOwxrFZEknOsqwWQSf8raItyVYnWLNc=; b=dXpmtQI0EyS+sqgMo0Pd/7Jch/EVYfj+6uIL+1LB33RXt5x/i8NB1ijZUmMWxcjofk Sbl/9d1NZ9/WV8lqeRmqS8LIIA5xoNL5ntE9EZSJrJTg6IWOcLF4HsFnFy/KmoXOdvsP gkApQUppvGZZCM/qwJGUXIQcRbTOd+Qr+atD+DmiiIAYDnnFarpKfJyuUrphOrqT70tI 1BrHYe+6xVCPcLmxDEhcW7wogQCCisyoj1WR5Pw2u7T6jhAp9WM3Ux0DSEiX1EJGIWQr MHX6Cbq6ATLEAHUf3+9l14S5nnE4qpl2DwVDHqkRZG+BE1X+L94CEfRvtpBP+t1nqG2h cqHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js15-20020a17090797cf00b00718cc6cd47csi1342209ejc.3.2022.06.13.03.02.18; Mon, 13 Jun 2022 03:02:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241208AbiFMJtl (ORCPT + 99 others); Mon, 13 Jun 2022 05:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241095AbiFMJs1 (ORCPT ); Mon, 13 Jun 2022 05:48:27 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA5418B2E; Mon, 13 Jun 2022 02:48:24 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LM6Cz09KxzjXf5; Mon, 13 Jun 2022 17:46:55 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 17:48:04 +0800 Received: from ubuntu1804.huawei.com (10.67.174.61) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 17:48:03 +0800 From: Yang Jihong To: , , , , , , , , CC: Subject: [RFC 02/13] perf kwork: Add irq record support Date: Mon, 13 Jun 2022 17:45:54 +0800 Message-ID: <20220613094605.208401-3-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT In-Reply-To: <20220613094605.208401-1-yangjihong1@huawei.com> References: <20220613094605.208401-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.61] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Record interrupt events irq:irq_handler_entry & irq_handler_exit: Record irq events: # perf kwork record -o perf_kwork.date -- sleep 1 [ perf record: Woken up 0 times to write data ] [ perf record: Captured and wrote 0.524 MB perf_kwork.date ] # perf evlist -i perf_kwork.date irq:irq_handler_entry irq:irq_handler_exit dummy:HG Signed-off-by: Yang Jihong --- tools/perf/builtin-kwork.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c index b89e41fcc568..822904b2597e 100644 --- a/tools/perf/builtin-kwork.c +++ b/tools/perf/builtin-kwork.c @@ -25,6 +25,7 @@ #include enum kwork_class_type { + KWORK_CLASS_IRQ, KWORK_CLASS_MAX, }; @@ -68,7 +69,19 @@ struct perf_kwork { const char *sort_order; }; +const struct evsel_str_handler irq_tp_handlers[] = { + { "irq:irq_handler_entry", NULL, }, + { "irq:irq_handler_exit", NULL, }, +}; + +static struct kwork_class kwork_irq = { + .name = "irq", + .nr_tracepoints = 2, + .tp_handlers = irq_tp_handlers, +}; + static struct kwork_class *kwork_class_supported_list[KWORK_CLASS_MAX] = { + [KWORK_CLASS_IRQ] = &kwork_irq, }; static void setup_event_list(struct perf_kwork *kwork, -- 2.30.GIT