Commit Graph

102 Commits

Author SHA1 Message Date
Georgi Djakov
b79d1815c4 ANDROID: psi: Add vendor hooks for PSI tracing
Add hooks to capture various per-zone memory stats when
a trigger threshold is hit.

Bug: 178721511
Change-Id: Ibe39263ddb05ffc3fa63b5225497a90c6480c8d7
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2021-04-21 05:08:41 -07:00
xiaofeng
35dafe72dd ANDROID: vendor_hooks: tune reclaim swappiness or scan type
Add hooks for reclaim

Bug: 185438290
Change-Id: Ib9eec302b1df4da7e98c77b94541af28c34a8613
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2021-04-15 23:08:29 +00:00
Mukesh Ojha
34fde61f72 ANDROID: logbuf: vendor hook for logbuf dump on oops
Initial kernel bootup logs get overwritten after running
for a long time, and there can be debugging scenario where
we need initial ~100s bootup logs for debugging.
'android_vh_initial_logbuf' vendor hook is helping in
achieving this purpose.

Bug: 185182649
Change-Id: I706824aeb566c09ecaf4b5900973d6cee8a2f35b
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2021-04-15 20:02:45 +00:00
Pavankumar Kondeti
ddeb3cdc3a ANDROID: sched: Add android_rvh_cpu_cgroup_online hook
Add a restricted vendor hook to notify that a cpu controller
cgroup is online.

Bug: 184920911
Change-Id: I7d37f38c24ce146eabb4716a959aee703d71926e
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
2021-04-09 15:36:02 -07:00
Zhuguangqing
d623f1ff72 ANDROID: Add vendor hooks to signal.
Add vendor hook to get signal for vendor-specific tuning.

Bug: 184898838

Signed-off-by: Zhuguangqing <zhuguangqing@xiaomi.com>
Change-Id: I83a28b0a6eb413976f4c57f2314d008ad792fa0d
2021-04-09 02:30:55 +00:00
Badhri Jagan Sridharan
6804a59039 ANDROID: usb: typec: tcpm: Add vendor hook to update current limit
Vendor hook for making sinks comply to pSnkStby requirement.
Hook is an alternate to the following patch series:
https://patchwork.kernel.org/project/linux-usb/list/?series=461087

OOT_Bug:
Bug: 184607655
Bug: 168245874
Bug: 173252019
Bug: 162789342
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I39510690ed866cbbc74ef50a18136bf2d5a95aac
2021-04-06 23:49:05 +00:00
Minchan Kim
c6e85ea56b ANDROID: mm: cma: add vendor hoook in cma_alloc()
Add vendor hook for cma_alloc latency measuring.

Bug: 177231781
Signed-off-by: Minchan Kim <minchan@google.com>
Change-Id: Ia2dbb26454bd8f03489389b29b9a6c939d3c2bbb
2021-04-06 20:01:19 +00:00
Liujie Xie
8f3f46d77c ANDROID: vendor_hooks: Add hooks to recognize special worker thread.
Recognize special worker thread.

Bug: 184571803
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I2ad112627eb18b98d0868bac6bd00bbfd84b34c4
2021-04-06 19:42:07 +00:00
Kyle Tso
af7214914a ANDROID: usb: typec: tcpm: Add vendor hook to store partner source capabilities
Add a hook after receiving the source capabilities from the partner
port. Pass the address of the source capability array so that vendor
code is able to access them.

OOT bug:
Bug: 181629276
Bug: 169215197
Signed-off-by: Kyle Tso <kyletso@google.com>
Change-Id: I11c4a7919c248690e63c3bfbebfa6b8d711175a6
2021-04-06 15:53:03 +00:00
Badhri Jagan Sridharan
f694171a83 ANDROID: usb: typec: tcpm: vendor hook for timer adjustments
linux/usb/pd.h has a bunch of timers for which the Type-C spec defines
a range of values. These values have to be tuned based on the latency
observed in a specific architecture. However, linux opensource sets
them to a specific value without providing a mechanism to set board
specific values. While a generic way is figured out, a vendor hook
is needed in the interim.

For instance, tCCDebounce can have a value between 100msec - 200msec.

OOT_bug:
Bug: 184308605
Bug: 168245874
Bug: 173252019
Change-Id: I278b34654a7e48990b6ebe25fbe17e3aa4165098
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
2021-04-01 20:47:53 -07:00
Choonghoon Park
5841cc213d ANDROID: GKI: sched: add rvh for new cfs task util
A vendor hook is added in post_init_entity_util_avg before
a new cfs task's util is attached to cfs_rq's util so that
vendors can gather and modify se's information to modify
scheduling behavior and DVFS as they want.

trace_android_rvh_new_task_stats is not a proper hook because
it is called after the task's util is attached to cfs_rq's util,
which means updating cfs_rq's sched_avg and DVFS request are done.

Bug: 184219858

Signed-off-by: Choonghoon Park <choong.park@samsung.com>
Change-Id: I2deaa93297f8464895978496c9838cdffaa35b7f
2021-04-01 15:15:43 +09:00
Zhuguangqing
301e89472f ANDROID: Add vendor hook to binder.
Add vendor hook to get the binder message for vendor-specific tuning.

Bug: 182496370

Signed-off-by: Zhuguangqing <zhuguangqing@xiaomi.com>
Change-Id: Id47e59c4e3ccd07b26eef758ada147b98cd1964e
2021-03-24 18:13:25 +00:00
Manish Varma
0ff110fbb3 ANDROID: fs: Add vendor hooks for ep_create_wakeup_source & timerfd_create
timerfd doesn't create any wakelocks, but eventpoll can.  When it does,
it names them after the underlying file descriptor, and since all
timerfd file descriptors are named "[timerfd]" (which saves memory on
systems like desktops with potentially many timerfd instances), all
wakesources created as a result of using the eventpoll-on-timerfd idiom
are called... "[timerfd]".

However, it becomes impossible to tell which "[timerfd]" wakesource is
affliated with which process and hence troubleshooting is difficult.

Adding vendor hooks to allow vendor to assign appropriate names to
timerfd descriptors and eventoll wakesource.

Bug: 155142106

Signed-off-by: Manish Varma <varmam@google.com>
Change-Id: I330a42ab48bed4b26d5eb2f636925c66061165ec
2021-03-24 17:57:22 +00:00
Naina Mehta
c9050b8a42 ANDROID: gpiolib: Add vendor hook for gpio read
Add android_vh_gpio_read vendor hook to bypass
initial gpio read.

Bug: 182716666
Change-Id: Ifda23ae50d90573698bc88fc9bbdfd428fdeae1a
Signed-off-by: Naina Mehta <nainmeht@codeaurora.org>
2021-03-23 11:01:01 +00:00
Liujie Xie
63399b4e2e ANDROID: vendor_hooks: Add hooks for account process tick
Add a hook in account_process_tick, which help us to get information
about the high load task and the cpu they running on.

Bug: 183260319
Change-Id: I54162ce3c65bd69e08d2d4747e4d4883efe4c442
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
2021-03-23 03:18:15 +00:00
Liujie Xie
1e13e5d9b9 ANDROID: vendor_hooks: Add hooks for improving binder trans
Recognize important binder proc & binder thread and improve their sched
lantency.

Bug: 182952552
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I174949bf90a4215a6d27f24abbc7d324a321e662
2021-03-22 20:28:00 +00:00
Badhri Jagan Sridharan
abbebf1a3e ANDROID: usb: typec: tcpci: Migrate restricted vendor hook
Since the callbacks can potentially execute i2c transactions,
use restricted vendor hook instead of vendor hook.

BUG: scheduling while atomic: 6-0025/306/0x00000002
..
Call trace:
dump_backtrace+0x0/0x1d4
show_stack+0x1c/0x2c
dump_stack+0xd0/0x154
__schedule_bug+0x74/0xb0
__schedule+0x524/0x7bc
schedule+0xa0/0xe8
schedule_preempt_disabled+0x28/0x48
__mutex_lock+0x2e8/0x6c4
__mutex_lock_slowpath+0x18/0x28
mutex_lock+0x40/0x64
regmap_lock_mutex+0x14/0x24
regmap_raw_read+0xcc/0x264
__traceiter_android_vh_typec_tcpci_get_vbus+0x50/0x78
tcpci_get_vbus+0x100/0x128

OOT_bug:
Bug: 183149028
Bug: 168245874
Bug: 173252019
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: Ia61bd2b6a01b50e73e7a6d4e398146b819181e15
2021-03-21 13:24:36 -07:00
Badhri Jagan Sridharan
ffacd097fc ANDROID: usb: typec: tcpci: Add vendor hook to mask vbus present
This hook is for addressing hardware anomalies where
TCPC_POWER_STATUS_VBUS_PRES bit can return 0 even before falling
below sSinkDisconnect threshold.

Handler has to set bypass to override the value that would otherwise
be returned by this function.
Handler can set vbus or clear vbus to indicate vbus present or absent

OOT_bug:
Bug: 183149028
Bug: 168245874
Bug: 173252019
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I2ca994d49b37bf8600c5913b892fde9acd0dc896
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2021-03-19 12:03:09 +01:00
Badhri Jagan Sridharan
1a93d556d7 ANDROID: usb: typce: tcpci: Add vendor hook for chip specific features
Needed to implement chip specific features that are not defined
in the Type-C spec.

OOT_bug:
Bug: 169213252
Bug: 168245874
Bug: 173252019
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: Ibd7b9171f105321c3010fb5b0a67d76a91224800
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2021-03-19 12:03:09 +01:00
Badhri Jagan Sridharan
08879ea0d6 ANDROID: usb: typec: tcpci: Add vendor hooks for tcpci interface
Needed to implement chip specific features that are not defined
in the Type-C spec.

OOT_bug:
Bug: 169213252
Bug: 168245874
Bug: 173252019
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I36fe75dddd8cd4e2054db01ed4fee7ea08dd8702
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2021-03-19 12:03:09 +01:00
Liujie Xie
24149445ad ANDROID: vendor_hooks: Add hooks for memory when debug
Add vendors hooks for recording memory used

Bug: 182443489
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I62d8bb2b6650d8b187b433f97eb833ef0b784df1
2021-03-19 04:54:07 +00:00
duwenchao
00185a421a ANDROID: vendor_hooks: Add hooks for ufs scheduler
Add hooks to support oem's ufs scheduler feature.

Bug: 183085044
Signed-off-by: duwenchao <duwenchao@xiaomi.com>
Change-Id: I09bf9cba33412c81e4da83292772c0e95cf32022
2021-03-18 18:26:18 +00:00
Quentin Perret
187306ab1a ANDROID: Partial revert of 06881e01b5 ("ANDROID: sched: Add vendor hooks for override sugov behavior")
Remove the set_sugov_sched_attr hook which is no longer needed with a
modular governor. The IOWait hook must stay, however.

Bug: 171598214
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Ie68df673bc78ca76c90ba1e6c32ecaa4bba10c89
2021-03-17 17:40:35 +00:00
Quentin Perret
b542f4c389 Revert "ANDROID: sched: Add vendor hooks for skipping sugov update"
This reverts commit 846bf8e8cb.

Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Ib8b7721c2a37393a85108f4c8aee920f68044f0c
2021-03-17 17:40:28 +00:00
Rick Yiu
475aea007d ANDROID: sched: Add vendor hook for util_est_update
Vendor may have its own estimated utilization.

Bug: 170508405
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: I6055907de75ace4586c3ad854d40f42e3bf40147
2021-03-16 12:49:49 +00:00
xieliujie
53e8099784 ANDROID: vendor_hooks: Add hooks for scheduler
Add hooks to support oem's scheduler feature.

Bug: 182441701
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I31023844b20923bed1ca216831e7a2431e9ab0c9
2021-03-16 09:08:22 +00:00
Kuan-Ying Lee
4d63efb9ae ANDROID: module: Add vendor hook
Add vendor hook for module init, so we can get memory type and
use it to do memory type check for architecture
dependent page table setting.

Bug: 181639260

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: I95b70d7a57994f2548fddfb2290d4c9136f58785
2021-03-15 15:39:00 +00:00
Kuan-Ying Lee
2ff446fc4d ANDROID: bpf: Add vendor hook
Add vendor hook for bpf, so we can get memory type and
use it to do memory type check for architecture
dependent page table setting.

Bug: 181639260

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Icac325a040fb88c7f6b04b2409029b623bd8515f
2021-03-15 15:38:19 +00:00
Kuan-Ying Lee
dccee128b7 ANDROID: kernel: Add vendor hook in creds
Add vendor hook for creds, so we get the cred information
to monitor cred lifetime.

Bug: 181639260

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: I8f254464e07f9c88336995152479ce91deb13c75
2021-03-15 15:37:57 +00:00
Kuan-Ying Lee
0a3b407463 ANDROID: security: selinux: Add vendor hook in avc
Add vendor hook for avc, so we can get avc_node information
to monitor avc lifetime.

Bug: 181639260

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Idbebeca926c2cb407264f2872b032e1f18462697
2021-03-15 15:37:18 +00:00
Rick Yiu
cc1f93cb20 ANDROID: sched: Add vendor hook for uclamp_eff_get
Vendor may have their own behavior for determing uclamp value. Also
uclamp_eff_get() is used in uclamp_rq_inc_id() when task is enqueued,
and it is contained in uclamp_eff_value(), there is no much benefit to
hook uclamp_eff_value(), so remove the hook in uclamp_eff_value().

Bug: 170507972
Bug: 180859906
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: Ibf7c043188a77c40baf5b4040b198a4197236089
2021-03-12 16:33:30 +08:00
Sangmoon Kim
9108e9ba66 ANDROID: arm64: add vendor hooks for unusal abort cases
Add hooks to gather data of unsual aborts and summarize it with
other information.

Bug: 177483057

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I5f44b12770ae4976a6e3b098bd95a05dea347764
2021-03-11 19:59:21 +00:00
xieliujie
80b4341d05 ANDROID: vendor_hooks: Add hooks for rwsem and mutex
Add hooks to apply oem's optimization of rwsem and mutex

Bug: 182237112
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I6332623732e2d6826b8b61087ca74e55393e0c3d
2021-03-10 21:18:26 +00:00
Frankie Chang
772beecd5b ANDROID: Add vendor hooks when syscall prctl finished
Add vendor hook when syscall prctl finished for vendor-specific tuning.

Bug: 181819699

Signed-off-by: Frankie Chang <frankie.chang@mediatek.com>
Change-Id: Ica42d80ab4b540045330e9c5b211e0e814eed0ff
(cherry picked from commit d150b26653e7a3d15383a09384aace140b537ff4)
2021-03-08 16:18:51 +00:00
Frankie Chang
02a9f884d5 ANDROID: cgroup: Add vendor hook to the cgroup
Add a vendor hook after attaching a task to a cgroup to 
recognize the group_id for performance tuning

Bug: 181917687

Signed-off-by: Frankie Chang <frankie.chang@mediatek.com>
Change-Id: I603afa3d893dd575a7dcb97f83bd9eacb8315bab
(cherry picked from commit de089a37a3d248608a1d5855a4ae82ebad3ec2ab)
2021-03-08 16:17:15 +00:00
Pavankumar Kondeti
2d45001d59 ANDROID: cpufreq: Add a restricted vendor hook for freq transition
A restricted vendor hook for cpufreq transition. The hook is
invoked per policy after changing the policy->cur and passes
policy as an argument.

Bug: 181889516
Change-Id: I6f89850779fdd63e178e227c293f42b7f66fd78d
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
2021-03-06 04:51:50 +05:30
Jaegeuk Kim
4e98107b8c ANDROID: scsi: ufs: add hooks to track ufs commands
This adds some missing hooks for ufs commands, including request,
query, uic, task manager commands, and interrupt events for vendor.
Those can be used for vendor module to understand command history.

Bug: 172305874
Bug: 176940922
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ie447860290f4fbc1e03ad8ae5f50bd02121756cb
2021-03-05 22:40:51 +00:00
Rick Yiu
4b88cf8524 ANDROID: sched: Add vendor hook for uclamp_eff_value
Vendor may have their own behavior for determing uclamp value.

Bug: 170507972
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: I33f8adc7240f6a44f16446421536047db2794989
2021-03-05 13:08:32 +00:00
Eric Biggers
1cfa4b71be ANDROID: scsi: ufs: replace fill_prdt with Android vendor hook
Like was done for the other non-upstream methods in
'struct ufs_hba_variant_ops', replace ->fill_prdt() with an Android
vendor hook.  This is considered to be better because it avoids any
conflicts with upstream changes to 'struct ufs_hba_variant_ops'.

Note that as a side effect of this change, fill_prdt is no longer
allowed to sleep.  That's fine for the only known use of this hook.

Bug: 162257402
Bug: 181359082
Change-Id: I8096932525c27b969193d769aff511a0114b35ad
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-03-04 23:20:39 +00:00
Namkyu Kim
97368fc2dc ANDROID: Add a vendor hook that allow a module to modify the wake flag
android_vh_do_wake_up_sync:
  To modify the mode value of __wake_up_sync_key

 android_vh_set_wake_flags:
  To modify the wake flag from a module

Bug: 181743516
Signed-off-by: Namkyu Kim <namkyu78.kim@samsung.com>
Change-Id: I972e2469c3f139373d21f1e8c85974763388a693
2021-03-04 16:19:04 +00:00
Jaegeuk Kim
0d213c5921 ANDROID: scsi: ufs: replace variants with android vendor hooks
This converts the existing android-specific hooks to official vendor hooks.
Per not-restricted hooks, vendor body should not enter into sleep mode by
mutex or similar.

Bug: 181359082
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ic66077b3c42e63a5496a1d0c107bad8ae3601f3c
2021-03-01 14:41:44 -08:00
davidchao
ea8600cea8 ANDROID: thermal: Add vendor thermal genl event function
Add vendor enable_thermal_genl_check logic.
To avoid thermal-hal being woken up all the time by thermal genl events,
only the selected thermal_zone and cooling_device can send events from
kernel.

Bug: 170682696
Test: boot and thermal-hal can receive thermal genl events from kernel
Change-Id: I8f49d67963bed9d6d1f11c74bd274dc8967407c1
Signed-off-by: davidchao <davidchao@google.com>
(cherry picked from commit 88133a5b0b63a55dfb138e2150a6fd22b81c65a2)
Signed-off-by: J. Avila <elavila@google.com>
2021-02-26 20:34:41 +00:00
Rick Yiu
f5998fbf2d ANDROID: sched: Add vendor hook for cpu_overutilized
Currently, cpu_overutilized uses the threshold 80% of cpu capacity, Add
vendor hook so that vendor could define other values.

Bug: 176722431
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: Ic10bd8ebb40f7321cfa10e33ac020e3347ca6550
(cherry picked from commit b199c6e8795791e008cfff6e214676857cd0651c)
Signed-off-by: J. Avila <elavila@google.com>
2021-02-26 20:34:34 +00:00
Chiawei Wang
db158b4ae0 ANDROID: mm: Add vendor hook in pagecache_get_page()
Add a vendor hook for pagecache hit/miss and other
vendor specific functions.

Bug: 174088128
Bug: 172987241
Signed-off-by: Chiawei Wang <chiaweiwang@google.com>
Change-Id: Ie9f14a69a86b8ed81de766e44e30f2eba1d9bd84
2021-02-19 17:59:52 +00:00
Chiawei Wang
369de37804 ANDROID: mm: Add vendor hook in rmqueue()
Add a vendor hook for costly order page counting
and other vendor specific functions.

Bug: 174521902
Bug: 172987241
Signed-off-by: Chiawei Wang <chiaweiwang@google.com>
Change-Id: I89206727a462548cc3500b695d85c83ff003eec7
2021-02-19 17:59:30 +00:00
Pavankumar Kondeti
a56f081c5b ANDROID: sched: Add restricted vendor hooks in CFS scheduler
Add restricted vendor hooks in CFS scheduler class to allow
customizations in vendor modules.

Bug: 180668820
Change-Id: I69bd90e11220d7607b075a3aa687059deaa60439
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
2021-02-19 12:22:57 +05:30
Patrick Daly
575ad9a263 ANDROID: iommu: Add vendor hook
Add vendor hook for arch_setup_dma_ops to allow vendor enhancement.

Bug: 179291683

Change-Id: Ie847a14d6536eb151cbd0a93452f6895ee451930
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
2021-02-10 01:54:31 +00:00
Sangmoon Kim
a8313dbdb3 ANDROID: arm64: add vendor hooks for kernel fault cases
Add hooks to gather data of kernel fault and summarize it with
other information.

Bug: 177483057

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I527eddf08be22fa842680bee850f1ef1f5a2c0ed
2021-02-04 23:56:39 +00:00
Sangmoon Kim
18ebdc3746 ANDROID: sched: add vendor hooks for bad scheduling
Add hooks to gather data of bad scheduling and summarize it with
other information.

Bug: 177483057

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I08a7097b60dd8eebc5c0205b31c463a36f576121
2021-02-04 23:56:20 +00:00
Sangmoon Kim
23f19a5f28 ANDROID: power: add vendor hooks for try_to_freeze fail
Add hooks to gather data of unfrozen tasks and summarize it
with other information.

Bug: 177483057

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I6f3ed7320e828a8dd1e7ae5d4449420085a75b17
2021-02-04 23:55:59 +00:00