mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
Instrumentation helper functions to facilitate the instrumentation of auto-generated RV monitors create by dot2k. Link: https://lkml.kernel.org/r/3b36c9435f9d9299beb84e5c7c46920e205bedec.1659052063.git.bristot@kernel.org Cc: Wim Van Sebroeck <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Will Deacon <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Marco Elver <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Gabriele Paoloni <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Clark Williams <[email protected]> Cc: Tao Zhou <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Bristot de Oliveira <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
30 lines
885 B
C
30 lines
885 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <[email protected]>
|
|
*
|
|
* Helper functions to facilitate the instrumentation of auto-generated
|
|
* RV monitors create by dot2k.
|
|
*
|
|
* The dot2k tool is available at tools/verification/dot2/
|
|
*/
|
|
|
|
#include <linux/ftrace.h>
|
|
|
|
/*
|
|
* 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)
|