Add udev event-based crash reporting

This allows crash_reporter to handle nonfatal errors from the kernel
passed thru udev events.  There is a udev .rules file for invoking crash
reporter.  Currently it supports DRM error info logging.

BUG=chrome-os-partner:6492
TEST=Run:
"crash_reporter --udev=ACTION=change:KERNEL=card0:SUBSYSTEM=drm"
Check that a card0-drm log file has been created under /var/spool/crash

Change-Id: I05a1d508e5446988575b0c1924878b8e36ae46bb
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/10618
diff --git a/crash_reporter/crash_reporter_logs.conf b/crash_reporter/crash_reporter_logs.conf
index c91d4d5..5650346 100644
--- a/crash_reporter/crash_reporter_logs.conf
+++ b/crash_reporter/crash_reporter_logs.conf
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can
 # be found in the LICENSE file.
 
@@ -27,6 +27,10 @@
 # the commands' arguments (i.e. "comm" instead of "command").
 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 "===dmesg output==="; dmesg | tail -c 25000; echo "===meminfo==="; cat /proc/meminfo
 
+# This rule is similar to the crash_reporter-user-collection rule, except it is
+# run for kernel errors reported through udev events.
+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
+
 # The following rules are only for testing purposes.
 crash_log_test:echo hello world
 crash_log_recursion_test:sleep 1 && /usr/local/autotest/tests/crash_log_recursion_test