Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4675890iob; Sun, 8 May 2022 21:35:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRiwYl6vFktklHnRk+5GyIagATzye92oF1/AfIjlhaRmwuuFga2dJlVlOOnGn6sODcqv4r X-Received: by 2002:a17:903:1111:b0:15f:7f0:bbf3 with SMTP id n17-20020a170903111100b0015f07f0bbf3mr5897156plh.12.1652070902413; Sun, 08 May 2022 21:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652070902; cv=none; d=google.com; s=arc-20160816; b=gKKW+VIbYPv6FBpbtFQOCNhgatMYCKk2oNDzGxIm9FTFruLRKMczYlkyaHejeEx1gB wrKoZuZ2XoEyybFjIqAa5upuhYY4YqnIOjbsD04ENsEv5hwbxEEjRjq59L+awu5/KNrM WZSk2EVjE2q3r6gKaZpSbAWaXon4FsVYGHLMlgZ4MtrF2NLOdmXFVcDs3ath/v7QKJr9 e1aJygDneCtzHDTxcibZXaEDQH4Hcv0jC8WNHdxg6zpz56Rq8g98P1f80/y2oyoSYbiF 6wdcNl8KcAcV4eLvIUDFaP8kEI6J1cDg/yQVQ9V3HBMNLs9ESuaNiY28Z7daWv3DYpkF 9IcA== 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=4lOPKqxkqx7l2Zp644Qt9dSZM2RuKt6aYLIqeRZ8E1U=; b=H9IkLKaEuflOUahSk6aZrDrpoU8K1KhDpabTp/umGUAKO3JhTRNlOw98NlKCHl70pd Ab4a1/GqhcY5UivGN9oJ9CGbY57Y4YOh5QUlej/yRsgdVBolvu+Fr63snVcK0kPyz+vw yHXb8LKlG84kSgj8UT74dui9JAlPxARbgzfv48u1BmRESgK9xY3ZhTv8BAG6NRIKCPnJ tpKi+QGvuvW68XaIKph9SHrx92l6YWehBpsM/lx6WewxzYfNfkUowdzk5f5uvRWBekcV IygGrZfI/eSefHtBGhlz8cIWpGNdMIY3tbqZTOAA/I8Eol1LjQFA2Kudq2Aunx5LOxw/ BjIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eTD+oTOa; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id nd15-20020a17090b4ccf00b001c68e9e0e68si20847990pjb.36.2022.05.08.21.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:35:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eTD+oTOa; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2970611C0AE; Sun, 8 May 2022 21:34:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381721AbiEEQLd (ORCPT + 99 others); Thu, 5 May 2022 12:11:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381697AbiEEQLZ (ORCPT ); Thu, 5 May 2022 12:11:25 -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 6C4215C745; Thu, 5 May 2022 09:07:44 -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 0AC8FB82DBE; Thu, 5 May 2022 16:07:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 151E8C385A8; Thu, 5 May 2022 16:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651766861; bh=uDbclZhgqhx0QL4By9pJc3Jzd8GIvN7PTG7LpVWu7HY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eTD+oTOaNBYLtovcmyO8QpUWPKJ1igybemX2o5iywsEk8cx1PvRK865WsgtmXKjUB dRGs1rZsqrVJ3VSTWC1XWklwXTl/2SzQ3u2Kk3ahqtDehDpohsM0Xnh2/Sh/XaYeff Ej89q6WEYdC/X52DPDtgwOVzBi1+h1eAsq09DtPaNQnL7wVjHeGrAo+oouKBbhE+2/ eKzstuf0OAfL2DDKZnCZb3d3r7Y3/tKXU2bRZ2xs5zMVjyQ/pTy7ra0ZWu5lgzfc9x 4zoU5z8nVCmBQVc+f2S9mr48XDkPnDUABxhEixS3JycXowB3lNQmj3AEyKx7Lod8WS X41/+wEvE4DTA== From: Daniel Bristot de Oliveira To: Steven Rostedt , linux-kernel@vger.kernel.org Cc: Daniel Bristot de Oliveira , 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-trace-devel@vger.kernel.org Subject: [RFC V3 05/20] rv/include: Add instrumentation helper functions Date: Thu, 5 May 2022 18:06:45 +0200 Message-Id: <8da3a74fee3b9e570065eff2382e811c1870f7d5.1651766361.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=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: 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