Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp502396imn; Wed, 27 Jul 2022 12:01:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sAX1SXAo+0NI+WB14yQDuofjcdQQCdji41aJXQPz681hlEMlPsRviRKFp1OfDr/kqsc7jz X-Received: by 2002:a17:907:6d99:b0:72f:4633:65 with SMTP id sb25-20020a1709076d9900b0072f46330065mr18694319ejc.320.1658948490266; Wed, 27 Jul 2022 12:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658948490; cv=none; d=google.com; s=arc-20160816; b=V7+n+/ztPQ6T1ghkLle9Py6mbrkxeMMu9Wj4hARhNcOgTwUjKu6nb1CL139QHBrnVG nt5RhP4SU+Aq3XyP02owx/a+b2nNa8MAd5COnz4BQQ6uTSMvMxpdq1QVb6u9oGS6ldY4 7SDkV8RrE1OCSPWB/fmwyevVV0qdAizuw26Qx21Ybw6VNgP2+ftmI5mQynbKD3PlaDWj C30x8TYp0NfD2+bAVR/hrKJpZDpLA2CrIZxDyEVWFJFKqls1ckGmgrGtC/Wfby32Fydi 2p9IcwXbMIFOi4SHuT8lhd8KFLzK2EmPH8yH1PCBMjxdCNVIRnwI5VcrQNmukssKfG3v bdSg== 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=bNLcZY9YLyIhpQZ6p4qxndAPVu8jpvgG4aPcR0oeueDVfhZAoAj72q7Kqrs4gIe3Qg E0mVUIrMp5NXbLoK71sK4ffpmjWzeeDlkwRoh7AI2Ab06tOCLoM+9OdEU6xDODpoo1DC /z4+HeEqaP1Qkb3d99+aLPMBUqBSJV+lrl8ueRfFqIL6oU5PgETBbHKjci6188K9h0fs mD6CFEqcX/MTvYjvepVOGkdMsOdVYgg33vKvtmm/CZD2GWwD3OjdDUDbDr1pI7bUzqJ7 Qc9FPvRzFijcdxgNBha004GGKLJSDROAZBPN+OEm2zFgYz8uHmHnPTfD6k8v2txxtUiF /p6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tBAcXj+H; 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 d21-20020a170906345500b00726be5d76c0si16730161ejb.932.2022.07.27.12.01.04; Wed, 27 Jul 2022 12:01:30 -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=tBAcXj+H; 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 S243314AbiG0SKU (ORCPT + 99 others); Wed, 27 Jul 2022 14:10:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243287AbiG0SJj (ORCPT ); Wed, 27 Jul 2022 14:09:39 -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 6DC4CCFE69; Wed, 27 Jul 2022 10:12:36 -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 C8CD1B821E3; Wed, 27 Jul 2022 17:12:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81300C433D7; Wed, 27 Jul 2022 17:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658941953; bh=tFQeIFcFJY3lIF68AI4Lr4svxai5erbmpSh5Zi8+S+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tBAcXj+HivFj4maiTMPOwCDidH2skt5nSBTBRq8M/W9VYzdDOofNJ2pq65zEiA1xo jBjXrHdhtp3VejSOyBs83EeSu+PYkGEiQu+KVnDxcgImmW3yb8luHLSxpJz+zVzBfj 7mmRBHFvwNDGXbCjBAVrVVmXZZp96fRW4AQuwmfxZQhoa/aFJkq+mqwCDPJV8RrQob 3JC8YO678mpkgEi994chSgGqRucfYxVLKfejf1hmnYq4H5m/wXElIdFDFP92Y5FYzB T33MBWEzRHDq/zbLvqmo7kGb0hADsLrWCA374PDSFv3AnG67mYnEVl5dlkqRwARVKu QHXktmE3RdS7w== 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 V8 05/16] rv/include: Add instrumentation helper functions Date: Wed, 27 Jul 2022 19:11:33 +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 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