Don't track provenance at the log entry level.
Not necessary anymore.
This commit is contained in:
parent
928ea23a12
commit
96078c9da6
|
@ -24,7 +24,7 @@
|
||||||
(define (anyone-listening?) (log-level? TR-logger TR-logging-level))
|
(define (anyone-listening?) (log-level? TR-logger TR-logging-level))
|
||||||
|
|
||||||
;; msg is for consumption by the DrRacket tool
|
;; msg is for consumption by the DrRacket tool
|
||||||
(struct log-entry (kind msg stx located-stx pos provenance) #:prefab)
|
(struct log-entry (kind msg stx located-stx pos) #:prefab)
|
||||||
;; for optimizations only (not missed optimizations, those are below)
|
;; for optimizations only (not missed optimizations, those are below)
|
||||||
(struct opt-log-entry log-entry () #:prefab)
|
(struct opt-log-entry log-entry () #:prefab)
|
||||||
|
|
||||||
|
@ -32,8 +32,7 @@
|
||||||
(define (log-optimization kind msg stx)
|
(define (log-optimization kind msg stx)
|
||||||
(when (anyone-listening?)
|
(when (anyone-listening?)
|
||||||
(emit-log-message
|
(emit-log-message
|
||||||
(opt-log-entry kind msg stx (locate-stx stx) (syntax-position stx)
|
(opt-log-entry kind msg stx (locate-stx stx) (syntax-position stx)))))
|
||||||
'typed-racket))))
|
|
||||||
|
|
||||||
;;--------------------------------------------------------------------
|
;;--------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -62,7 +61,6 @@
|
||||||
(emit-log-message
|
(emit-log-message
|
||||||
(missed-opt-log-entry kind msg
|
(missed-opt-log-entry kind msg
|
||||||
stx (locate-stx stx) (syntax-position stx)
|
stx (locate-stx stx) (syntax-position stx)
|
||||||
'typed-racket
|
|
||||||
irritants '() 1)))))
|
irritants '() 1)))))
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,8 +76,7 @@
|
||||||
(when (anyone-listening?)
|
(when (anyone-listening?)
|
||||||
(emit-log-message
|
(emit-log-message
|
||||||
;; no actual message, since it's not meant for user consumption
|
;; no actual message, since it's not meant for user consumption
|
||||||
(info-log-entry kind "" stx (locate-stx stx) (syntax-position stx)
|
(info-log-entry kind "" stx (locate-stx stx) (syntax-position stx)))))
|
||||||
'typed-racket))))
|
|
||||||
|
|
||||||
;;--------------------------------------------------------------------
|
;;--------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
(log-entry-stx parent) ; we report the outermost one
|
(log-entry-stx parent) ; we report the outermost one
|
||||||
(log-entry-located-stx parent)
|
(log-entry-located-stx parent)
|
||||||
(log-entry-pos parent)
|
(log-entry-pos parent)
|
||||||
(log-entry-provenance parent)
|
|
||||||
|
|
||||||
(remove-duplicates
|
(remove-duplicates
|
||||||
(append (remove (log-entry-stx child)
|
(append (remove (log-entry-stx child)
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
;; prune this entry from the logs, but return what we produced so far
|
;; prune this entry from the logs, but return what we produced so far
|
||||||
(define (prune) (escape produced-entries))
|
(define (prune) (escape produced-entries))
|
||||||
(match (car log) ; events are grouped, first element is representative
|
(match (car log) ; events are grouped, first element is representative
|
||||||
[(log-entry kind msg stx located-stx pos provenance)
|
[(log-entry kind msg stx located-stx pos)
|
||||||
|
|
||||||
;; #f if no profiling info is available for this function
|
;; #f if no profiling info is available for this function
|
||||||
;; takes in either a single pos number or a pair of numbers (line col)
|
;; takes in either a single pos number or a pair of numbers (line col)
|
||||||
|
@ -190,7 +190,7 @@
|
||||||
(format-aggregation-string pruned-log)
|
(format-aggregation-string pruned-log)
|
||||||
(if msg (format "~a\n" msg) "")
|
(if msg (format "~a\n" msg) "")
|
||||||
recommendation)
|
recommendation)
|
||||||
provenance
|
'inlining
|
||||||
badness
|
badness
|
||||||
'())) ; no irritants to highlight
|
'())) ; no irritants to highlight
|
||||||
start end
|
start end
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
located-stx
|
located-stx
|
||||||
(format "Inlining ~a"
|
(format "Inlining ~a"
|
||||||
(format-aggregation-string pruned-log))
|
(format-aggregation-string pruned-log))
|
||||||
provenance))
|
'inlining))
|
||||||
start end
|
start end
|
||||||
0)))
|
0)))
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,6 @@
|
||||||
(inliner-log-entry kind kind
|
(inliner-log-entry kind kind
|
||||||
forged-stx forged-stx
|
forged-stx forged-stx
|
||||||
(syntax-position forged-stx)
|
(syntax-position forged-stx)
|
||||||
'mzc
|
|
||||||
evt))
|
evt))
|
||||||
|
|
||||||
(define inlining-event-regexp
|
(define inlining-event-regexp
|
||||||
|
|
|
@ -25,9 +25,10 @@
|
||||||
;; Returns a report-entry or #f, which means prune.
|
;; Returns a report-entry or #f, which means prune.
|
||||||
(define (log-entry->report-entry l)
|
(define (log-entry->report-entry l)
|
||||||
(match l
|
(match l
|
||||||
[(log-entry kind msg stx located-stx (? number? pos) provenance)
|
[(log-entry kind msg stx located-stx (? number? pos))
|
||||||
(define start (sub1 pos))
|
(define start (sub1 pos))
|
||||||
(define end (+ start (syntax-span stx)))
|
(define end (+ start (syntax-span stx)))
|
||||||
|
(define provenance 'typed-racket)
|
||||||
;; When we first create report entries, they have a single sub.
|
;; When we first create report entries, they have a single sub.
|
||||||
(report-entry (list (if (opt-log-entry? l)
|
(report-entry (list (if (opt-log-entry? l)
|
||||||
(opt-report-entry located-stx msg provenance)
|
(opt-report-entry located-stx msg provenance)
|
||||||
|
@ -76,9 +77,9 @@
|
||||||
(/ (node-self (car profile-entry)) total-time)
|
(/ (node-self (car profile-entry)) total-time)
|
||||||
1))
|
1))
|
||||||
(match l
|
(match l
|
||||||
[(missed-opt-log-entry kind msg stx located-stx pos provenance
|
[(missed-opt-log-entry kind msg stx located-stx pos
|
||||||
irritants merged-irritants badness)
|
irritants merged-irritants badness)
|
||||||
(missed-opt-log-entry kind msg stx located-stx pos provenance
|
(missed-opt-log-entry kind msg stx located-stx pos
|
||||||
irritants merged-irritants
|
irritants merged-irritants
|
||||||
;; uses ceiling to never go down to 0
|
;; uses ceiling to never go down to 0
|
||||||
;; both badness and badness-multiplier are non-0
|
;; both badness and badness-multiplier are non-0
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
,(match-lambda [(sub-report-entry s m 'typed-racket) #t]
|
,(match-lambda [(sub-report-entry s m 'typed-racket) #t]
|
||||||
[_ #f]))
|
[_ #f]))
|
||||||
("Report inlining optimizations?" .
|
("Report inlining optimizations?" .
|
||||||
,(match-lambda [(sub-report-entry s m 'mzc) #t]
|
,(match-lambda [(sub-report-entry s m 'inlining) #t]
|
||||||
[_ #f]))
|
[_ #f]))
|
||||||
("Report hidden costs?" .
|
("Report hidden costs?" .
|
||||||
,(match-lambda [(sub-report-entry s m 'hidden-cost) #t]
|
,(match-lambda [(sub-report-entry s m 'hidden-cost) #t]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user