Commit graph

216 commits

Author SHA1 Message Date
Steve Fung
6e13952269 crash: Remove glib from crash_reporter
As part of the minimization effort, refactor crash_reporter code to
not depend directly on glib.

BUG=brillo:87, brillo:88, chromium:435314
TEST=`FEATURES=test emerge-panther libchromeos debugd crash-reporter`
TEST=Enabled crash reports; Browsed to chrome://crash; crash files \
     generated; `FORCE_OFFICIAL=1 SECONDS_SEND_SPREAD=1 crash_sender` \
     /var/log/messages shows crash id, report shows all expected files
TEST=`cbuildbot --remote -p chromiumos/platform2 amd64-generic-full`
CQ-DEPEND=I00331e0bf29195b41cd84d4495ab47738a5a41de
CQ-DEPEND=I9df752d8995773adb56fab34dd97626f3ddf1765

Change-Id: I48b366198a7f89ca55259603cf8470e4d59321bf
Reviewed-on: https://chromium-review.googlesource.com/246441
Reviewed-by: Dan Erat <derat@chromium.org>
Tested-by: Steve Fung <stevefung@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
2015-02-11 04:48:44 +00:00
Daniel Erat
efa91c05b1 crash: Shorten crash-reporter project alias.
Add a .project_alias file so that crash reporter changes
can/must be prefixed with "crash: " rather than
"crash-reporter: ".

BUG=none
TEST=uploaded this change

Change-Id: Iea849873cb061650909eecdc911d8805f17bc4c5
Reviewed-on: https://chromium-review.googlesource.com/244240
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
2015-01-30 05:10:46 +00:00
Daniel Erat
731da3379b crash-reporter: Use chromeos::KeyValueStore.
Make the crash reporter use libchromeos's KeyValueStore
class to read its log-collection config file and
/etc/lsb-release instead of its own parsing code.

Also update the log-collection config file to split long
commands across multiple lines and to use '=' instead of ':'
to separate executable names from commands.

BUG=chromium:452520
TEST=updated tests; also triggered powerd and chrome crashes
     and checked that logs were attached

Change-Id: I4e2447712869608f32a4ae38f5d5cb9c6046af14
Reviewed-on: https://chromium-review.googlesource.com/244121
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
2015-01-29 21:35:39 +00:00
Daniel Erat
d257ea1cbe crash-reporter: Clean up testing code.
Link all of the crash reporter's tests into a single
crash_reporter_test executable instead of building separate
binaries that lead to a bunch of duplication.

BUG=none
TEST=tests pass
CQ-DEPEND=I7f6623dd0ae36395efac89bdcfae54926ea6c918

Change-Id: I18e2d929d6545e7d05e88232bdaec089ae620544
Reviewed-on: https://chromium-review.googlesource.com/243940
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
Trybot-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
2015-01-29 03:48:19 +00:00
Daniel Erat
7e3b76d81f crash-reporter: Add session_manager logs to Chrome crashes.
Attach the last twenty session_manager messages from
/var/log/messages to Chrome crash reports.

BUG=chromium:233833
TEST=manual: triggered a crash and checked chrome.txt in the
     crash report (1f8c6ff259947e7a)

Change-Id: I733b448ccc6e01111556a5a632e185cc58dfd917
Reviewed-on: https://chromium-review.googlesource.com/243378
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
2015-01-28 08:01:31 +00:00
Daniel Erat
8f5546adf9 crash-reporter: Attach Chrome logs to crash reports.
When Chrome crashes, gather the last 20 lines of each of the
latest two log files in /var/log/chrome and
/home/chronos/user/log. Attach them as gzipped metadata
using a "chrome.txt" key name and rename the GPU error state
key to "i915_error_state.log.xz".

(Re-landing after privacy review; originally reviewed at
https://chromium-review.googlesource.com/216427. Changes
since previous iteration include attaching the Chrome logs
and the GPU state separately and redirecting stderr to
/dev/null when listing user Chrome log files to avoid log
spam in the not-logged-in case.)

BUG=chromium:405732
TEST=triggered crashes and verified that logs were included
     in crash reports: b7c4d7f2bee32e2f, 6292f090468fcf28
CQ-DEPEND=CL:242492

Change-Id: I1642a8971f1373726e5b0e3977dbfdbcc2aa6667
Reviewed-on: https://chromium-review.googlesource.com/242457
Commit-Queue: Dan Erat <derat@chromium.org>
Trybot-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2015-01-24 17:00:50 +00:00
Ben Zhang
1c5533d4cd crash-reporter: add a sanity check for kernel dmesg records
On some devices, after a cold boot, a junk pstore record
/dev/pstore/dmesg-ramoops-0 is created which is just a chunk
of uninitialized memory containing random bits, and it's not
the result of a kernel crash.

The sanity check scans for the dmesg log level pattern to
avoid creating junk .kcrash files.

BUG=chromium:443764
TEST=platform_KernelErrorPaths with 3.8 and 3.14 kernel;
check no kcrash file is created for random binary ramoops dump
on stumpy.

Change-Id: I83041436cd8e5e0c7c0015c529f462032ce82f30
Signed-off-by: Ben Zhang <benzh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/242147
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2015-01-22 05:13:33 +00:00
Alex Vakulenko
859ee45cd2 Update libchrome to r307740 and fix build errors
Updated libchrome, libchrome_crypto, metrics, feedback to the
latest revisions from Chrome (r307740).

Fixed build breaks due to the changes in upstream code:

- scope_ptr no longer needs explicit PassAs<T>() calls.
- scope_ptr<T> no longer has implicit conversion to T*.
  Must use scope_ptr<T>::get() instead.
- base/file_util.h moved to base/files/file_util.h
- ARRAYSIZE_UNSAFE() removed in favor of arraysize()
- base::AppendToFile() and base::WriteFileDescriptor() now
  return bool instead of the number of bytes written.
- dbus::Bus::AddFilterFunction() now returns void.
- C++11 features are enabled in libchromeos, so all targets
  linking with it now have to support C++11
- OVERRIDE macro is removed in favor of native C++11
  'override' keyword.

BUG=chromium:416628, chromium:411508
TEST=Build the world on x86, x64, ARM. The following builders
     were tried:
       x86-generic-full amd64-generic-full arm-generic-full
       amd64-generic-asan daisy-full nyan-full pre-cq-group
       daisy-release-group sandybridge-release-group
       pineview-release-group
CQ-DEPEND=CL:234450,CL:234980

Change-Id: I374bebe2211d533c4431c82efb8be1cdcb1f405d
Reviewed-on: https://chromium-review.googlesource.com/234440
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
2014-12-15 07:18:09 +00:00
Kees Cook
554c898d6a crash-reporter: disable device coredumps in verified mode
Device coredumps should only be available in developer mode.

BUG=None
TEST=link boot with devcoredump series

Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: Ia86c32310887199b268b1f71221c6eb8a02f7827
Reviewed-on: https://chromium-review.googlesource.com/231386
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2014-11-26 06:07:52 +00:00
Ben Zhang
8e5340a1d8 crash-reporter: accept kernel dmesg records with no ramoops header
pstore compression has been added since kernel 3.12. In order to
decompress dmesg correctly, ramoops driver has to strip the header
before handing over the record to the pstore driver, so we don't
need to do it in KernelCollector anymore.

The corresponding kernel patch is at
https://chromium-review.googlesource.com/#/c/211389

BUG=chromium:392248
TEST=platform_KernelErrorPaths passed on 3.14 kernel

Change-Id: If1bec43e640e0978c7573cc90befc6d68072373c
Signed-off-by: Ben Zhang <benzh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/211460
Reviewed-by: Kees Cook <keescook@chromium.org>
2014-11-06 02:28:25 +00:00
Steve Fung
d6169a2a4f crash-reporter: remove gflags dependency
We are switching to using chromeos/flag_helper.h instead to standardize the
code everywhere.

BUG=chromium:402631
TEST=`FEATURES=test emerge-panther crash-reporter`
TEST=`test_that -b panther <ip> e:logging_.*`

Change-Id: I62b911a54f89d853235d0540460cbea119f66e9e
Reviewed-on: https://chromium-review.googlesource.com/212140
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Steve Fung <stevefung@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
2014-10-07 05:53:25 +00:00
Mike Frysinger
6f891c5b3f crash-reporter: fix pstore detection
The current Enable logic looks for an existing crash rather than the
crash dir itself, so when we boot up clean we get a warning that we
do not support kernel crashes.

BUG=chromium:417350
TEST=`FEATURES=test emerge-link crash-reporter` passes
TEST=`cbuildbot amd64-generic-full` passes
TEST=booted VM and checked syslogs

Change-Id: I076a37889ea10ed30ae522eba007619b001ec787
Reviewed-on: https://chromium-review.googlesource.com/219751
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2014-09-25 10:45:28 +00:00
Ben Chan
c764139936 crash-reporter: Clean up angle brackets in template types.
C++11 no longer has the angle bracket pitfall in template types.

BUG=None
TEST=`FEATURES=test emerge-$BOARD crash-reporter`

Change-Id: I25410c458f730d8e0a38237b3711439262a1b774
Reviewed-on: https://chromium-review.googlesource.com/219194
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-09-22 05:59:28 +00:00
Mike Frysinger
f27140dd07 crash-reporter: log notification for chrome crashes
The standard crash collector logs a warning message every time it receives
a crash which makes reviewing system logs nice.  The chrome collector does
not do this which makes it a bit harder to track what the system is doing.
Add such a message to the chrome collector too.

BUG=chromium:415220
TEST=`cbuildbot amd64-generic-full` passes

Change-Id: I2b4c9990d99b780ed06d72be40b6ce5b95c1ee51
Reviewed-on: https://chromium-review.googlesource.com/218593
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2014-09-19 02:59:42 +00:00
Ben Chan
262d798b38 crash-reporter: Replace NULL with nullptr.
BUG=None
TEST=`FEATURES=test emerge-$BOARD crash-reporter`

Change-Id: If0804613ee0385752d01f7bbe01902ffef53bd94
Reviewed-on: https://chromium-review.googlesource.com/218870
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-09-19 02:59:36 +00:00
Daniel Erat
732bd3bb85 Revert "crash-reporter: Attach Chrome logs to crash reports."
I'm reverting this until I get a privacy review.

BUG=chromium:405732
TEST=none

Change-Id: Ib3af4752533f76c340d9b853be985bfc774104da
Reviewed-on: https://chromium-review.googlesource.com/218010
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
2014-09-13 01:18:55 +00:00
Daniel Erat
55cb40aa95 crash-reporter: Attach Chrome logs to crash reports.
When Chrome crashes, gather the last 20 lines of each of the
latest two log files in /var/log/chrome and
/home/chronos/user/log and include them in the archive file
that's attached to crash reports.

BUG=chromium:405732
TEST=triggered crashes at the login screen and after logging
     in and verified that logs were included in crash
     reports: bdf766f0d6d1e066, a9d410e1a86f996b

Change-Id: I09e3cee23af108dc216d64aae85d78751d5649d4
Reviewed-on: https://chromium-review.googlesource.com/216427
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>
2014-09-12 03:40:34 +00:00
Benjamin Lerman
c8cb4ac7ba Revert "crash-reporter: Replace the crash_sender script by a service daemon."
This reverts commit 38c5ad3a94762945456f8e25c78f464d9221bb84.

Was think it will go to the CQ.

Change-Id: Icbe21da107375b0975f6328623fd9cdd38f71b09
Reviewed-on: https://chromium-review.googlesource.com/217740
Reviewed-by: Benjamin Lerman <qsr@chromium.org>
Tested-by: Benjamin Lerman <qsr@chromium.org>
2014-09-11 12:44:16 +00:00
Benjamin Lerman
8e774579a0 crash-reporter: Replace the crash_sender script by a service daemon.
BUG=chromium:391887
TEST=Integration tests
CQ-DEPEND=I02ce7593fcfae4ba1d7d3ebdf3912901e635f1c9
CQ-DEPEND=I00315ad47657cebd9e8a4a0121ecb54114a7e200

Change-Id: I2f4546c82fb3769b5f3da5d22949551412096b10
Reviewed-on: https://chromium-review.googlesource.com/208671
Tested-by: Benjamin Lerman <qsr@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
2014-09-11 12:41:43 +00:00
Ben Chan
ab6cc90503 Update code to include base/files/file_util.h
file_util.h was moved from base to base/files
(https://codereview.chromium.org/468253002). This CL updates platform2
code to include base/files/file_util.h instead of base/file_util.h.

BUG=chromium:411001
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I488925b54615e131e508a460dc1a27f88168f936
Reviewed-on: https://chromium-review.googlesource.com/216851
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-09-09 21:00:34 +00:00
Ben Chan
b63e528a56 Update to build against libchrome-293518.
libchrome is updated from revision 271506 to 293518. This CL updates
platform2 code to build against libchrome-293518 with the following
changes:

- LOG_ERROR_REPORT is removed
  (https://codereview.chromium.org/331143007)

- StringToLowerASCII is moved to base namespace
  (https://codereview.chromium.org/448853002)

BUG=chromium:411001
CQ-DEPEND=CL:216584
CQ-DEPEND=CL:216585
CQ-DEPEND=CL:216586
CQ-DEPEND=CL:216511
CQ-DEPEND=CL:217084
CQ-DEPEND=CL:217085
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I9fbdad30b3a7c79c1ec4e208664b8befea31a3ec
Reviewed-on: https://chromium-review.googlesource.com/216589
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-09-09 21:00:00 +00:00
Ben Chan
895fa5d99f crash-reporter: Include base/macros.h instead of base/basictypes.h
crash-reporter no longer uses the integer types from base/basictypes.h.
It should simply include base/macros.h for the DISALLOW_COPY_AND_ASSIGN
macro instead. This CL also marks several classes
DISALLOW_COPY_AND_ASSIGN.

BUG=None
TEST=`FEATURES=test emerge-$BOARD crash-reporter`

Change-Id: I02c90916fdda63c4d4134ed87b13382ed2fbab26
Reviewed-on: https://chromium-review.googlesource.com/216009
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-09-03 22:47:54 +00:00
Daniel Erat
f290e9873e crash-reporter: Include powerd logs with crashes.
Attach relevant power manager logs to crash reports for
powerd, powerd_setuid_helper, and power_supply_info.

BUG=chromium:405727
TEST=induced crashes in powerd, powerd_setuid_helper, and
     power_supply_info, then forced crash reporting with
     "FORCE_OFFICIAL=1 crash_sender" and checked that the
     following crash reports had the expected data attached
     in the "Files" section:
     2f710954e30472b1 (powerd)
     e7d985b7dbd9d158 (powerd_setuid_helper)
     2213b0413fc9e408 (power_supply_info)

Change-Id: Icddb7d0b99eb19b95c656f8c06d8766733eaae28
Reviewed-on: https://chromium-review.googlesource.com/216020
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>
2014-09-03 19:30:30 +00:00
Ben Chan
f3811f50c8 crash-reporter: Replace scoped_ptr<char[]> with vector<char>.
BUG=None
TEST=`FEATURES=test emerge-$BOARD platform2`

Change-Id: I78d7766b49151f40f42ef00b8204fd2569b45991
Reviewed-on: https://chromium-review.googlesource.com/214780
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-08-29 16:59:08 +00:00
Thiemo Nagel
ea3941f630 crash-reporter: Fix overzealous crash purging in guest mode.
Previously, if crash_sender was invoked during a guest session all crashes that
could be accessed (i.e. that were stored outside of user directories) were
deleted.  This is fixed by re-ordering some of the conditions in send_crashes().

The problem had been introduced by 57f6efa4:
https://chromium-review.googlesource.com/200060

BUG=chromium:393334
TEST=unit tests passed
TEST=try success on amd64-generic-full

Change-Id: I931665891eca8e645135f7f08c15b3086fcb7d73
Reviewed-on: https://chromium-review.googlesource.com/213470
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Thiemo Nagel <tnagel@google.com>
Tested-by: Thiemo Nagel <tnagel@google.com>
2014-08-26 12:54:04 +00:00
Ben Chan
84c28d3b00 platform2: Remove legacy inherit-review-settings-ok files.
BUG=None
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I11a13e64cd1fd9e3394d1f298425d29204bb06aa
Reviewed-on: https://chromium-review.googlesource.com/212840
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-08-18 03:06:06 +00:00
Alex Vakulenko
0dfc9ceb8f platform2: Replace 'OVERRIDE' with 'override' and fix linter
Replace OVERRIDE macro with native C++ 'override' keyword.
Also fixed the style issue of using both 'override' and 'virtual'
on member function overrides. Only one is required and cpplint
complains if both are specified now.

BUG=None
TEST=Build all affected target and ran unit tests which passed.

Change-Id: I04474aacad2ca8d6c6042c84a5378961d5bd8bf2
Reviewed-on: https://chromium-review.googlesource.com/212180
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
2014-08-15 21:09:58 +00:00
Mike Frysinger
334b1ae26b crash-reporter: crash_sender: strip dashes from clientids
Since Chrome has started preserving the dashes, we have to strip them
ourselves when uploading reports.

BUG=chromium:398217
BUG=391338
TEST=`cbuildbot x86-generic-full` passes

Change-Id: I795fb7fd6feae3c4f97829a849f0271c61e84490
Reviewed-on: https://chromium-review.googlesource.com/212229
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2014-08-15 18:00:18 +00:00
Ben Chan
efec0b3625 crash-reporter: Use C++11 override specifier.
Also remove some unnecessary 'void' arguments.

BUG=None
TEST=`FEATURES=test emerge-$BOARD crash-reporter`

Change-Id: I0039aec93aae14cb238f284fda756b631f9c1587
Reviewed-on: https://chromium-review.googlesource.com/211959
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-08-13 05:28:01 +00:00
Alex Vakulenko
eaf060c265 platform2: move --std=gnu++11 flag to common-mk/common.gypi
A number of platform2 projects enabled C++11 features individually
in their .GYP files. Removed this flag from each of the projects
and added it to common.gypi for everyone to share.

BUG=None
TEST=Compile various platform2 targets to make sure they still compile.

Change-Id: I4136573ec5dcc988df2826056c8dae8847725504
Reviewed-on: https://chromium-review.googlesource.com/211534
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
2014-08-08 22:04:54 +00:00
Ben Chan
f84ea21aab crash-reporter: Use integer types from stdint.h
This CL replaces the deprecated int* and uint* types from
'base/basictypes.h' with the int*_t and uint*_t types from 'stdint.h'.

BUG=chromium:401356
TEST=`FEATURES=test emerge-$BOARD platform2`

Change-Id: I33086d64b33ac7d58b578705e95da31e6d6fb5fd
Reviewed-on: https://chromium-review.googlesource.com/211285
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-08-07 11:59:37 +00:00
Alex Vakulenko
7589aff9f0 crash-reporter: fix linter issues
Fixed various issues reported by cpplint.py when run on
src/platform2/crash-reporter.

BUG=None
TEST=FEATURES=test emerge-link crash-reporter
cpplint.py `find crash-reporter/* | grep "\.cc\|\.h"`

Change-Id: If874b3dbf539d2dd22cf740a0d3523225d1c61a7
Reviewed-on: https://chromium-review.googlesource.com/210418
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
2014-08-01 04:18:32 +00:00
Ben Chan
3c6b82c4c7 crash-reporter: Fix C++ style issues in KernelCollector.
BUG=None
TEST=`FEATURES=test emerge-$BOARD crash-reporter`

Change-Id: Ib33a23059878380425f6eb79385dc67141ad0f77
Reviewed-on: https://chromium-review.googlesource.com/209746
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-07-26 00:01:18 +00:00
Ben Chan
120c675df0 crash-reporter: Add MIPS support for KernelCollector.
BUG=chromium:396465
TEST=`FEATURES=test emerge-x86-generic crash-reporter`
TEST=`FEATURES=test emerge-amd64-generic crash-reporter`
TEST=`emerge-arm-generic crash-reporter`
TEST=`emerge-mipsel-o32-generic-generic crash-reporter`

Change-Id: I270b56d3f0b6941c97ebec6e736230701e5c3e1f
Reviewed-on: https://chromium-review.googlesource.com/209485
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-07-23 23:14:59 +00:00
Bertrand SIMONNET
f7ad519b3d Remove the dependency of platform.gyp to crash-reporter
We are creating a standalone ebuild for crash-reporter. platform.gyp should not
depend on crash-reporter.gyp as crash-reporter will be build and installed by
chromeos-base/crash-reporter.

BUG=chromium:391999
TEST=FEATURES=test emerge-amd64-generic platform2.
TEST=FEATURES=test emerge-amd64-generic crash-reporter.

CQ-DEPEND=CL:206918

Change-Id: I726ed0c847e361b7f03c2ef82fbb8410f40b6c80
Reviewed-on: https://chromium-review.googlesource.com/206919
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
2014-07-14 18:39:14 +00:00
Ben Chan
ae88303ac0 platform2: Remove redundant LICENSE files.
There is a common LICENSE file at the top level of the platform2
repository. The LICENSE files in individual packages are no longer
necessary and thus removed by this CL.

BUG=None
TEST=Trybot runs on paladin, release, and chromiumos-sdk builders.

Change-Id: If9e26ef5e40c8e3ada4d7d29575bcdf61edfb39d
Reviewed-on: https://chromium-review.googlesource.com/206947
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-07-08 19:30:27 +00:00
Bertrand SIMONNET
9769dc865b Update gyp files to depend on metrics' standalone ebuild.
Metrics is now installed by chromeos-base/metrics.
Platform2 packages should depend on it through the variable:deps mechanism
instead of depending directly on metrics' gyp file.

BUG=chromium:387923
TEST=Build platform2. metrics gets installed and the tests succeed.
TEST=Trybot run on daisy-release, lumpy-incremental-paladin, link-release,
  duck-release, x86-mario-release.

CQ-DEPEND=CL:205312

Change-Id: I07607d5fa574ce3c273fc4189590453edbee2aa4
Reviewed-on: https://chromium-review.googlesource.com/205299
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
2014-06-26 02:31:43 +00:00
Bertrand SIMONNET
04661e3375 crash-reporter: Create a standalone ebuild for system_api
system_api is required by a lot of platform2 packages. We need it to be in a
standalone ebuild in order for other packages to depend on it.

This package installs the common headers and compiles the protobufs into static
libraries.

BUG=chromium:386223
TEST=FEATURES=test emerge-amd64-generic platform2.
TEST=trybot run on daisy, link, duck, x86-mario.
TEST=trybot run on lumpy-incremental-release.

CQ-DEPEND=CL:204594

Change-Id: I235b5baf03a4497352f7d53ab68326ddb4e9676a
Reviewed-on: https://chromium-review.googlesource.com/204581
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
2014-06-21 02:23:09 +00:00
Ben Chan
7e77690375 crash-reporter: Fix coding style and cpplint issues.
BUG=chromium:385849
TEST=`FEATURES=test emerge-$BOARD platform2`
TEST=`cpplint.py --filter=--build/header_guard,-build/include_order *.h *.cc`

Change-Id: I3c24dd9487df50cdb22fc1c7739c9e95e452afae
Reviewed-on: https://chromium-review.googlesource.com/204487
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-06-19 03:32:02 +00:00
Bertrand SIMONNET
f7181dfe7a crash-reporter: Migrate libchromeos to its own ebuild
All platform2 packages should have their own ebuild that will be compiled
independently. Packages should DEPEND on libchromeos and should not have a gyp
dependency on libchromeos's gyp file anymore.

BUG=chromium:381372
TEST=emerge-daisy libchromeos && emerge-daisy platform2 work
TEST=trybot run on daisy, link, mario and duck.
TEST=trybot run on lumpy-incremental-paladin.

CQ-DEPEND=CL:202748

Change-Id: I2f6fe6e8572a533d74931db2dd850fe31d9041dc
Reviewed-on: https://chromium-review.googlesource.com/202762
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
2014-06-18 11:00:28 +00:00
Bertrand SIMONNET
cb373dd610 crash-reporter: Update gyp files to use libchromeos from src/platform2
libchromeos was moved from src/platform to src/platform2. This CL updates
the gyp files to use the new location.

BUG=chromium:370258
TEST=FEATURES=test emerge-amd64-generic platform2
TEST=trybot run on daisy, link, mario and duck

CQ-DEPEND=CL:202334

Change-Id: I8536a08aee17073be8544b7e60b205aafb2e0828
Reviewed-on: https://chromium-review.googlesource.com/202337
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
2014-06-03 04:25:20 +00:00
Bertrand SIMONNET
6f970ed8fc crash-reporter: Update gyp file to use src/platform2/common-mk
We are moving the packages built by platform2's ebuild into src/platform2.
We need packages to use src/platform2/common-mk instead of
src/platform/common-mk.

BUG=chromium:378554
TEST=emerge-daisy platform2
TEST=trybot run on daisy, link, mario and duck

CQ-DEPEND=CL:201938

Change-Id: Ic154c59f61f7f95df5678a2033b74983b12f4dec
Reviewed-on: https://chromium-review.googlesource.com/201967
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
2014-05-31 01:46:26 +00:00
Mike Frysinger
14129966b0 crash_sender: delete redundant logic for parallel runs
A recent commit added global locking support via `flock` (see CL:65556).
With that in place, we no longer need this ad-hoc pid checking.  Advantage
is that the flock is race free (both with file reads/writes and pid #s).

BUG=chromium:199491
TEST=`cbuildbot x86-generic-full` works
TEST=`crash_sender` on board works
CQ-DEPEND=CL:201495

Change-Id: I00d48544856cc5fad60c6129f5c193abdde45f02
Reviewed-on: https://chromium-review.googlesource.com/169486
Reviewed-by: Rohit Makasana <rohitbm@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2014-05-30 23:28:02 +00:00
Thiemo Nagel
47785c0e17 crash_sender: re-order send_crashes() logic
send_crashes() is re-ordered to make sure that crashes are
deleted at the earliest possible point in time, especially that
crash deleting cannot be blocked if the crash upload pipeline is
blocked for some reason.  The intention is to free disk space as
soon as possible, but there are also privacy implications of
removing crash data as soon as it is determined that the user has
not consented to its upload.

BUG=chromium:338977
TEST=`cbuildbot x86-generic-full` passes
CQ-DEPEND=CL:200553

Change-Id: I797cf8430185b0d2a4c3e615c6803e95b59c8ac7
Reviewed-on: https://chromium-review.googlesource.com/200060
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2014-05-28 08:07:48 +00:00
Mike Frysinger
0e31ecbde5 crash-sender: set timeout to 4 hours
A single run of crash_sender might take some time to upload a report
(if the connection is pretty slow).  Give the system 4 hours to upload
at least one report.

BUG=chromium:377981
TEST=`cbuildbot x86-generic-full` passes
CQ-DEPEND=CL:201719

Change-Id: I4d3870b961653c7f0ca85e1015f371919125e846
Reviewed-on: https://chromium-review.googlesource.com/201404
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2014-05-28 04:51:46 +00:00
Ben Chan
f30c641225 crash-reporter: Update to build against libchrome-271506.
BUG=chromium:375032
TEST=`FEATURES=test emerge-$BOARD platform2`

Change-Id: I3984dee513690711e277e5fa8939ca5f7910d180
Reviewed-on: https://chromium-review.googlesource.com/201184
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2014-05-23 17:56:22 +00:00
Thiemo Nagel
a39667d908 crash_sender: ignore missing files to prevent upload failure
Don't try to upload missing files, instead send the reports without them to
avoid failure in curl, breaking the cycle of try-fail-try-fail.

BUG=chromium:338977
TEST=manual test by copying the script to a Chromebook
CQ-DEPEND=CL:200061

Change-Id: If35828b48b7746bdfae519e4777cc0d7e9245e0e
Reviewed-on: https://chromium-review.googlesource.com/199070
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2014-05-22 02:25:04 +00:00
Thiemo Nagel
3029e6facb crash_sender: add 30sec holdoff for fresh crashes
As a rule, the .meta file of a crash report should only be
created after the corresponding crash data files have been
written to avoid the crash report to be sent prematurely without
data files.  Merely as an additional safeguard, this changeset
prevents a crash report to be sent within 30 seconds of writing
the .meta file.  This functionality integrates with the existing
sleep due to SECONDS_SEND_SPREAD.

BUG=chromium:338977
TEST=`cbuildbot x86-generic-full` passes

Change-Id: Id3651eb697527ca5b976274933b0ca2ee09870e2
Reviewed-on: https://chromium-review.googlesource.com/200061
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2014-05-21 04:17:53 +00:00
Thiemo Nagel
369af352e3 crash_sender: remove obsolete is_on_3g(), improve comment
BUG=None
TEST=`cbuildbot x86-generic-full` passed

Change-Id: I49e259d42b1edaf0fb43ee912fa99799ca87f08c
Reviewed-on: https://chromium-review.googlesource.com/200440
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2014-05-19 23:06:01 +00:00
Thiemo Nagel
9895096f8b crash_sender: fix orphan logic, prevent deletion of *.log.tar.xz
get_base() was broken for files with multiple extensions which leads the orphan
logic to delete all such files that are older than 1 day.  This patch set fixes
get_base().

BUG=chromium:338977
TEST=manual test of code fragment
TEST=`cbuildbot {arm,amd64,x86}-generic-full` pass
CQ-DEPEND=CL:199820

Change-Id: I1b712f1a5cfc848e5bc2a86c97e0a3e88ce6250d
Reviewed-on: https://chromium-review.googlesource.com/199511
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2014-05-16 06:32:04 +00:00