Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1113361imw; Fri, 8 Jul 2022 19:29:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vHmFquymqsooI92FXx7Zp2k9XKdtnyz/2xyIFEAz+e3avmN3E1DpWH0Lglgmguv1mBA2Yb X-Received: by 2002:a05:6402:280b:b0:437:9efc:a065 with SMTP id h11-20020a056402280b00b004379efca065mr8686354ede.3.1657333764970; Fri, 08 Jul 2022 19:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657333764; cv=none; d=google.com; s=arc-20160816; b=SZGQIeQvwKbUud9RE/Gn0ORjQRA1AyyDEnhPZ8NkXw69FUibQYR8UkLVD1sRLr5+7g vNQmiTzJ3kCTGGC+Sg7Yci8w3PGfJocu+tb9rNLm0e0KbTfmChkvnDPCB+WfNnxpfXMP lcJ8ifUBOkgl1EnAXmwz8gD4z4XFmQIhxHKy6IcSstpqtVdkaHqSeutliTg+TLZp8X5n cWQ6I+bzq7SoPzFKR5FhnPC8iZjLGitLdcN3VypJi1EYkJQ/fNRhFAmTI+MUTEOUyFQf 7zJfEYBm+snYjb8Ntvp/IfEiSbuXALPA63EBJ/CTqrJfRfFLpbGwpnku0p0Rf3qBmd9w 4FLg== 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=9LyyhVTKUdMz7tU+Jo+X0A/iB44k7vuNcXgqsMHITE8=; b=L+SoXkA4Cxv3Y8SFyxmhx4ocMT1eRJ7GuEiqlMuq7vT+qa57q7IUisc23wU2zAaveZ fumRHRXxFgNZkBWDC9RLUTbEDFuMgqZfN3YemoeiyEw9zC9UNOtnLria3T3FYCIiu+tF nOlWN2NiUMVjjc08Tx/8GzgGAefR85GkPutpyC/PwBurQfjB5M07r3+O/KgZD4bTNrWO C9/XAWAW8O/eGBmxoXB77Ib5w1G3PVO1fU66xbX30foq9zEXvFAUuoGelnMjsJKpnggU 2QxL4z1LvI+jw3TQLNhVxwfSbaeOnmkLk0GqnfkNc+LBkaLLoOtfyNc2eohvfVmKg7bb 2LEg== 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 e16-20020a056402191000b0043a50590dabsi717745edz.87.2022.07.08.19.28.55; Fri, 08 Jul 2022 19:29:24 -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 S229562AbiGIBxF (ORCPT + 99 others); Fri, 8 Jul 2022 21:53:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiGIBxC (ORCPT ); Fri, 8 Jul 2022 21:53:02 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED77E71721; Fri, 8 Jul 2022 18:53:00 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LftRN5C2tzlW0C; Sat, 9 Jul 2022 09:51:28 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 9 Jul 2022 09:52:58 +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; Sat, 9 Jul 2022 09:52:58 +0800 From: Yang Jihong To: , , , , , , , , , CC: Subject: [RFC v3 02/17] perf kwork: Add irq kwork record support Date: Sat, 9 Jul 2022 09:50:18 +0800 Message-ID: <20220709015033.38326-3-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT In-Reply-To: <20220709015033.38326-1-yangjihong1@huawei.com> References: <20220709015033.38326-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: dggems702-chm.china.huawei.com (10.3.19.179) 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 Test cases: # perf kwork record -o perf_kwork.date -- sleep 1 [ perf record: Woken up 0 times to write data ] [ perf record: Captured and wrote 0.556 MB perf_kwork.date ] # # perf evlist -i perf_kwork.date irq:irq_handler_entry irq:irq_handler_exit dummy:HG # Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events # Signed-off-by: Yang Jihong --- tools/perf/Documentation/perf-kwork.txt | 2 +- tools/perf/builtin-kwork.c | 15 ++++++++++++++- tools/perf/util/kwork.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/perf/Documentation/perf-kwork.txt b/tools/perf/Documentation/perf-kwork.txt index dc1e36da57bb..57bd5fa7d5c9 100644 --- a/tools/perf/Documentation/perf-kwork.txt +++ b/tools/perf/Documentation/perf-kwork.txt @@ -32,7 +32,7 @@ OPTIONS -k:: --kwork:: - List of kwork to profile + List of kwork to profile (irq, etc) -v:: --verbose:: diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c index f3552c56ede3..a26b7fde1e38 100644 --- a/tools/perf/builtin-kwork.c +++ b/tools/perf/builtin-kwork.c @@ -25,7 +25,20 @@ #include #include +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", + .type = KWORK_CLASS_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, @@ -132,7 +145,7 @@ int cmd_kwork(int argc, const char **argv) OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, "dump raw trace in ASCII"), OPT_STRING('k', "kwork", &kwork.event_list_str, "kwork", - "list of kwork to profile"), + "list of kwork to profile (irq, etc)"), OPT_BOOLEAN('f', "force", &kwork.force, "don't complain, do it"), OPT_END() }; diff --git a/tools/perf/util/kwork.h b/tools/perf/util/kwork.h index 6950636aab2a..f1d89cb058fc 100644 --- a/tools/perf/util/kwork.h +++ b/tools/perf/util/kwork.h @@ -13,6 +13,7 @@ #include enum kwork_class_type { + KWORK_CLASS_IRQ, KWORK_CLASS_MAX, }; -- 2.30.GIT