home *** CD-ROM | disk | FTP | other *** search
- % Trace individual operators.
- % <opname> traceop prints vmem usage
- % <opname> <numargs|preproc> prints arguments or runs proc before
- % <opname> <numargs|preproc> <numresults|postproc>
- % also prints results or runs proc after
-
- % Define the default "before" action
- /tracebefore { vmstatus 3 .traceprint } def
-
- % Define the default "after" action
- /traceafter { } def
-
- /.traceprint
- { dup type /integertype eq
- { 1 sub -1 0 { ( ) print index ==only } for }
- { exec }
- ifelse
- } bind def
- /traceop
- { userdict begin
- dup type /nametype eq { { tracebefore } } if
- 1 index type /nametype eq { { traceafter } } if
- /.tpost exch def /.tpre exch def /.tname exch def
- [ .tname /=only cvx ( ) /print cvx
- /.tpre load /.traceprint cvx systemdict .tname /get cvx /exec cvx
- /.tpost load /.traceprint cvx (\n) /print cvx
- ] cvx .tname exch def end
- } bind def
- /bind { } def % disable
-