2
# Copyright (C) 2002, 2003 Jeff Dike (jdike@karaya.com)
3
# Licensed under the GPL
10
!@ARGV and die "Usage : perl tty_log.pl log-file";
14
my @ops = read_log($file);
16
foreach my $op (@ops){
17
if($op->{op} eq "open"){
18
printf("Opening new tty 0x%x from tty 0x%x\n", $op->{tty},
21
elsif($op->{op} eq "close"){
22
printf("Closing tty 0x%x\n", $op->{tty});
24
elsif($op->{op} eq "write"){
25
if($op->{direction} eq "read"){
26
printf("Read from tty 0x%x - '%s'\n", $op->{tty}, $op->{string});
28
elsif($op->{direction} eq "write"){
29
printf("Write to tty 0x%x - '%s'\n", $op->{tty}, $op->{string});
32
die "Bad direction - '$op->{direction}'";
36
die "Bad op - " . $op->{op};