Commit Graph

5 Commits

Author SHA1 Message Date
Elliot Berman
54bc0aa219 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>
(cherry picked from commit 573c7f061d)
2022-08-01 19:52:59 +00: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
Georgi Djakov
926cf69af5 ANDROID: vendor_hooks: Fix psi_event build warning
Fix the following build warning:
include/trace/hooks/psi.h:17:18: warning: declaration of
	'struct psi_trigger' will not be visible outside of
	 this function [-Wvisibility]

Bug: 178721511
Fixes: commit b79d1815c4 ("ANDROID: psi: Add vendor hooks for PSI tracing")
Change-Id: I4c8c9730f5a0c94fa8d93c6995ce25f385b52043
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2021-04-30 14:50:12 +00:00
Jindong Yue
2ead8661c3 ANDROID: vendor_hooks: Fix build-break due to psi_event
Fix build-break on non-GKI builds:
  kernel/sched/psi.c:538:3: error: implicit declaration
      of function 'trace_android_vh_psi_event'
  kernel/sched/psi.c:546:2: error: implicit declaration
      of function 'trace_android_vh_psi_group'

Bug: 178721511
Fixes: commit b79d1815c4 ("ANDROID: psi: Add vendor hooks for PSI tracing")
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: Ife54bfbc035783614bebd442b86017e83c6d23a4
2021-04-23 19:12:27 +00:00
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