add support for multiprofile

Update crash_sender to scan /home/chronos/u-*/crash/ paths since it's
a shell script and there's no easy way to get the right info via shell
commands.  We want to scan all paths in case of different ordering.

For crash_collector, update it to use SessionManager's dbus call to
query the active profiles.  We select the first one and use that to
process crashes.  This should be fine.

We also need to handle the edge case where no user is logged in (yet a
crash occurs with a program running as chronos uid; e.g. the login).
In the past, we just wrote to /home/chronos/user/crash/ even when there
wasn't a user home dir mounted there.  With this change, we formalize
(and document) things a bit more by moving to /home/chronos/crash/.  We
want this behavior rather than re-using the system path as our tests
specifically verify system vs user crashes.

TEST=`cros_run_unit_tests --board=x86-alex -p crash-reporter` passes
TEST=logging_UserCrash autotest passes in a vm

Change-Id: If9f2ffd0740533537718b2a5e7d215200f5a41d6
Reviewed-by: Mike Frysinger <>
Tested-by: Mike Frysinger <>
Commit-Queue: Mike Frysinger <>
7 files changed
tree: 9096c23705127e877eb0f6c39e26c9a07035b2e5
  1. crash_reporter/