diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index c6b44aa69d7d..59dfa514c4e9 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -52,6 +52,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -193,3 +194,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_shmem_get_folio); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_slab_folio_alloced); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_kmalloc_large_alloced); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_ctl_dirty_rate); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_watchdog_timer_softlockup); diff --git a/include/trace/hooks/softlockup.h b/include/trace/hooks/softlockup.h new file mode 100644 index 000000000000..eb2855379d98 --- /dev/null +++ b/include/trace/hooks/softlockup.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM softlockup +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_SOFTLOCKUP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_SOFTLOCKUP_H +#include + +struct pt_regs; +DECLARE_HOOK(android_vh_watchdog_timer_softlockup, + TP_PROTO(int duration, struct pt_regs *regs, bool is_panic), + TP_ARGS(duration, regs, is_panic)); + +#endif /* _TRACE_HOOK_SOFTLOCKUP_H */ +/* This part must be outside protection */ +#include diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 262691ba62b7..6e09ef3f2c20 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -32,6 +32,8 @@ #include +#include + static DEFINE_MUTEX(watchdog_mutex); #if defined(CONFIG_HARDLOCKUP_DETECTOR) || defined(CONFIG_HARDLOCKUP_DETECTOR_SPARC64) @@ -767,6 +769,7 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) clear_bit_unlock(0, &soft_lockup_nmi_warn); } + trace_android_vh_watchdog_timer_softlockup(duration, regs, !!softlockup_panic); add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK); if (softlockup_panic) panic("softlockup: hung tasks");