require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_TRACE_H_)) {
    eval 'sub _SYS_TRACE_H_ () {1;}' unless defined(&_SYS_TRACE_H_);
    eval 'sub TR_BREADHIT () {0;}' unless defined(&TR_BREADHIT);
    eval 'sub TR_BREADMISS () {1;}' unless defined(&TR_BREADMISS);
    eval 'sub TR_BWRITE () {2;}' unless defined(&TR_BWRITE);
    eval 'sub TR_BREADHITRA () {3;}' unless defined(&TR_BREADHITRA);
    eval 'sub TR_BREADMISSRA () {4;}' unless defined(&TR_BREADMISSRA);
    eval 'sub TR_XFODMISS () {5;}' unless defined(&TR_XFODMISS);
    eval 'sub TR_XFODHIT () {6;}' unless defined(&TR_XFODHIT);
    eval 'sub TR_BRELSE () {7;}' unless defined(&TR_BRELSE);
    eval 'sub TR_BREALLOC () {8;}' unless defined(&TR_BREALLOC);
    eval 'sub TR_MALL () {10;}' unless defined(&TR_MALL);
    eval 'sub TR_INTRANS () {20;}' unless defined(&TR_INTRANS);
    eval 'sub TR_EINTRANS () {21;}' unless defined(&TR_EINTRANS);
    eval 'sub TR_FRECLAIM () {22;}' unless defined(&TR_FRECLAIM);
    eval 'sub TR_RECLAIM () {23;}' unless defined(&TR_RECLAIM);
    eval 'sub TR_XSFREC () {24;}' unless defined(&TR_XSFREC);
    eval 'sub TR_XIFREC () {25;}' unless defined(&TR_XIFREC);
    eval 'sub TR_WAITMEM () {26;}' unless defined(&TR_WAITMEM);
    eval 'sub TR_EWAITMEM () {27;}' unless defined(&TR_EWAITMEM);
    eval 'sub TR_ZFOD () {28;}' unless defined(&TR_ZFOD);
    eval 'sub TR_EXFOD () {29;}' unless defined(&TR_EXFOD);
    eval 'sub TR_VRFOD () {30;}' unless defined(&TR_VRFOD);
    eval 'sub TR_CACHEFOD () {31;}' unless defined(&TR_CACHEFOD);
    eval 'sub TR_SWAPIN () {32;}' unless defined(&TR_SWAPIN);
    eval 'sub TR_PGINDONE () {33;}' unless defined(&TR_PGINDONE);
    eval 'sub TR_SWAPIO () {34;}' unless defined(&TR_SWAPIO);
    eval 'sub TR_STAMP () {45;}' unless defined(&TR_STAMP);
    eval 'sub TR_NFLAGS () {100;}' unless defined(&TR_NFLAGS);
    eval 'sub TRCSIZ () {4096;}' unless defined(&TRCSIZ);
    eval 'sub VTRACE () {64+51;}' unless defined(&VTRACE);
    eval 'sub VTR_DISABLE () {0;}' unless defined(&VTR_DISABLE);
    eval 'sub VTR_ENABLE () {1;}' unless defined(&VTR_ENABLE);
    eval 'sub VTR_VALUE () {2;}' unless defined(&VTR_VALUE);
    eval 'sub VTR_UALARM () {3;}' unless defined(&VTR_UALARM);
    eval 'sub VTR_STAMP () {4;}' unless defined(&VTR_STAMP);
    if(defined(&_KERNEL)) {
	if(defined(&TRACE)) {
	    eval 'sub pack {
	        my($v,$b) = @_;
    		eval q(((($v)-> ($v_mount->{mnt_stat}->{f_fsidx}->{__fsid_val[0]}))<<16)|($b));
	    }' unless defined(&pack);
	    eval 'sub trace {
	        my($a,$b,$c) = @_;
    		eval q({  &if ( $traceflags[$a])  &trace1($a,$b,$c); });
	    }' unless defined(&trace);
	} else {
	    eval 'sub trace {
	        my($a,$b,$c) = @_;
    		eval q();
	    }' unless defined(&trace);
	}
    }
}
1;
