Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

binder: add t->is_async and t->is_reply

Replace the t->need_reply flag with the more descriptive t->is_async and
and t->is_reply flags. The 'need_reply' flag was only used for debugging
purposes and the new flags can be used to distinguish between the type
of transactions too: sync, async and reply.

For now, only update the logging in print_binder_transaction_ilocked().
However, the new flags can be used in the future to replace the current
patterns and improve readability. e.g.:

- if (!reply && !(tr->flags & TF_ONE_WAY))
+ if (t->is_async)

This patch is in preparation for binder's generic netlink implementation
and no functional changes are intended.

Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20250727182932.2499194-3-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Carlos Llamas and committed by
Greg Kroah-Hartman
5cd0645b 4afc5bf0

+6 -5
+4 -3
drivers/android/binder.c
··· 3063 3063 t->flags = tr->flags; 3064 3064 t->priority = task_nice(current); 3065 3065 t->work.type = BINDER_WORK_TRANSACTION; 3066 + t->is_async = !reply && (tr->flags & TF_ONE_WAY); 3067 + t->is_reply = reply; 3066 3068 if (!reply && !(tr->flags & TF_ONE_WAY)) 3067 3069 t->from = thread; 3068 3070 ··· 3710 3708 * the target replies (or there is an error). 3711 3709 */ 3712 3710 binder_enqueue_deferred_thread_work_ilocked(thread, tcomplete); 3713 - t->need_reply = 1; 3714 3711 t->from_parent = thread->transaction_stack; 3715 3712 thread->transaction_stack = t; 3716 3713 binder_inner_proc_unlock(proc); ··· 6321 6320 spin_lock(&t->lock); 6322 6321 to_proc = t->to_proc; 6323 6322 seq_printf(m, 6324 - "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld r%d elapsed %lldms", 6323 + "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld a%d r%d elapsed %lldms", 6325 6324 prefix, t->debug_id, t, 6326 6325 t->from_pid, 6327 6326 t->from_tid, 6328 6327 to_proc ? to_proc->pid : 0, 6329 6328 t->to_thread ? t->to_thread->pid : 0, 6330 - t->code, t->flags, t->priority, t->need_reply, 6329 + t->code, t->flags, t->priority, t->is_async, t->is_reply, 6331 6330 ktime_ms_delta(current_time, t->start_time)); 6332 6331 spin_unlock(&t->lock); 6333 6332
+2 -2
drivers/android/binder_internal.h
··· 537 537 struct binder_proc *to_proc; 538 538 struct binder_thread *to_thread; 539 539 struct binder_transaction *to_parent; 540 - unsigned need_reply:1; 541 - /* unsigned is_dead:1; */ /* not used at the moment */ 540 + unsigned is_async:1; 541 + unsigned is_reply:1; 542 542 543 543 struct binder_buffer *buffer; 544 544 unsigned int code;