Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4833692iob; Mon, 9 May 2022 02:44:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6351hZL+wOxN7zL6Wzx61r4ZRb1o7DiwLZTlxGYKCtVPdTcqYUG9IVHkN4mv14KNgRps6 X-Received: by 2002:a17:902:8608:b0:158:b827:7721 with SMTP id f8-20020a170902860800b00158b8277721mr15216166plo.149.1652089467974; Mon, 09 May 2022 02:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652089467; cv=none; d=google.com; s=arc-20160816; b=puY/gRli5pu8//SUY1Dfmo75BwTpApjJXqyfghCyamgSxmCtgAOsE8Iqxkqbtg8gNV v1Hsd+vq7pkSkYLUD8A0c4G2qBdY1iurkSOpHpGvkkLHsfX0xZznxBzyhlO79+Qd5T7Q SBI11SU4RphPh1bQvqDow3ittOuDApIzAxZLnA2LrCXr1U0iNJC7WLbfpGjyKh61SW7/ f6KnIlh8JU+uOnv9KUjL7CnSDPlLVlZLg0j8JWhcvZu5EaA+HN3lpgt/nC8u/6220MDz LTm8B+zsMeN4BlAD/wK6o/1fJccCdQWUHItJp7O567WJrXVg5g1+RgjTYroNuDcjSXhF lQHg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=9xhe1TpWpUHgTAUGhKM8bXnmGiRbvfK7a5SuRwyL/l0=; b=ukBkB8x4apv6XKUx6uwbtTedelzSt/XOzvkfA12kU0GWJjh6tbaq4RSXi/ryof5E0f I7ptOv2kF1yTeVCroLA2qC5i2YhtMjHGEBv5pFcrvF/A7u7VwpPecWpqaAMth8zw82WV 3ZsWZdJ3nihLO3aHg1Y8x4rXk1Flrjc2uXre4zOyHt8po8Noy1OzV+FMqOhz4e/XDe7y O+du4PKNwDFS+35/hEy88C4lUMsKRNuTlUsMcC2Hqqy10QLRqJ5A6njg5SjH3oxvll60 Zm3vt4lrVscP1vhD6szqn8+gRpz01Gnqvn3qIK/y4/iv95pkB0sDZpNKQZJmBBwfLjFU KVag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="kE+CE//E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p3-20020a170903248300b0015c75cb2ac4si10704389plw.451.2022.05.09.02.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:44:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="kE+CE//E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 52BF321F1FE; Mon, 9 May 2022 02:28:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235169AbiEHQM2 (ORCPT + 99 others); Sun, 8 May 2022 12:12:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235083AbiEHQMW (ORCPT ); Sun, 8 May 2022 12:12:22 -0400 Received: from m12-11.163.com (m12-11.163.com [220.181.12.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B0B7A264D for ; Sun, 8 May 2022 09:08:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=9xhe1 TpWpUHgTAUGhKM8bXnmGiRbvfK7a5SuRwyL/l0=; b=kE+CE//EPbRPkrujhHKJl ObOczwB2hAkBbOnxTyzvFlORQYbPjwvHqH/LPNynuU09OGSqWnjcUteoPmlDotMv ezdNABB2g1pOEHjbXM0Rm9avF6Tk5TipJjAsa+MatbEzGb9Rc46mz75QAFF7piaS JtePeVGHrHILARgNNX8AbA= Received: from localhost (unknown [113.89.246.196]) by smtp7 (Coremail) with SMTP id C8CowAA3GrCI6ndiKd0cBg--.17208S2; Mon, 09 May 2022 00:06:33 +0800 (CST) From: Junwen Wu To: rostedt@goodmis.org, mingo@redhat.com, tglx@linutronix.de, frederic@kernel.org, tannerlove@google.com, wudaemon@163.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH v1] softirq: Add tracepoint for tasklet_entry/exit Date: Sun, 8 May 2022 16:06:24 +0000 Message-Id: <20220508160624.48643-1-wudaemon@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: C8CowAA3GrCI6ndiKd0cBg--.17208S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zw4kJr1xXFyxJw43Gw17Wrg_yoW8AFy3pa 4qkFya9rWrJr429r4fA3WUAF15Zwn3CF9rGrs7G3W3Ar4xXr1ktwsFqF1qyayktr409r9F 9FnIqrW3Cw1kua7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zM5l19UUUUU= X-Originating-IP: [113.89.246.196] X-CM-SenderInfo: 5zxgtvxprqqiywtou0bp/xtbBxwn6bWB0HLyHFwAAs9 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Usually softirq handler is pre-defined,only tasklet can be register by driver.We expand tracepoint for tasklet_entry/exit to trace tasklet handler. Signed-off-by: Junwen Wu --- include/trace/events/irq.h | 32 ++++++++++++++++++++++++++++++++ kernel/softirq.c | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h index eeceafaaea4c..d3e922dcd475 100644 --- a/include/trace/events/irq.h +++ b/include/trace/events/irq.h @@ -160,6 +160,38 @@ DEFINE_EVENT(softirq, softirq_raise, TP_ARGS(vec_nr) ); +TRACE_EVENT(tasklet_entry, + + TP_PROTO(void *func), + + TP_ARGS(func), + + TP_STRUCT__entry( + __field( void *, func ) + ), + + TP_fast_assign( + __entry->func = func; + ), + + TP_printk("function=%ps", __entry->func) +); +TRACE_EVENT(tasklet_exit, + + TP_PROTO(void *func), + + TP_ARGS(func), + + TP_STRUCT__entry( + __field( void *, func ) + ), + + TP_fast_assign( + __entry->func = func; + ), + + TP_printk("function=%ps", __entry->func) +); #endif /* _TRACE_IRQ_H */ /* This part must be outside protection */ diff --git a/kernel/softirq.c b/kernel/softirq.c index 41f470929e99..b3bce2b3b655 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -780,10 +780,14 @@ static void tasklet_action_common(struct softirq_action *a, if (tasklet_trylock(t)) { if (!atomic_read(&t->count)) { if (tasklet_clear_sched(t)) { + trace_tasklet_entry(t->use_callback ? (void *)t->callback + : (void *)t->func); if (t->use_callback) t->callback(t); else t->func(t->data); + trace_tasklet_exit(t->use_callback ? (void *)t->callback + : (void *)t->func); } tasklet_unlock(t); continue; -- 2.25.1