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
(cherry picked from commit 2ea974a00c7bdbbee140d68d8867ddcbfb529ecc)
This commit is contained in:
Sangmoon Kim 2020-09-29 10:15:35 +09:00 committed by Todd Kjos
parent c77a8f97bc
commit 34f087452f
3 changed files with 31 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include <trace/hooks/topology.h>
#include <trace/hooks/mpam.h>
#include <trace/hooks/gic.h>
#include <trace/hooks/wqlockup.h>
/*
* Export tracepoints that act as a bare tracehook (ie: have no trace event
@ -57,3 +58,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_resume);
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
@ -5789,6 +5793,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);
}
}