ANDROID: workqueue: add vendor hook for wq lockup information

- Add the hook to provide additional information like
   a task scheduling log.

Bug: 169374262

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I203dbc6faa77687ea48769f76658d28b29ef46fd
This commit is contained in:
Sangmoon Kim
2020-09-29 10:15:35 +09:00
parent d240b6929c
commit 2ea974a00c
3 changed files with 31 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
#include <trace/hooks/topology.h>
#include <trace/hooks/debug.h>
#include <trace/hooks/minidump.h>
#include <trace/hooks/wqlockup.h>
/*
* Export tracepoints that act as a bare tracehook (ie: have no trace event
@@ -58,3 +59,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipi_stop);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_printk_store);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_regs);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_wq_lockup_pool);

View File

@@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM wqlockup
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_WQLOCKUP_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_WQLOCKUP_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
/*
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
DECLARE_HOOK(android_vh_wq_lockup_pool,
TP_PROTO(int cpu, unsigned long pool_ts),
TP_ARGS(cpu, pool_ts));
#else
#define trace_android_vh_wq_lockup_pool(cpu, pool_ts)
#endif
#endif /* _TRACE_HOOK_WQLOCKUP_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@@ -53,6 +53,10 @@
#include "workqueue_internal.h"
#include <trace/hooks/wqlockup.h>
/* events/workqueue.h uses default TRACE_INCLUDE_PATH */
#undef TRACE_INCLUDE_PATH
enum {
/*
* worker_pool flags
@@ -5768,6 +5772,7 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
pr_cont_pool_info(pool);
pr_cont(" stuck for %us!\n",
jiffies_to_msecs(jiffies - pool_ts) / 1000);
trace_android_vh_wq_lockup_pool(pool->cpu, pool_ts);
}
}