ANDROID: vendor_hooks:add restricted hook for logbuf

Fix the timestamp in front of the log is out of order when
using android_vh_logbuf with CPU core is offline.

Bug: 364443023
Change-Id: Ib37f4373d3511aaf765838bf581c84ed22992a77
Signed-off-by: Xandy.Xiong <xiongliang@xiaomi.com>
This commit is contained in:
Xandy.Xiong 2024-09-10 16:05:23 +08:00 committed by Treehugger Robot
parent 6d7177caf9
commit 9b44f2fb79
3 changed files with 6 additions and 0 deletions

View File

@ -323,6 +323,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_looper_exited);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_spawn_new_thread);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_has_special_work_ilocked);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_logbuf);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_logbuf);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_shrink_slab);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_page_wmark);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_add_new_anon_rmap);

View File

@ -12,6 +12,10 @@
struct printk_ringbuffer;
struct printk_record;
DECLARE_RESTRICTED_HOOK(android_rvh_logbuf,
TP_PROTO(struct printk_ringbuffer *rb, struct printk_record *r),
TP_ARGS(rb, r), true)
DECLARE_HOOK(android_vh_logbuf,
TP_PROTO(struct printk_ringbuffer *rb, struct printk_record *r),
TP_ARGS(rb, r))

View File

@ -2309,6 +2309,7 @@ int vprintk_store(int facility, int level,
else
prb_final_commit(&e);
trace_android_rvh_logbuf(prb, &r);
trace_android_vh_logbuf(prb, &r);
ret = text_len + trunc_msg_len;
out: