linux-uconsole/kernel
JINHO LIM 8219786218 ANDROID: vendor_hooks: set debugging data when rt_mutex is working
We already applied the 'vendor hook' for Dtask Debugging Information
in below issue.
(https://issuetracker.google.com/issues/162776704)

There are vendor hook call in mutex and rw_semaphore, but not for rt_mutex
Please refer to description in details as below,

1. Description
This feature writes rt mutex lock waiting information
on the task_struct structure. We can check mutex information and
mutex owner through the kernel log and custom analysis tools.
Like the previous feature in mutex and rw semaphore,
added data can be checked by ramdump analysis.

2. Vendor Hook Position
1) VENDOR_DATA
  - struct task_struct in sched.h

    VENDOR_DATA_ARRAY(2)

    [0] : type   // RTmutex (Mutex, Rwsem, ...)
    [1] : pointer   // address of lock
2) VENDOR_HOOKs
  - __rt_mutex_slowlock() in kernel/locking/rtmutex.c

3. Example
 - SysRq-w in kernel log
...
[   54.164463] [3:  kworker/u16:3:  253] kworker/3:2     D12736   418      2 0x00000228
[   54.164497] [3:  kworker/u16:3:  253] RTmutex: 0xffffffc051fa3ae8: owner[sh :9003]

[   54.167812] [3:  kworker/u16:3:  253] sh              D12848  9003   6900 0x04000200
[   54.167824] [3:  kworker/u16:3:  253] RTmutex: 0xffffffc051fa3b08: owner[kworker/3:2 :418]
...

Bug: 186567468

Signed-off-by: JINHO LIM <jordan.lim@samsung.com>
Change-Id: I93f9753be0b2c1fa1a6eaea09379d54c31d1ebcf
(cherry picked from commit e289faa9f12811d3546def3083bac0cc35c54ba8)
2021-05-07 00:12:54 +00:00
..
bpf Merge 5.10.33 into android12-5.10 2021-04-29 13:57:47 +02:00
cgroup ANDROID: cgroup: Add android_rvh_cgroup_force_kthread_migration 2021-05-04 20:13:09 +00:00
configs
debug kgdb: fix to kill breakpoints on initmem after boot 2021-03-04 11:38:46 +01:00
dma FROMLIST: mm: cma: introduce gfp flag in cma_alloc instead of no_warn 2021-01-25 12:21:02 -08:00
entry x86/entry: Move nmi entry/exit into common code 2021-03-17 17:06:36 +01:00
events This is the 5.10.24 stable release 2021-03-19 09:42:56 +01:00
gcov gcov: re-fix clang-11+ support 2021-04-14 08:41:58 +02:00
irq ANDROID: irq: manage: Export irq_do_set_affinity symbol 2021-05-06 14:58:19 +00:00
kcsan kcsan: Rewrite kcsan_prandom_u32_max() without prandom_u32_state() 2021-03-04 11:37:37 +01:00
livepatch kernel/: fix repeated words in comments 2020-10-16 11:11:19 -07:00
locking ANDROID: vendor_hooks: set debugging data when rt_mutex is working 2021-05-07 00:12:54 +00:00
power Merge 5.10.27 into android12-5.10 2021-04-02 15:25:50 +02:00
printk ANDROID: logbuf: vendor hook for logbuf dump on oops 2021-04-15 20:02:45 +00:00
rcu FROMGIT: rcu/tree: Add a trace event for RCU CPU stall warnings 2021-03-11 21:06:44 +09:00
sched FROMLIST: sched: Fix out-of-bound access in uclamp 2021-05-04 09:07:38 +00:00
time FROMGIT: tick/broadcast: Allow late registered device to enter oneshot mode 2021-04-23 16:25:34 +00:00
trace Merge 5.10.31 into android12-5.10 2021-04-16 16:01:44 +02:00
.gitignore FROMGIT: kbuild: update config_data.gz only when the content of .config is changed 2021-04-29 08:45:48 +00:00
acct.c kernel: acct.c: fix some kernel-doc nits 2020-10-16 11:11:19 -07:00
async.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
audit.c audit: Remove redundant null check 2020-08-26 09:10:39 -04:00
audit.h audit: change unnecessary globals into statics 2020-08-17 20:26:58 -04:00
audit_fsnotify.c fsnotify: generalize handle_inode_event() 2020-12-30 11:54:18 +01:00
audit_tree.c fsnotify: generalize handle_inode_event() 2020-12-30 11:54:18 +01:00
audit_watch.c fsnotify: generalize handle_inode_event() 2020-12-30 11:54:18 +01:00
auditfilter.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
auditsc.c audit/stable-5.9 PR 20200803 2020-08-04 14:20:26 -07:00
backtracetest.c treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() 2020-07-30 11:15:58 -07:00
bounds.c
capability.c LSM: Signal to SafeSetID when setting group IDs 2020-10-13 09:17:34 -07:00
cfi.c ANDROID: cfi: switch to synchronize_rcu_expedited() 2021-02-16 18:09:38 +00:00
compat.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
configs.c
context_tracking.c
cpu.c ANDROID: cpu/hotplug: failure to offline 2nd to last cpu 2021-03-11 21:32:28 +00:00
cpu_pm.c notifier: Fix broken error handling pattern 2020-09-01 09:58:03 +02:00
crash_core.c kdump: append kernel build-id string to VMCOREINFO 2020-08-12 10:58:01 -07:00
crash_dump.c
cred.c ANDROID: kernel: Add vendor hook in creds 2021-03-15 15:37:57 +00:00
delayacct.c
dma.c
exec_domain.c
exit.c ANDROID: vendor_hooks: Add hooks for memory when debug 2021-03-19 04:54:07 +00:00
extable.c
fail_function.c fail_function: Remove a redundant mutex unlock 2020-11-19 11:58:16 -08:00
fork.c ANDROID: sched: Add vendor hooks for sched. 2021-04-23 18:42:38 -07:00
freezer.c Revert "kernel: freezer should treat PF_IO_WORKER like PF_KTHREAD for freezing" 2021-04-07 15:00:14 +02:00
futex.c ANDROID: mm: page_pinner: use put_user_page at get_futex_key 2021-04-30 09:13:34 -07:00
gen_kheaders.sh
groups.c LSM: Signal to SafeSetID when setting group IDs 2020-10-13 09:17:34 -07:00
hung_task.c kernel/hung_task.c: make type annotations consistent 2020-11-02 12:14:19 -08:00
iomem.c
irq_work.c ANDROID: Sched: Export scheduler symbols needed by vendor modules 2020-12-03 16:50:04 +00:00
jump_label.c static_call: Fix static_call_update() sanity check 2021-03-25 09:04:18 +01:00
kallsyms.c ANDROID: kallsyms: cfi: strip hashes from static functions 2021-01-14 16:31:46 +00:00
kcmp.c exec: Transform exec_update_mutex into a rw_semaphore 2021-01-09 13:46:24 +01:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kcov.c kcov: make some symbols static 2020-08-12 10:58:02 -07:00
kexec.c LSM: Introduce kernel_post_load_data() hook 2020-10-05 13:37:03 +02:00
kexec_core.c kernel: kexec: remove the lock operation of system_transition_mutex 2021-02-03 23:28:37 +01:00
kexec_elf.c
kexec_file.c ima: Free IMA measurement buffer after kexec syscall 2021-03-04 11:37:50 +01:00
kexec_internal.h
kheaders.c
kmod.c kmod: remove redundant "be an" in the comment 2020-08-12 10:58:01 -07:00
kprobes.c kprobes: Fix to delay the kprobes jump optimization 2021-03-04 11:38:35 +01:00
ksysfs.c
kthread.c Merge 5.10.14 into android12-5.10 2021-02-08 20:05:12 -08:00
latencytop.c
Makefile FROMGIT: kbuild: update config_data.gz only when the content of .config is changed 2021-04-29 08:45:48 +00:00
module-internal.h
module.c Merge 5.10.26 into android12-5.10-lts 2021-03-25 17:15:27 +01:00
module_signature.c module: harden ELF info handling 2021-03-25 09:04:11 +01:00
module_signing.c module: harden ELF info handling 2021-03-25 09:04:11 +01:00
notifier.c notifier: Fix broken error handling pattern 2020-09-01 09:58:03 +02:00
nsproxy.c nsproxy: support CLONE_NEWTIME with setns() 2020-07-08 11:14:22 +02:00
padata.c padata: fix possible padata_works_lock deadlock 2020-09-04 17:51:55 +10:00
panic.c panic: don't dump stack twice on warn 2020-11-14 11:26:04 -08:00
params.c params: Replace zero-length array with flexible-array member 2020-10-29 17:22:59 -05:00
pid.c Merge 5.10.6 into android12-5.10 2021-01-13 10:28:55 +01:00
pid_namespace.c kernel/: fix repeated words in comments 2020-10-16 11:11:19 -07:00
profile.c
ptrace.c ptrace: Set PF_SUPERPRIV when checking capability 2020-11-17 12:53:22 -08:00
range.c kernel.h: split out min()/max() et al. helpers 2020-10-16 11:11:19 -07:00
reboot.c Merge e28c0d7c92 ("Merge branch 'akpm' (patches from Andrew)") into android-mainline 2020-11-15 14:37:09 +01:00
regset.c regset: kill ->get() 2020-07-27 14:31:12 -04:00
relay.c kernel/relay.c: drop unneeded initialization 2020-10-16 11:11:22 -07:00
resource.c kernel/resource: make iomem_resource implicit in release_mem_region_adjustable() 2020-10-16 11:11:18 -07:00
rseq.c
scftorture.c scftorture: Add cond_resched() to test loop 2020-08-24 18:38:38 -07:00
scs.c UPSTREAM: scs: switch to vmapped shadow stacks 2021-01-07 17:56:54 -08:00
seccomp.c Merge 5.10.20 into android12-5.10 2021-03-07 12:33:33 +01:00
signal.c ANDROID: Add vendor hooks to signal. 2021-04-09 02:30:55 +00:00
smp.c ANDROID: smp: fix preprocessor conditional warning 2021-04-14 18:33:17 +00:00
smpboot.c kthread: Extract KTHREAD_IS_PER_CPU 2021-02-07 15:37:17 +01:00
smpboot.h
softirq.c ANDROID: softirq: Export irq_handler_exit tracepoint 2020-12-21 17:48:06 +00:00
stackleak.c stackleak: let stack_erasing_sysctl take a kernel pointer buffer 2020-09-19 13:13:39 -07:00
stacktrace.c ANDROID: stacktrace: export stack_trace_save_tsk/regs 2021-04-13 13:18:04 +00:00
static_call.c static_call: Align static_call_is_init() patching condition 2021-04-07 15:00:06 +02:00
stop_machine.c ANDROID: stop_machine: stop_one_cpu_async 2020-12-08 19:07:21 +00:00
sys.c ANDROID: Add vendor hooks when syscall prctl finished 2021-03-08 16:18:51 +00:00
sys_ni.c mm/madvise: introduce process_madvise() syscall: an external memory hinting API 2020-10-18 09:27:10 -07:00
sysctl-test.c
sysctl.c This is the 5.10.24 stable release 2021-03-19 09:42:56 +01:00
task_work.c FROMGIT: kasan: record task_work_add() call stack 2021-03-24 15:09:18 -07:00
taskstats.c taskstats: move specifying netlink policy back to ops 2020-10-02 19:11:12 -07:00
test_kprobes.c
torture.c torture: Dump ftrace at shutdown only if requested 2020-06-29 12:01:45 -07:00
tracepoint.c ANDROID: vendor_hooks: Allow multiple attachments to restricted hooks 2021-03-31 09:08:06 +00:00
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c usermodehelper: reset umask to default before executing user process 2020-10-06 10:31:52 -07:00
up.c
user-return-notifier.c
user.c ANDROID: export find_user() & free_uid()for GKI purpose. 2021-04-23 03:37:41 +00:00
user_namespace.c kernel/: fix repeated words in comments 2020-10-16 11:11:19 -07:00
usermode_driver.c bpf: Fix umd memory leak in copy_process() 2021-03-30 14:32:03 +02:00
utsname.c
utsname_sysctl.c
watch_queue.c watch_queue: Limit the number of watches a user can hold 2020-08-17 09:39:18 -07:00
watchdog.c ANDROID: softlockup: add vendor hook for a softlockup task 2021-02-04 23:55:45 +00:00
watchdog_hld.c
workqueue.c Merge 5.10.30 into android12-5.10 2021-04-15 14:23:41 +02:00
workqueue_internal.h