source: udev/show_event_log@ de4ea80

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since de4ea80 was 103e3eb, checked in by Jim Gifford <clfs@…>, 19 years ago

r943@server (orig r941): jim | 2005-12-20 00:11:03 -0800

r1154@server: jim | 2005-12-20 00:10:39 -0800
Updates from Upstream


  • Property mode set to 100755
File size: 2.4 KB
Line 
1#!/bin/sh
2########################################################################
3#
4# Description : show_event_log
5#
6# Authors : Based on Open Suse Udev Rules
7# kay.sievers@suse.de
8#
9# Adapted to : Jim Gifford
10# LFS
11#
12# Version : 00.00
13#
14# Notes :
15#
16########################################################################
17#
18# known events are:
19# ac97 acpi block cpu drivers edd firmware graphics i2c-adapter i8259
20# ieee1394_protocol input ioapic irqrouter lapic mem misc module namespace
21# pci_bus pci_express pcmcia pcmcia_socket platform pnp printer scsi scsi_host
22# serio sound timer timer_pit tty usb usb_device usb_host vc
23#
24EXCLUDE_SUBS="acpi cpu edd mem namespace pci_bus tty vc"
25# EXCLUDE_SUBS="ac97 acpi cpu drivers edd graphics i2c-adapter mem i8259 ioapic irqrouter lapic mem module namespace platform pnp pci_bus tty vc"
26MESSAGES=${MESSAGES:-/var/log/messages}
27#grep udevd /var/log/messages | grep -v "pass_env\|geventrec\|hal.hot\|received"
28
29show_event() {
30 local SN PID SUBS
31 declare -i SN=$1 PID
32# read PID ACT SUBS < <(sed -n "s/^.*seq $SN forked, pid \[\([0-9]*\)\], \([^,]*\),.*$/\1 \2/p;T;q" $MESSAGES)
33 read PID ACT SUBS < <(sed -n "s/^.*seq $SN forked, pid \[\([0-9]*\)\], '\([^']*\)' '\([^']*\)'.*$/\1 \2 \3/p;T;q" $MESSAGES)
34 if [ $PID == 0 ] ; then
35 echo event $SN not found 1>&2
36 return 1
37 fi
38 if [ -n "$WANTED_SUBS" ] ; then
39 WANTED=no
40 for S in $WANTED_SUBS; do
41 test "$SUBS" == "$S" && WANTED=yes
42 done
43 else
44 WANTED=yes
45 for S in $EXCLUDE_SUBS; do
46 test "$SUBS" == "$S" && WANTED=no
47 done
48 fi
49 echo event $SN $PID $ACT $SUBS $WANTED 1>&2
50 test $WANTED == no && return 1
51 echo " _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $SN _ $ACT _ $SUBS _ _ _ _"
52 grep "seq $SN \|\[$PID\]" $MESSAGES |
53 grep -v "pass_env\|geventrec\|hal.hot"
54 echo
55}
56
57declare -i START=$1 STOP=$2
58if [ "$2" == last ] ; then
59 read STOP < <(grep -o "udev_done.*exit" $MESSAGES | cut -d" " -f3 | sort -n | tail -1)
60fi
61test $START -lt 0 -a $STOP -gt 0 && START=$((STOP+START+1))
62test $START -gt $STOP && STOP=$START
63shift; shift; WANTED_SUBS="$*"
64for n in `seq $START $STOP`; do
65 show_event $n
66done
67
68exit
69
70# list all events
71(read x; while read x s x x x c x; read x s2 x a d; do echo $s $s2 $a $c $d; done) < <( sed -n "s/^.*udev.*\(seq [0-9]* [qf].*$\)/\1/p" /var/log/messages | sort -n -k 2 | tr -d ',' )
72
73./show_event_log 1 last > boot.events.log.`date +%A_%H:%M` 2> boot.events.list.`date +%A_%H:%M`
Note: See TracBrowser for help on using the repository browser.