Commit Graph

19 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
8d86846781 Revert "ANDROID: vendor_hooks: Add hooks for binder"
This reverts commit acefa91e51.

The hooks trace_android_vh_binder_proc_transaction_entry and
trace_android_vh_binder_select_worklist_ilocked are not used by any
vendor, so remove it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 219898723
Cc: Liujie Xie <xieliujie@oppo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2c04e60fa9d6eb6d85be7882d12f1b70956b8e80
2022-08-16 18:05:09 +00:00
Elliot Berman
573c7f061d ANDROID: Guard hooks with their CONFIG_ options
ANDROID_VENDOR_HOOKS has implicit dependencies on the subsystems which
it hooks into whenever it directly uses an "internal" header for that
system. For instance, drivers/scsi/ufs/ufshcd.h doesn't compile unless
CONFIG_SCSI_UFSHCD is enabled:

  In file included from drivers/android/vendor_hooks.c:41:
  In file included from include/trace/hooks/ufshcd.h:21:
  include/../drivers/scsi/ufs/ufshcd.h:675:38: error: field has incomplete type 'struct devfreq_simple_ondemand_data'
          struct devfreq_simple_ondemand_data ondemand_data;
                                              ^
  include/../drivers/scsi/ufs/ufshcd.h:675:9: note: forward declaration of 'struct devfreq_simple_ondemand_data'
          struct devfreq_simple_ondemand_data ondemand_data;

To avoid these implicit dependencies, guard any "internal" header
includes with the respective CONFIG_ options when applicable. If the
CONFIG_ option is not enabled, then the forward-declared structs are
used. This is acceptable because those hooks would not have been called
anyway since the underlying subsytem wasn't enabled.

Fixes: commit 1590a0e8e1 ("ANDROID: GKI: include more type definitions in vendor hooks")
Bug: 240404657
Change-Id: I43d19136fdb1b534e80630067f5db92c379adc67
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2022-07-29 14:34:26 -07:00
Giuliano Procida
1590a0e8e1 ANDROID: GKI: include more type definitions in vendor hooks
The following types are now fully defined in ABI XML.

* `struct binder_transaction_data`
* `struct blk_mq_alloc_data`
* `struct media_link_desc`
* `struct packet_type`
* `struct printk_record`
* `struct printk_ringbuffer`

Bug: 233047575
Change-Id: Ib7a096c937cfa9facca89b8a26edd2f4b00416a1
Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-06-23 18:21:44 +00:00
Liujie Xie
acefa91e51 ANDROID: vendor_hooks: Add hooks for binder
trace_android_vh_binder_proc_transaction_entry:
We need change binder thread so that this work can be added in
proc->todo, if we found the binder thread, skip native logic.

trace_android_vh_binder_select_worklist_ilocked:
we need this because we can't change list point in ”trace_android_vh_binder_thread_read“,
otherwise, If a work has beed added in our own defined list before,
current may goto retry and loop again and again.

Bug: 219898723
Change-Id: Ifdb3429c9ddac521bc75c1d21740ee7cc4b8f143
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
2022-02-27 04:29:51 +00:00
Greg Kroah-Hartman
e4d293dc33 Revert "ANDROID: vendor_hooks: Add hooks for binder proc transaction"
This reverts commit cb7e10d31b.

The hook android_vh_binder_proc_transaction_finish is not used by any
vendor, so remove it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 208910215
Cc: Liujie Xie <xieliujie@oppo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I19c6660c138dc88e554e62d309484d75ec24dc6c
2022-02-22 16:30:58 +00:00
Liujie Xie
cb7e10d31b ANDROID: vendor_hooks: Add hooks for binder proc transaction
We need pointers to proc and t, the current hooks in binder_proc_transaction
are unable to use.

Bug: 208910215
Change-Id: I730964f965a015e5f5a3e237d9b3bd084b5bd0d0
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
2022-02-14 18:40:45 +00:00
Liujie Xie
05c23b7a50 ANDROID: vendor_hooks: Add hooks for binder
We want to add some hooks in the binder module so that we can reduce
block time until binder thread is available
Here are what new hooks do for:
1、android_vh_binder_looper_state_registered: choose a binder thread(do proc work) as a low-level thread.Only this thread has power to excute background binder transaction.
2、android_vh_binder_thread_read: let binder thread do works which come from
our list.
3、android_vh_binder_free_proc: free some pointers and variable.
4、android_vh_binder_thread_release: free the list that we create before.
5、android_vh_binder_has_work_ilocked: to check if our list has work.
6、android_vh_binder_read_done: because of we add hook in binder_has_work_ilocked,
binder_has_work_ilocked may return true, so we try to wake up low-level thread immediately.

Bug: 212483521
Change-Id: Ic40f452cc4dcf8fc85422e23e6f1a7ad77547309
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
2022-01-07 16:09:31 +00:00
Liujie Xie
05aa93d251 ANDROID: vendor_hooks: Add hooks for binder proc transaction
When binder transaction happened, We want to know it's transaction code
and it is oneway or not.

Bug: 208910215

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ic03e5481e96e120a1953a101895714db04ca2bdf
2021-12-03 12:42:11 +08:00
Liangliang Li
2f3f5731de ANDROID: GKI: Add vendor hook to binder transaction
We want to get binder free space information in the binder
transaction, but this needs to hold the mutex lock. So we add
this restrict hook to do this.

Bug: 205648032
Change-Id: Ie1f377018da686bd62f5ac2d1e5421899741e6d5
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-11-17 16:49:10 +00:00
xieliujie
4322bb07e8 ANDROID: vendor_hooks: Modify the function name
Vendor hook is add in the commit:
https://android-review.googlesource.com/c/kernel/common/+/1687592
When we register the vendor hook and build, there is build error:
too long symbol "__tracepoint_android_vh_binder_transaction_priority_skip"
So, I shorten the function name
android_vh_binder_transaction_priority_skip -->
android_vh_binder_priority_skip

Bug: 186482511

Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I27f39dd32436b09257bcf6e746f4ccdfbd6d6cfe
2021-07-15 16:50:42 +00:00
zhang chuang
eabe9707f2 ANDROID: Add hook to show vendor info for transactions
When watchdog or anr occur, we need to read
dev/binderfs/binder_logs/proc/pid or dev/binderfs/binder_logs/state
node to know the time-consuming information of the binder call.
We need to add the time-consuming information of binder transaction.

Bug: 190413570

Signed-off-by: zhang chuang <zhangchuang3@xiaomi.com>
Change-Id: I0423d4e821d5cd725a848584133dc7245cbc233a
2021-06-24 17:40:34 -07:00
zhengding chen
35014985c2 ANDROID: vendor_hooks: Add hooks for binder proc transaction
When servicemanager process added service proxy from other process
register the service, we want to know the matching relation between
handle in the process and service name. When binder transaction
happened, We want to know what process calls what method on what service.

Bug: 186604985

Signed-off-by: zhengding chen <chenzhengding@oppo.com>
Change-Id: I813d1cde10294d8665f899f7fef0d444ec1f1f5e
2021-04-30 02:31:20 +00:00
xieliujie
2337b9185a ANDROID: vendor_hooks: Add hook for binder
Add hook to support oem's performance feature.

Bug: 186482511

Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: Ib495e80e569cc293eaa98d87a050aee8915eb415
2021-04-27 19:18:56 +00: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
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
Todd Kjos
10fc8b2584 ANDROID: simplify vendor hook definitions
Remove macro versions of hooks that are no longer needed. The
macro versions are still needed when the _rcuidle version
of the hook is used (as in include/trace/hooks/debug.h).

Bug: 177416721
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I4b50447e9a922ed038663d1459d7622dab30ffbb
2021-01-27 09:45:26 +00:00
Satya Durga Srinivasu Prabhala
90bd50a4d7 ANDROID: binder: consolidate wakeup vendor hooks into one
There are few vendor hooks available for binder wakeup related
functionality. As they both essentially do the same thing, we can
consolidate them into one.

Bug: 174219217
Change-Id: I44b472e7564eecbe8236ad2eb88b0433195f14d8
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2020-12-15 22:35:10 +00:00
Satya Durga Srinivasu Prabhala
37d7ed1b22 ANDROID: binder: Add vendor hooks
Add below vendor hooks to make vendor extensions possible.
	1. android_vh_binder_wakeup_poll_threads_ilocked
	2. android_vh_binder_wakeup_thread_ilocked

Bug: 174219217
Change-Id: I9f55ca4427583bbfb29a6808280a7d09e1fc22ee
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2020-12-02 16:25:08 +00:00
JianMin Liu
3fc5e94255 ANDROID: binder: Add vendor hook to the binder
- To apply vendor's performance tune for blocked binder transaction,
     add the hook on the begin/end of transaction.

   - ANDROID_VENDOR_DATA added to binder_transaction.

Bug: 161400830

Signed-off-by: JianMin Liu <jian-min.liu@mediatek.com>
Change-Id: If60870623ce2669200238172737dd8455ac34b02
2020-07-28 03:03:52 +00:00