Changeset 26b1cc1 for udev/show_event_log
- Timestamp:
- Feb 21, 2006, 10:31:06 AM (19 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 3d85c53
- Parents:
- 52330ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
udev/show_event_log
r52330ef r26b1cc1 16 16 ######################################################################## 17 17 # 18 # extract udev log messages from a syslog file 19 # show_event_log <first> [<last> [<list of event types>] ] 20 # 18 21 # known events are: 19 # ac97 acpi block cpu drivers edd firmware graphics i2c-adapter i825920 # ieee1394_protocol input ioapic irqrouter lapic mem misc module namespace21 # pci_bus pci_express pcmcia pcmcia_socket platform pnp printer scsi scsi_host22 # serio sound timer timer_pit tty usb usb_device usb_host vc22 # ac97 acpi block cpu drivers edd firmware graphics i2c-adapter i8259 23 # ieee1394_protocol input ioapic irqrouter lapic mem misc module namespace 24 # pci_bus pci_express pcmcia pcmcia_socket platform pnp printer scsi scsi_host 25 # serio sound timer timer_pit tty usb usb_device usb_host vc 23 26 # 27 # GPL, version 2 28 # Christian Zoz <zoz@suse.de> 29 # 30 24 31 EXCLUDE_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"26 32 MESSAGES=${MESSAGES:-/var/log/messages} 27 #grep udevd /var/log/messages | grep -v "pass_env\|geventrec\|hal.hot\|received"28 33 29 34 show_event() { 30 35 local SN PID SUBS 31 36 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 37 read PID ACT SUBS < <(sed -n "s/^.*seq $SN forked, pid \[\([0-9]*\)\], '\([^']*\)' '\([^']*\)'.*$/\1 \2 \3/p;T;q" $MESSAGES) 34 38 if [ $PID == 0 ] ; then … … 57 61 declare -i START=$1 STOP=$2 58 62 if [ "$2" == last ] ; then 59 read STOP < <(grep -o "udev_done.*exit" $MESSAGES | cut -d" " -f3 | sort -n | tail -1) 63 read STOP_STRING < <(grep -o "udev_done.*exit" $MESSAGES | cut -d" " -f3 | sort -n | tail -1) 64 STOP=`echo $STOP_STRING | sed 's/^[^0-9]*\([0-9]\+\).*$/\1/'` 60 65 fi 61 66 test $START -lt 0 -a $STOP -gt 0 && START=$((STOP+START+1)) … … 65 70 show_event $n 66 71 done 67 72 68 73 exit 69 74
Note:
See TracChangeset
for help on using the changeset viewer.