blob: 0e233d9c86e409576672e28a1cdd666dfe3e3c13 [file] [log] [blame]
Simon Quef70060c2012-04-09 19:07:07 -07001# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Ken Mixterc49dbd42010-12-14 17:44:11 -08002# 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.
17#
18update_engine:cat $(ls -1tr /var/log/update_engine | tail -5 | sed s.^./var/log/update_engine/.) | tail -c 50000
Ben Chan557bf452012-03-14 16:51:01 -070019# The cros_installer output is logged into the update engine log file,
20# so it is handled in the same way as update_engine.
21cros_installer:cat $(ls -1tr /var/log/update_engine | tail -5 | sed s.^./var/log/update_engine/.) | tail -c 50000
Ken Mixterc49dbd42010-12-14 17:44:11 -080022
Ken Mixter1b8fe012011-01-25 13:33:05 -080023# The following rule is used for generating additional diagnostics when
24# collection of user crashes fails. This output should not be too large
Michael Krebsc046f572011-04-07 14:42:14 -070025# as it is stored in memory. The output format specified for 'ps' is the
26# same as with the "u" ("user-oriented") option, except it doesn't show
27# the commands' arguments (i.e. "comm" instead of "command").
Michael Krebsbc2d7dd2012-09-12 20:31:20 -070028crash_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 Mixter1b8fe012011-01-25 13:33:05 -080029
Simon Quef70060c2012-04-09 19:07:07 -070030# This rule is similar to the crash_reporter-user-collection rule, except it is
31# run for kernel errors reported through udev events.
32crash_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
33
Michael Krebsed61be62012-12-05 15:13:08 -080034# TODO(mkrebs,sabercrombie): Because these can be quite large (600KB
35# compressed), remove this when GPU hangs are no longer an issue, and/or we
36# start collecting "chrome" crashes for normal images.
37# Collect i915 error state for Chrome crashes as well. See
38# crosbug.com/36979. These can be big (i.e. megabytes), so compress them with
39# gzip. Note that the file attached to the crash report will have a ".log"
40# extension, but will have been gzip'ed.
41chrome:for dri in /sys/kernel/debug/dri/*; do echo "===$dri/i915_error_state==="; cat $dri/i915_error_state; done | gzip -c
42
Yufeng Shenbbda0782012-11-05 17:06:34 -050043# When trackpad driver cyapa detects some abnormal behavior, we collect
44# additional logs from kernel messages.
45crash_reporter-udev-collection-change--i2c-cyapa:grep cyapa /var/log/messages
Yufeng Shen0b783112012-12-20 12:19:55 -050046# When touch device noise are detected, we collect relevant logs. (crosbug.com/p/16788)
47crash_reporter-udev-collection---TouchNoise:cat /var/log/touch_noise.log
Yufeng Shenebb86ae2013-01-15 19:55:09 -050048# Periodically collect touch event log for debugging (crosbug.com/p/17244)
49crash_reporter-udev-collection---TouchEvent:cat /var/log/touch_event.log
Ken Mixterc49dbd42010-12-14 17:44:11 -080050# The following rules are only for testing purposes.
51crash_log_test:echo hello world
Dale Curtisc4e01cc2011-01-10 11:49:50 -080052crash_log_recursion_test:sleep 1 && /usr/local/autotest/tests/crash_log_recursion_test