Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1232238iog; Thu, 16 Jun 2022 01:47:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vWqnfYse2+mJnWfdODNjk2A8bEhoxv6zeS667dF//pBros5CsUXDeduMRYXKeXRkv5+6f1 X-Received: by 2002:aa7:88cd:0:b0:51c:188e:fbeb with SMTP id k13-20020aa788cd000000b0051c188efbebmr3573918pff.81.1655369269250; Thu, 16 Jun 2022 01:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655369269; cv=none; d=google.com; s=arc-20160816; b=C000BhB5Pgm+Mv3/8gPqP8G8oA0G1WMTsF7vQGXfOpljwBTihQJ+IUn6/GJlxqoNUQ 7Wu7jhi+0NajVfxaI6sopeuQLA9mLkbTk+jbANyGwnvFVbnzCo2rJIqbyleL6+D0I6uW UddYi+mt4L4lJxiDHrqFoOHpRjbFdELSZe4t4Cmh9w4ez7oyS69tJn1+AjB/6svG5Vr4 QUu3rgVeu1EkKpqZxUJdSCjuV4tVHeePu6XWqt0dbZOzcilzPGHF8wN2QPDEN2tMJ8x5 Zvayda2jJDGWZRg6IVbQ3zIOWMZ/h2kTdnRWy3Nfeg2vjNGu2lNr0QDPmn35XHXaRqT5 0a+g== 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 :dkim-signature; bh=4q7ioPRsJMd1avjbrJTNifGSwJfUvnS9J4vya5sqI4E=; b=DDGRRB/Aspdf9RgR6UPbumw/1M8FDcI1N7hra7AO8UYrTlQ8JBGs5kjdNh+ppA+gWN ASzBkpxly/HcZOA5Txcw0qGdKaRne0ZoaMnUwm3RQF+95fEXf2T0P0MwLAOzE3SWftiD jQNw99lh9q3WD+PVOJ7GMDVj0GdL/rEE9RihvFvv2HFZMe6cKRAx9MxRbbMYS/pFt4P7 sDfjCUO5ifvGPeroofGhJ2gl8IWPdT+FaPpB2TDJ6jcT8tmMooQvGIRXBP6vGK2gmTdm Y2dymWoal0oEB/JaavtHnUURFV8JRoIblYYn7rTHA1j8uTcI/rCcMkBvBCZO6DkYVnNh DdhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n1lkWXHz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l186-20020a6388c3000000b003fc3e715428si1782181pgd.342.2022.06.16.01.47.37; Thu, 16 Jun 2022 01:47:49 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n1lkWXHz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359726AbiFPIqF (ORCPT + 99 others); Thu, 16 Jun 2022 04:46:05 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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) -- 2.35.1