/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <[email protected]>3*4* Helper functions to facilitate the instrumentation of auto-generated5* RV monitors create by dot2k.6*7* The dot2k tool is available at tools/verification/dot2/8*/910#include <linux/ftrace.h>1112/*13* rv_attach_trace_probe - check and attach a handler function to a tracepoint14*/15#define rv_attach_trace_probe(monitor, tp, rv_handler) \16do { \17check_trace_callback_type_##tp(rv_handler); \18WARN_ONCE(register_trace_##tp(rv_handler, NULL), \19"fail attaching " #monitor " " #tp "handler"); \20} while (0)2122/*23* rv_detach_trace_probe - detach a handler function to a tracepoint24*/25#define rv_detach_trace_probe(monitor, tp, rv_handler) \26do { \27unregister_trace_##tp(rv_handler, NULL); \28} while (0)293031