public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] binder: log transaction code on failure
@ 2025-01-10  0:05 Carlos Llamas
  2025-01-10 12:11 ` Alice Ryhl
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos Llamas @ 2025-01-10  0:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
	Suren Baghdasaryan
  Cc: linux-kernel, kernel-team, Steven Moreland

When a transaction fails, log the 'tr->code' to help indentify the
problematic userspace call path. This additional information will
simplify debugging efforts.

Cc: Steven Moreland <smoreland@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
---
 drivers/android/binder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index ef353ca13c35..cb4187a4e595 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -3801,13 +3801,13 @@ static void binder_transaction(struct binder_proc *proc,
 	}
 
 	binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
-		     "%d:%d transaction %s to %d:%d failed %d/%d/%d, size %lld-%lld line %d\n",
+		     "%d:%d transaction %s to %d:%d failed %d/%d/%d, code %d size %lld-%lld line %d\n",
 		     proc->pid, thread->pid, reply ? "reply" :
 		     (tr->flags & TF_ONE_WAY ? "async" : "call"),
 		     target_proc ? target_proc->pid : 0,
 		     target_thread ? target_thread->pid : 0,
 		     t_debug_id, return_error, return_error_param,
-		     (u64)tr->data_size, (u64)tr->offsets_size,
+		     tr->code, (u64)tr->data_size, (u64)tr->offsets_size,
 		     return_error_line);
 
 	if (target_thread)
-- 
2.47.1.613.gc27f4b7a9f-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] binder: log transaction code on failure
  2025-01-10  0:05 [PATCH] binder: log transaction code on failure Carlos Llamas
@ 2025-01-10 12:11 ` Alice Ryhl
  2025-01-10 17:43   ` Carlos Llamas
  2025-01-10 17:50   ` [PATCH v2] " Carlos Llamas
  0 siblings, 2 replies; 5+ messages in thread
From: Alice Ryhl @ 2025-01-10 12:11 UTC (permalink / raw)
  To: Carlos Llamas
  Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner,
	Suren Baghdasaryan, linux-kernel, kernel-team, Steven Moreland

On Fri, Jan 10, 2025 at 1:05 AM Carlos Llamas <cmllamas@google.com> wrote:
>
> When a transaction fails, log the 'tr->code' to help indentify the
> problematic userspace call path. This additional information will
> simplify debugging efforts.
>
> Cc: Steven Moreland <smoreland@google.com>
> Signed-off-by: Carlos Llamas <cmllamas@google.com>
> ---
>  drivers/android/binder.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index ef353ca13c35..cb4187a4e595 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -3801,13 +3801,13 @@ static void binder_transaction(struct binder_proc *proc,
>         }
>
>         binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
> -                    "%d:%d transaction %s to %d:%d failed %d/%d/%d, size %lld-%lld line %d\n",
> +                    "%d:%d transaction %s to %d:%d failed %d/%d/%d, code %d size %lld-%lld line %d\n",

Shouldn't this by %u instead?

Alice

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] binder: log transaction code on failure
  2025-01-10 12:11 ` Alice Ryhl
@ 2025-01-10 17:43   ` Carlos Llamas
  2025-01-10 17:50   ` [PATCH v2] " Carlos Llamas
  1 sibling, 0 replies; 5+ messages in thread
From: Carlos Llamas @ 2025-01-10 17:43 UTC (permalink / raw)
  To: Alice Ryhl
  Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner,
	Suren Baghdasaryan, linux-kernel, kernel-team, Steven Moreland

On Fri, Jan 10, 2025 at 01:11:32PM +0100, Alice Ryhl wrote:
> On Fri, Jan 10, 2025 at 1:05 AM Carlos Llamas <cmllamas@google.com> wrote:
> >
> > When a transaction fails, log the 'tr->code' to help indentify the
> > problematic userspace call path. This additional information will
> > simplify debugging efforts.
> >
> > Cc: Steven Moreland <smoreland@google.com>
> > Signed-off-by: Carlos Llamas <cmllamas@google.com>
> > ---
> >  drivers/android/binder.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> > index ef353ca13c35..cb4187a4e595 100644
> > --- a/drivers/android/binder.c
> > +++ b/drivers/android/binder.c
> > @@ -3801,13 +3801,13 @@ static void binder_transaction(struct binder_proc *proc,
> >         }
> >
> >         binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
> > -                    "%d:%d transaction %s to %d:%d failed %d/%d/%d, size %lld-%lld line %d\n",
> > +                    "%d:%d transaction %s to %d:%d failed %d/%d/%d, code %d size %lld-%lld line %d\n",
> 
> Shouldn't this by %u instead?

Yes, with tr->code being u32 it technically should use %u. I'll send a
new version. Thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] binder: log transaction code on failure
  2025-01-10 12:11 ` Alice Ryhl
  2025-01-10 17:43   ` Carlos Llamas
@ 2025-01-10 17:50   ` Carlos Llamas
  2025-01-10 22:16     ` Alice Ryhl
  1 sibling, 1 reply; 5+ messages in thread
From: Carlos Llamas @ 2025-01-10 17:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
	Suren Baghdasaryan
  Cc: linux-kernel, kernel-team, Steven Moreland

When a transaction fails, log the 'tr->code' to help indentify the
problematic userspace call path. This additional information will
simplify debugging efforts.

Cc: Steven Moreland <smoreland@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
---

Notes:
    v2: use %u format specifier per Alice's feedback

 drivers/android/binder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index ef353ca13c35..45c70644aee5 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -3801,13 +3801,13 @@ static void binder_transaction(struct binder_proc *proc,
 	}
 
 	binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
-		     "%d:%d transaction %s to %d:%d failed %d/%d/%d, size %lld-%lld line %d\n",
+		     "%d:%d transaction %s to %d:%d failed %d/%d/%d, code %u size %lld-%lld line %d\n",
 		     proc->pid, thread->pid, reply ? "reply" :
 		     (tr->flags & TF_ONE_WAY ? "async" : "call"),
 		     target_proc ? target_proc->pid : 0,
 		     target_thread ? target_thread->pid : 0,
 		     t_debug_id, return_error, return_error_param,
-		     (u64)tr->data_size, (u64)tr->offsets_size,
+		     tr->code, (u64)tr->data_size, (u64)tr->offsets_size,
 		     return_error_line);
 
 	if (target_thread)
-- 
2.47.1.613.gc27f4b7a9f-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] binder: log transaction code on failure
  2025-01-10 17:50   ` [PATCH v2] " Carlos Llamas
@ 2025-01-10 22:16     ` Alice Ryhl
  0 siblings, 0 replies; 5+ messages in thread
From: Alice Ryhl @ 2025-01-10 22:16 UTC (permalink / raw)
  To: Carlos Llamas
  Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner,
	Suren Baghdasaryan, linux-kernel, kernel-team, Steven Moreland

On Fri, Jan 10, 2025 at 6:51 PM Carlos Llamas <cmllamas@google.com> wrote:
>
> When a transaction fails, log the 'tr->code' to help indentify the
> problematic userspace call path. This additional information will
> simplify debugging efforts.
>
> Cc: Steven Moreland <smoreland@google.com>
> Signed-off-by: Carlos Llamas <cmllamas@google.com>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-10 22:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-10  0:05 [PATCH] binder: log transaction code on failure Carlos Llamas
2025-01-10 12:11 ` Alice Ryhl
2025-01-10 17:43   ` Carlos Llamas
2025-01-10 17:50   ` [PATCH v2] " Carlos Llamas
2025-01-10 22:16     ` Alice Ryhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox