From: Carlos Llamas <cmllamas@google.com>
To: Chuang Zhang <zhangchuang3@xiaomi.corp-partner.google.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
arve@android.com, tkjos@android.com, maco@android.com,
joel@joelfernandes.org, brauner@kernel.org, surenb@google.com,
linux-kernel@vger.kernel.org,
Chuang Zhang <zhangchuang3@xiaomi.com>
Subject: Re: [PATCH] Binder: Add timestamp and async from pid/tid to transaction record
Date: Thu, 20 Apr 2023 14:28:34 +0000 [thread overview]
Message-ID: <ZEFMEsPIR3fl/SUV@google.com> (raw)
In-Reply-To: <CAO+dPF9cb5tQzNkuO4hniTfWesACbr4z2YvT8XKj4afFgyYjjw@mail.gmail.com>
On Mon, Apr 17, 2023 at 03:14:55PM +0800, Chuang Zhang wrote:
>
> [chuang] Android's ANR and Watchdog problems are often caused by calling
> Binder's server interface and waiting synchronously for too long. In order
> to
> confirm this root-casue, we need to let system_server read the relevant
> nodes
> of binderfs to obtain the transmission when the above failure occurs
> information,
> including of course the time-consuming of the transmission.
> He will help many Android application and system engineers to quickly
> analyze related faults.
> Because we need to obtain time-consuming information in real time when ANR
> or Watchdog occurs, this happens more when consumers use it, and they
> cannot effectively capture atrace, so Perfetto cannot be applied.
Fair enough, this sounds good to me then.
>
> [chuang]As you can see below, in fact, we only need to print the PID and
> TID
> of "from" when printing binder transaction records in
> print_binder_transaction_ilocked,
> which can be printed correctly regardless of whether it is asynchronous or
> synchronous.
> It is just because the PID and TID of "from" can be obtained through
> t->from in
> synchronous mode, while t->from in asynchronous mode cannot be obtained
> because it is not populated.
> So can I directly add new variables from_pid and from_tid to record all
> transmissions? Does it matter if the naming includes the pid? Greg has
> expressed some concerns about this before .
Right, lets populate t->from_pid and t->from_tid for all transactions
and use those only in print_binder_transaction() instead of t->from.
As Greg mentioned, please add these in a separate commit.
About the namespaces, Greg's comments seem accurate. Binder is using the
task->pid directly so the PIDs would not match those seen by the
namespace. This points to a larger issue in binder as we log these
"raw" pid values everywhere. I'll look further into this and come up
with a binder global fix in a separate commit, so just ignore for now.
Thanks,
--
Carlos Llamas
next prev parent reply other threads:[~2023-04-20 14:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 10:40 [PATCH] Binder: Add timestamp and async from pid/tid to transaction record Chuang Zhang
2023-04-13 10:51 ` Greg KH
[not found] ` <CAO+dPF9KFJe5h4wO47ypL2-__3+1mnzurdRcj6OCQ1wdku_7cA@mail.gmail.com>
2023-04-13 12:17 ` Greg KH
[not found] ` <CAO+dPF-YNtaZvVax8Z1QD9VtG36uc2C=uus4eR4H_vipEzu8Dw@mail.gmail.com>
2023-04-13 12:36 ` Greg KH
[not found] ` <CAO+dPF8inueprEXeNMBWZtiqDzcjFQLbKLVq+qL0gGq3gRBu3w@mail.gmail.com>
2023-04-13 15:06 ` Greg KH
2023-04-14 21:03 ` Carlos Llamas
[not found] ` <CAO+dPF9cb5tQzNkuO4hniTfWesACbr4z2YvT8XKj4afFgyYjjw@mail.gmail.com>
2023-04-20 14:28 ` Carlos Llamas [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-04-13 9:38 Chuang Zhang
2023-04-13 10:17 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZEFMEsPIR3fl/SUV@google.com \
--to=cmllamas@google.com \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=surenb@google.com \
--cc=tkjos@android.com \
--cc=zhangchuang3@xiaomi.com \
--cc=zhangchuang3@xiaomi.corp-partner.google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.