From patchwork Thu Jun 16 08:44:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Bristot de Oliveira X-Patchwork-Id: 12883554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CF79C43334 for ; Thu, 16 Jun 2022 08:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359810AbiFPIqA (ORCPT ); Thu, 16 Jun 2022 04:46:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359735AbiFPIp5 (ORCPT ); Thu, 16 Jun 2022 04:45:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BE665DBE7; Thu, 16 Jun 2022 01:45:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C7AA2B822A9; Thu, 16 Jun 2022 08:45:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09536C385A2; Thu, 16 Jun 2022 08:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655369138; bh=vh8GCJZdFY4jPSPg5VmzbjDbx7oE/fXp3z/xiXgywUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n1lkWXHzI+t0mDgoSWSWheuGl+Yhhd0wPSb0bVE2UysyybbErUSot7z9E6GuG8RAn V+IsRMk1iaRoVsYR/szBarWkL/Jw8ftsevck0e6FM5p8SGxkFNjYVYRU5GuMWipgcJ tJVFgctbyrPyI6QZ1uT5cR8YaccrBPy1x5wGTFHztlpTIwlSnXmA/w+e5MVhO4Sgin qL6wzVaBls6N5AwchaONOy4479TCsqLBqOsAXhOY/cSSYRhC8QVK44a3/7QHhB9kPU 3z/gepmHDxOH8OtqIJnWFyXL289cn06T/HNXcgEOo2Oqc/Oxg0igioh3ykIR4KHun+ +hkokUInw+jZw== From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Daniel Bristot de Oliveira , Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Shuah Khan , Gabriele Paoloni , Juri Lelli , Clark Williams , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Subject: [PATCH V4 05/20] rv/include: Add instrumentation helper functions Date: Thu, 16 Jun 2022 10:44:47 +0200 Message-Id: <858a1130aa4b3add27ca2cdc6a5490de5b06befa.1655368610.git.bristot@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Instrumentation helper functions to facilitate the instrumentation of auto-generated RV monitors create by dot2k. Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: Jonathan Corbet Cc: Steven Rostedt Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Will Deacon Cc: Catalin Marinas Cc: Marco Elver Cc: Dmitry Vyukov Cc: "Paul E. McKenney" Cc: Shuah Khan Cc: Gabriele Paoloni Cc: Juri Lelli Cc: Clark Williams Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira --- include/rv/instrumentation.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/rv/instrumentation.h diff --git a/include/rv/instrumentation.h b/include/rv/instrumentation.h new file mode 100644 index 000000000000..88dd33f10827 --- /dev/null +++ b/include/rv/instrumentation.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Helper functions to facilitate the instrumentation of auto-generated + * RV monitors create by dot2k. + * + * The dot2k tool is available at tools/tracing/rv/dot2/ + * + * Copyright (C) 2019-2022 Daniel Bristot de Oliveira + */ + +#include + +#define rv_attach_trace_probe(monitor, tp, rv_handler) \ + do { \ + check_trace_callback_type_##tp(rv_handler); \ + WARN_ONCE(register_trace_##tp(rv_handler, NULL), \ + "fail attaching " #monitor " " #tp "handler"); \ + } while (0) + +#define rv_detach_trace_probe(monitor, tp, rv_handler) \ + do { \ + unregister_trace_##tp(rv_handler, NULL); \ + } while (0)