ANDROID: vendor_hooks: Add vendor hook for tcpm logs
Logs in /sys/kernel/debug/usb/tcpm* are key to debug issues related to USB charging or data. Given that debugfs is disabled in user builds, adding vendor hooks to enable dumping the same. bypass_log is set to true by the handler if logging into logbuffer is not needed. Bug: 189792358 Change-Id: Icacfed2264b6c49b8e803c62f8bd820a146c169a Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
This commit is contained in:
parent
2e2fd329bb
commit
bcfe28b62f
3 changed files with 9 additions and 0 deletions
|
|
@ -299,3 +299,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_stack_hash);
|
|||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_track_hash);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_task_comm);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_acct_update_power);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_typec_tcpm_log);
|
||||
|
|
|
|||
|
|
@ -586,6 +586,7 @@ static void _tcpm_log(struct tcpm_port *port, const char *fmt, va_list args)
|
|||
char tmpbuffer[LOG_BUFFER_ENTRY_SIZE];
|
||||
u64 ts_nsec = local_clock();
|
||||
unsigned long rem_nsec;
|
||||
bool bypass_log = false;
|
||||
|
||||
mutex_lock(&port->logbuffer_lock);
|
||||
if (!port->logbuffer[port->logbuffer_head]) {
|
||||
|
|
@ -598,6 +599,9 @@ static void _tcpm_log(struct tcpm_port *port, const char *fmt, va_list args)
|
|||
}
|
||||
|
||||
vsnprintf(tmpbuffer, sizeof(tmpbuffer), fmt, args);
|
||||
trace_android_vh_typec_tcpm_log(tmpbuffer, &bypass_log);
|
||||
if (bypass_log)
|
||||
goto abort;
|
||||
|
||||
if (tcpm_log_full(port)) {
|
||||
port->logbuffer_head = max(port->logbuffer_head - 1, 0);
|
||||
|
|
|
|||
|
|
@ -58,6 +58,10 @@ DECLARE_HOOK(android_vh_typec_tcpm_adj_current_limit,
|
|||
u32 *current_limit, bool *adjust),
|
||||
TP_ARGS(state, port_current_limit, port_voltage, pd_capable, current_limit, adjust));
|
||||
|
||||
DECLARE_HOOK(android_vh_typec_tcpm_log,
|
||||
TP_PROTO(const char *log, bool *bypass),
|
||||
TP_ARGS(log, bypass));
|
||||
|
||||
#endif /* _TRACE_HOOK_UFSHCD_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue