Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp165666imn; Fri, 29 Jul 2022 03:21:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sIl3TIG4NzwrmPXcDmbFnTH/dZJZST292XexSSt65SyvMb8H0ebDZam8nJpA0zHO4lc3y9 X-Received: by 2002:a17:907:2cca:b0:72b:4188:f95b with SMTP id hg10-20020a1709072cca00b0072b4188f95bmr2303599ejc.153.1659090085541; Fri, 29 Jul 2022 03:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659090085; cv=none; d=google.com; s=arc-20160816; b=jB1LFmm58G4EFVCg7ozpWn8890+HjGNkC29IvoGKbYB6QbjK7fU148rs1GbjkwumSK Fg4WVhbwzA/ucCVbnGpELYjePIpvTdIE84/2Bm1GCAniCa1VC2jfZ2/OLHwuexPwxRGb op96a0jgMX/kws9EnjtSPOW0SOGmnOZLYVk0SL5V6xdplRw88hat0TtHgWXXlbVYSYqH TFjTg6fpanzXn7gQM7NrA1XAfg11qp5bUDNl7Ionri5sz4otU+zqjJUQUX0BKuXUSsDJ rPY3ei4yhtZiTGWnrnx296yAA3khCXfepOLyfBlooZq5fwT4JNMnj4fXDlqdMrMLWVIQ A6ZA== 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=O6E0/ciuqVxr9CgDoPZw/35OW6qBUXvZ/2CN0i+NSG4NiHabR7p/taCBla4x+lC+oS pJx7U+UuCOigkOeu6qjSuVb55uqsqj2pNg/2ehs82o3V5CcT0dTPCvOHnKsse6aHTeXq qa2o9jiEVbhUgzIedWvVQ/BLzAKWuK5DORCMMdIxHdBK/Ws+1WuQ2cgR9uHNvhyr7d9a NiFAowqHeBOKNdbnGp8E+I3g3P1EthK3exTUloAB4M6LGI0tbRqV/QVrs0UXzlK2PDYF S0WJq+03Sa/E1XwRh9CjpOlSUhR9Ir7mxaPw6z47b0Ogn3m7KtdZYVgdW+sQLS+MBL3v LZEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sSOLYhnF; 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 ji15-20020a170907980f00b00722e82edf14si3679479ejc.14.2022.07.29.03.21.00; Fri, 29 Jul 2022 03:21:25 -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=sSOLYhnF; 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 S235731AbiG2Jjr (ORCPT + 99 others); Fri, 29 Jul 2022 05:39:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235707AbiG2Jjg (ORCPT ); Fri, 29 Jul 2022 05:39:36 -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 E3EDF85FBD; Fri, 29 Jul 2022 02:39:34 -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 A640AB8232F; Fri, 29 Jul 2022 09:39:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEB27C433C1; Fri, 29 Jul 2022 09:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659087572; bh=tFQeIFcFJY3lIF68AI4Lr4svxai5erbmpSh5Zi8+S+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sSOLYhnFVecmuCQwFU/dVUvaabso05mvjr177NvBHDOymmcR6SQNGystFd2P+S7Ob K5aVo8+Fu/Qwlw0ZccGSsinDfIuYNQSDFAz6uxDoOcjCmHY3j9RUxjZDK8OuuiN/b3 wAbG5AggCTJGT9Ti3fTRGdCk3WUORhvjwIrOqWIQpyuyTdx/6hPmQtimd/jUQ2SfLD KOrHMDpPt31t3rnomvqGICFEOBWUn1Koqu/sqCEAi5Mz1CbO4qqLF3Jl6ADw4zj7AY NX4bYi1q2gE0oP1VmaYR1pnv2SqwNE2Z1KoK/rHaHjyKMCDJRRHfKCker0sANYtle1 +EayHD7kzGwTg== 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 V9 05/16] rv/include: Add instrumentation helper functions Date: Fri, 29 Jul 2022 11:38:44 +0200 Message-Id: <3b36c9435f9d9299beb84e5c7c46920e205bedec.1659052063.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 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