Use named loggers to tell TR and inliner logs apart.
This commit is contained in:
parent
251159e64a
commit
805a6477a7
|
@ -1,8 +1,6 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "mzc.rkt"
|
||||
typed-racket/optimizer/logging
|
||||
unstable/logging)
|
||||
(require "mzc.rkt" unstable/logging)
|
||||
|
||||
(provide with-intercepted-opt-logging)
|
||||
|
||||
|
@ -11,12 +9,13 @@
|
|||
(define (with-intercepted-opt-logging interceptor thunk)
|
||||
(with-intercepted-logging
|
||||
(lambda (l)
|
||||
(cond [(log-message-from-tr-opt? l)
|
||||
;; From TR, use the log-entry struct provided.
|
||||
(interceptor (cdr (vector-ref l 2)))]
|
||||
;; We look at the message to tell if it's from mzc.
|
||||
[(log-message-from-mzc-opt? (vector-ref l 1))
|
||||
;; From mzc, create a log-entry from the info.
|
||||
(interceptor (mzc-opt-log-message->log-entry (vector-ref l 1)))]))
|
||||
thunk
|
||||
'debug 'optimizer 'debug 'TR-optimizer))
|
||||
;; From mzc, create a log-entry from the info.
|
||||
(interceptor (mzc-opt-log-message->log-entry (vector-ref l 1))))
|
||||
(lambda ()
|
||||
(with-intercepted-logging
|
||||
(lambda (l)
|
||||
;; From TR, use the log-entry struct provided.
|
||||
(interceptor (cdr (vector-ref l 2))))
|
||||
thunk
|
||||
'debug 'TR-optimizer))
|
||||
'debug 'optimizer))
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
unstable/syntax racket/match unstable/match racket/list racket/string
|
||||
unstable/list)
|
||||
|
||||
(provide log-message-from-mzc-opt?
|
||||
mzc-opt-log-message->log-entry
|
||||
(provide mzc-opt-log-message->log-entry
|
||||
post-process-inline-log)
|
||||
|
||||
|
||||
|
@ -22,9 +21,6 @@
|
|||
out-of-fuel-regexp)
|
||||
"|")))
|
||||
|
||||
(define (log-message-from-mzc-opt? l)
|
||||
(regexp-match any-inlining-event-regexp l))
|
||||
|
||||
|
||||
(struct inliner-log-entry log-entry (inlining-event) #:prefab)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user