Simon Que | f70060c | 2012-04-09 19:07:07 -0700 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Ken Mixter | c49dbd4 | 2010-12-14 17:44:11 -0800 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can |
| 3 | # be found in the LICENSE file. |
| 4 | |
| 5 | # This file has the format: |
| 6 | # <basename>:<shell command>\n |
| 7 | # |
| 8 | # Where when any executable with the basename <basename> crashes, the |
| 9 | # given <shell command> is executed and its standard output and |
| 10 | # standard error is sent along with the crash report. |
| 11 | # |
| 12 | # Use caution in modifying this file. Only run common unix commands |
| 13 | # here as these commands will be run when a crash has recently |
| 14 | # occurred and we should avoid running anything that might cause |
| 15 | # another crash. Similarly these command block the notification of |
| 16 | # the crash to parent processes, so commands should execute quickly. |
Daniel Erat | 7e3b76d | 2015-01-26 18:03:30 -0700 | [diff] [blame^] | 17 | # Commands cannot contain colons. |
| 18 | |
Ken Mixter | c49dbd4 | 2010-12-14 17:44:11 -0800 | [diff] [blame] | 19 | update_engine:cat $(ls -1tr /var/log/update_engine | tail -5 | sed s.^./var/log/update_engine/.) | tail -c 50000 |
Daniel Erat | 7e3b76d | 2015-01-26 18:03:30 -0700 | [diff] [blame^] | 20 | |
Ben Chan | 557bf45 | 2012-03-14 16:51:01 -0700 | [diff] [blame] | 21 | # The cros_installer output is logged into the update engine log file, |
| 22 | # so it is handled in the same way as update_engine. |
| 23 | cros_installer:cat $(ls -1tr /var/log/update_engine | tail -5 | sed s.^./var/log/update_engine/.) | tail -c 50000 |
Ken Mixter | c49dbd4 | 2010-12-14 17:44:11 -0800 | [diff] [blame] | 24 | |
Daniel Erat | 8f5546a | 2015-01-21 16:24:08 -0700 | [diff] [blame] | 25 | # Dump the last 20 lines of the last two files in Chrome's system and user log |
Daniel Erat | 7e3b76d | 2015-01-26 18:03:30 -0700 | [diff] [blame^] | 26 | # directories, along with the last 20 messages from the session manager. |
| 27 | chrome:for f in $(ls -1rt /var/log/chrome/chrome_[0-9]* | tail -2) $(ls -1rt /home/chronos/u-*/log/chrome_[0-9]* 2>/dev/null | tail -2); do echo "===$f (tail)==="; tail -20 $f; echo EOF; echo; done; echo "===session_manager (tail)==="; awk '$3 ~ "^session_manager\[" { print }' /var/log/messages | tail -20; echo EOF |
Daniel Erat | 8f5546a | 2015-01-21 16:24:08 -0700 | [diff] [blame] | 28 | |
Ken Mixter | 1b8fe01 | 2011-01-25 13:33:05 -0800 | [diff] [blame] | 29 | # The following rule is used for generating additional diagnostics when |
| 30 | # collection of user crashes fails. This output should not be too large |
Michael Krebs | c046f57 | 2011-04-07 14:42:14 -0700 | [diff] [blame] | 31 | # as it is stored in memory. The output format specified for 'ps' is the |
| 32 | # same as with the "u" ("user-oriented") option, except it doesn't show |
| 33 | # the commands' arguments (i.e. "comm" instead of "command"). |
Michael Krebs | bc2d7dd | 2012-09-12 20:31:20 -0700 | [diff] [blame] | 34 | crash_reporter-user-collection:echo "===ps output==="; ps axw -o user,pid,%cpu,%mem,vsz,rss,tname,stat,start_time,bsdtime,comm | tail -c 25000; echo "===meminfo==="; cat /proc/meminfo |
Ken Mixter | 1b8fe01 | 2011-01-25 13:33:05 -0800 | [diff] [blame] | 35 | |
Simon Que | f70060c | 2012-04-09 19:07:07 -0700 | [diff] [blame] | 36 | # This rule is similar to the crash_reporter-user-collection rule, except it is |
| 37 | # run for kernel errors reported through udev events. |
| 38 | crash_reporter-udev-collection-change-card0-drm:for dri in /sys/kernel/debug/dri/*; do echo "===$dri/i915_error_state==="; cat $dri/i915_error_state; done |
| 39 | |
Yufeng Shen | bbda078 | 2012-11-05 17:06:34 -0500 | [diff] [blame] | 40 | # When trackpad driver cyapa detects some abnormal behavior, we collect |
| 41 | # additional logs from kernel messages. |
Yufeng Shen | 5f23bbb | 2013-04-16 15:00:27 -0400 | [diff] [blame] | 42 | crash_reporter-udev-collection-change--i2c-cyapa:/usr/sbin/kernel_log_collector.sh cyapa 30 |
| 43 | # When trackpad/touchscreen driver atmel_mxt_ts detects some abnormal behavior, we collect |
| 44 | # additional logs from kernel messages. |
| 45 | crash_reporter-udev-collection-change--i2c-atmel_mxt_ts:/usr/sbin/kernel_log_collector.sh atmel 30 |
Yufeng Shen | 0b78311 | 2012-12-20 12:19:55 -0500 | [diff] [blame] | 46 | # When touch device noise are detected, we collect relevant logs. (crosbug.com/p/16788) |
| 47 | crash_reporter-udev-collection---TouchNoise:cat /var/log/touch_noise.log |
Yufeng Shen | ebb86ae | 2013-01-15 19:55:09 -0500 | [diff] [blame] | 48 | # Periodically collect touch event log for debugging (crosbug.com/p/17244) |
| 49 | crash_reporter-udev-collection---TouchEvent:cat /var/log/touch_event.log |
Daniel Erat | f290e98 | 2014-09-02 16:26:20 -0700 | [diff] [blame] | 50 | |
| 51 | # Dump the last 50 lines of the last two powerd log files -- if the job has |
| 52 | # already restarted, we want to see the end of the previous instance's logs. |
| 53 | powerd:for f in $(ls -1tr /var/log/power_manager/powerd.[0-9]* | tail -2); do echo "===$(basename $f) (tail)==="; tail -50 $f; echo EOF; done |
| 54 | # If power_supply_info aborts (due to e.g. a bad battery), its failure message |
| 55 | # could end up in various places depending on which process was running it. |
| 56 | # Attach the end of powerd's log since it might've also logged the underlying |
| 57 | # problem. |
| 58 | power_supply_info:echo "===powerd.LATEST (tail)==="; tail -50 /var/log/power_manager/powerd.LATEST; echo EOF |
| 59 | # powerd_setuid_helper gets run by powerd, so its stdout/stderr will be mixed in |
| 60 | # with powerd's stdout/stderr. |
| 61 | powerd_setuid_helper:echo "===powerd.OUT (tail)==="; tail -50 /var/log/powerd.out; echo EOF |
| 62 | |
Ken Mixter | c49dbd4 | 2010-12-14 17:44:11 -0800 | [diff] [blame] | 63 | # The following rules are only for testing purposes. |
| 64 | crash_log_test:echo hello world |
Dale Curtis | c4e01cc | 2011-01-10 11:49:50 -0800 | [diff] [blame] | 65 | crash_log_recursion_test:sleep 1 && /usr/local/autotest/tests/crash_log_recursion_test |