Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4665261imw; Tue, 19 Jul 2022 10:49:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sxNB0nLKB33JpBnFWm98IkWB6841EIMnxBHaUPDJ1BDSJZGfMbNSKFFSY1GhYYmP3t/DtI X-Received: by 2002:a05:6402:15a:b0:431:71b9:86f3 with SMTP id s26-20020a056402015a00b0043171b986f3mr44804597edu.249.1658252978495; Tue, 19 Jul 2022 10:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658252978; cv=none; d=google.com; s=arc-20160816; b=N0SxzdAeLOSdMhfkDnijtfqyxeRfNr+gl00tUhEG1FkwZRs8bmAtZIHUfzsm2UI7bn lBFL5/EcAJlcIBECdfmVZ+6jpD2MYXin6TrukufubSff42tI0PhXih3m9PmTX+P/osLS SN5b1u0usvJlp3YlGujXePaGNqXu2GuNBWXpMTaoJLjQ78nVCAdytaGSRX4frFXfNvA1 aaPwmJ1BM5Bq2rdDGaw44aYItmLI10xojWnkY1SmDojs3N7EC2o0+pSX3Qlv+vNAwgKH kmvdkwB+9uCFVWqvtyLi7tz30xenmVN98bt8i35Wgdap35SjtRKRfGh1dmf9sdFxn5E2 6l8g== 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=vEETFg58OGYFJdw5xQVwFI3t7B5Con5V8LNqy9UwN78=; b=FbLbba3alpruhtgz3eVMO1Nk47FOJk9dYwDQI053GWONbupMi7DtZn2Z2euQS6rHFR indO5UrvobzaE2ZzQbNeQrXeMJqPSy30mVpkj9vDmgNnlCDDDV3P0ErMNvV3SYFkAf6+ 8+XpnnLhVzXl151bOkg/104N2M5LjQ98jMRvqhKs30FLsd0VwX4fmdsxU3rgfPlxid9W Rqa14SsZ0k1mdEUsi/vkdXvJvjBCxNhYi5IfmRhkjinqahoGhlFVltF4mK2Jpzb7nMo5 MoM4nL5V+mFDZXUcsVGNJcfjw6D+XxyrXUmZzjRfvE3deh+ymxA7OAvQ7ic3La2fVWUy Vn5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kpvLgN/3"; 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 sb13-20020a1709076d8d00b0072b32354c9bsi3993624ejc.593.2022.07.19.10.48.46; Tue, 19 Jul 2022 10:49:38 -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="kpvLgN/3"; 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 S239459AbiGSR2T (ORCPT + 99 others); Tue, 19 Jul 2022 13:28:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239371AbiGSR2G (ORCPT ); Tue, 19 Jul 2022 13:28:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7FDF4E86A; Tue, 19 Jul 2022 10:28:01 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4694A61551; Tue, 19 Jul 2022 17:28:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11E95C36AE7; Tue, 19 Jul 2022 17:27:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658251680; bh=tFQeIFcFJY3lIF68AI4Lr4svxai5erbmpSh5Zi8+S+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kpvLgN/3eI28chYUTM1GGL4W1QW+AbX0r6Z9dKoM76xAJYOLStL+FqZ0rhOThyeG7 4LpZ3pdNEPWDyG4iyL3A/3uSNTpCfECf2cxw3X4jQEIYyu/e6HNt15m97lmIiCiB5X U6d2yLfpGTIWOucY5r8NTYKCXX6sYwchK1tBZsGovGf0wz3eubLkqbziE1CCQRwHxs cFBCD/LjJ00l9K6ocSd0Un+YnJLoLX60xui6OlQ3DWJWVvog0DzW0orZrzZ3HdoWqD myB0aR/LXqa2Sj2zXXuf1VkEd/KoyrTOnIOnCRG39MefTZ0Sg/D4AKFMlVcnIGRslv OuROf76WAPuJw== 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 , Tao Zhou , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Subject: [PATCH V6 05/16] rv/include: Add instrumentation helper functions Date: Tue, 19 Jul 2022 19:27:10 +0200 Message-Id: <9175dee31f1bf17ba35ae0d39451c7960ea95b24.1658244826.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.8 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 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: Tao Zhou Cc: Randy Dunlap 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 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 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..d4e7a02ede1a --- /dev/null +++ b/include/rv/instrumentation.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira + * + * Helper functions to facilitate the instrumentation of auto-generated + * RV monitors create by dot2k. + * + * The dot2k tool is available at tools/verification/dot2/ + */ + +#include + +/* + * rv_attach_trace_probe - check and attach a handler function to a tracepoint + */ +#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) + +/* + * rv_detach_trace_probe - detach a handler function to a tracepoint + */ +#define rv_detach_trace_probe(monitor, tp, rv_handler) \ + do { \ + unregister_trace_##tp(rv_handler, NULL); \ + } while (0) -- 2.35.1