Check for incomplete blame information and error.
This commit is contained in:
parent
7d45129fca
commit
11732128b3
|
@ -31,6 +31,12 @@
|
||||||
(blame-swap b) ; swap back
|
(blame-swap b) ; swap back
|
||||||
b))))
|
b))))
|
||||||
(define regular-profile (analyze-samples samples*))
|
(define regular-profile (analyze-samples samples*))
|
||||||
|
;; all blames must be complete, otherwise we get bogus profiles
|
||||||
|
(for ([b (in-list all-blames)])
|
||||||
|
(unless (and (blame-positive b)
|
||||||
|
(blame-negative b))
|
||||||
|
(error (string-append "contract-profile: incomplete blame:\n"
|
||||||
|
(format-blame b)))))
|
||||||
(contract-profile
|
(contract-profile
|
||||||
total-time live-contract-samples all-blames regular-profile))
|
total-time live-contract-samples all-blames regular-profile))
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
(lambda () body ...))))
|
(lambda () body ...))))
|
||||||
|
|
||||||
;; for debugging
|
;; for debugging
|
||||||
(define (print-blame b)
|
(define (format-blame b)
|
||||||
(printf (string-append "#<blame positive=~a\n"
|
(format (string-append "#<blame positive=~a\n"
|
||||||
" negative=~a\n"
|
" negative=~a\n"
|
||||||
" contract=~a\n"
|
" contract=~a\n"
|
||||||
" value=~a\n"
|
" value=~a\n"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user