Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1144065imw; Wed, 13 Jul 2022 14:36:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tH6LDKOaEa70U/8aZJ82/ZFKf+krSbXCQfBHjvQyZoy3Lymt6WxGm0LqEILQRUP1E8T53E X-Received: by 2002:a05:6402:c48:b0:437:d938:9691 with SMTP id cs8-20020a0564020c4800b00437d9389691mr7559914edb.254.1657748161254; Wed, 13 Jul 2022 14:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657748161; cv=none; d=google.com; s=arc-20160816; b=OgwUpgjkduC8dDYG4XFbpqLj43fsfJ5ecgQVOOABuymNbEjGoXUL7jViAF7TNXkgaz SdrA60QYvPaRT7f4CArz7WkVgyzpdpaldR7Ht7OZ/erAEHOEQPrqc258bTG/LkcODGVZ alks4ZcrAEzWUp2GfacWTgLfl174KqIr2l1AXz58K9VwJAs2Tk7SxAPuZOaTA0h6LiGa T2t8X3luBJ853EfXGme2asBgW47P4VftC6Jd4YPeQn+HYDcL5EjVEKYhVNvYWLAnDQoT /cbiOKIWMS8Wz3WJmPvijZfC77uT8aGbr42LAc4ouwA1+v6rLALxc0fND7XB7SNi/4Us HRmg== 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=tEYzctk2TqtC1kQjt2rOqgCyns54MaRKR1suKdMdK0sVZTp5izdaaW6otyXSV4Evfb QTzXYMNaVgsyrWDy4xhVGdfmQ3XTks3ZynHsDXTFW6TUIBKJfwPylAxEdxzespEO2JS+ 0m/eaEUFhfPGMOcZBK80oQeRJu7rKaRJE7xuAnlCo8mc/+2obyJRmD9gSSklaWmkyP/r 6qMRFq4U45HmiElAl/fuZvL/FUuOeC8As02EoUBpb88/mg5ZD3SpCiDRaKn6Kuk0U5MU a5U2ck8ZBJKbZFE2494GTfH6Sbss9a4+EkZNL1bmmIk5v4PkN8AVguTZVEtcOdhPCzhX 9JYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=okpYYAsh; 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 eb10-20020a0564020d0a00b004371d8cbb34si21132313edb.292.2022.07.13.14.35.36; Wed, 13 Jul 2022 14:36:01 -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=okpYYAsh; 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 S237456AbiGMVSu (ORCPT + 99 others); Wed, 13 Jul 2022 17:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237413AbiGMVS1 (ORCPT ); Wed, 13 Jul 2022 17:18:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D49E37F96; Wed, 13 Jul 2022 14:18:18 -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 F0B09B82024; Wed, 13 Jul 2022 21:18:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F388C341C6; Wed, 13 Jul 2022 21:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657747095; bh=tFQeIFcFJY3lIF68AI4Lr4svxai5erbmpSh5Zi8+S+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=okpYYAshJblxxv6ihqkLoaGkCLc9mzj4iXwN9USidbdO/6iQh9SVpb4uWclUJUVDu UWwVbzpB8dQxDtvp5K8+D3oKoqHMZ4MUheKtvx8EDyaPWaTXwTjm4iKmSRqz1sPs24 /jy7wl5SEVJQHGDk4nkShCCyy0On4gXKIJqefL58159vlN3sxBSsu2AlpjWo7McDnj 9oTvBJyU7TKknjKYBOZWvfcMQ79YYxE1O2LUOnao6HSRBSmdihijyTJa5aL6Z2+A07 EFgdoOo8gubATXJdkARI+m3zYt1uEIZI2l52VmHRlf6qfRfma/3F2CVdx2o1X4KGuH 0MGqI1UQ4y0qQ== 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 V5 05/16] rv/include: Add instrumentation helper functions Date: Wed, 13 Jul 2022 23:17:21 +0200 Message-Id: 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: 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