Commit Graph

5 Commits

Author SHA1 Message Date
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
Nathan Chancellor
de1a0ea811 ANDROID: logbuf: Remove if directive for vendor hooks
When CONFIG_TRACEPOINTS or CONFIG_ANDROID_VENDOR_HOOKS is not set, there
is a build error after commit 01f2392e13 ("ANDROID: logbuf: Add new
logbuf vendor hook to support pr_cont()"):

kernel/printk/printk.c:1962:4: error: implicit declaration of function
'trace_android_vh_logbuf_pr_cont'
[-Werror,-Wimplicit-function-declaration]
                        trace_android_vh_logbuf_pr_cont(&r, text_len);
                        ^
1 error generated.

Remove the #if directive so that this code always builds properly, which
is possible after commit ba75b92fef ("ANDROID: simplify vendor hooks
for non-GKI builds").

Change-Id: Icc7f55af1becab5a8833b0651402845559b6b56f
Fixes: 01f2392e13 ("ANDROID: logbuf: Add new logbuf vendor hook to support pr_cont()")
Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/2948254099
Suggested-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2021-06-30 08:55:48 +00:00
Mukesh Ojha
01f2392e13 ANDROID: logbuf: Add new logbuf vendor hook to support pr_cont()
Add new logbuf vendor hook android_vh_logbuf_pr_cont()
to capture pr_cont logs.

Bug: 185182649
Change-Id: I76b310fc9caac71b344b6cc25ea36f7f81cb7148
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2021-06-29 17:25:52 +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