Ignore:
Timestamp:
Feb 21, 2006, 2:31:06 AM (18 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
3d85c53
Parents:
52330ef
Message:

r1181@server (orig r1179): jim | 2006-02-14 19:52:37 -0800

r1263@server: jim | 2006-02-14 19:52:14 -0800
Updates from Upstream


File:
1 edited

Legend:

Unmodified
Added
Removed
  • udev/show_event_log

    r52330ef r26b1cc1  
    1616########################################################################
    1717#
     18# extract udev log messages from a syslog file
     19# show_event_log <first> [<last> [<list of event types>] ]
     20#
    1821# 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
     22#   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
    2326#
     27# GPL, version 2
     28# Christian Zoz <zoz@suse.de>
     29#
     30
    2431EXCLUDE_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"
    2632MESSAGES=${MESSAGES:-/var/log/messages}
    27 #grep udevd /var/log/messages | grep -v "pass_env\|geventrec\|hal.hot\|received"
    2833
    2934show_event() {
    3035        local SN PID SUBS
    3136        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)
    3337        read PID ACT SUBS < <(sed -n "s/^.*seq $SN forked, pid \[\([0-9]*\)\], '\([^']*\)' '\([^']*\)'.*$/\1 \2 \3/p;T;q" $MESSAGES)
    3438        if [ $PID == 0 ] ; then
     
    5761declare -i START=$1 STOP=$2
    5862if [ "$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/'`
    6065fi
    6166test $START -lt 0 -a $STOP -gt 0 && START=$((STOP+START+1))
     
    6570        show_event $n
    6671done
    67        
     72
    6873exit
    6974
Note: See TracChangeset for help on using the changeset viewer.