From 22def35d68c42017aa8674985e6f2b88b173acae Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Thu, 7 Nov 2013 15:49:03 -0500 Subject: [PATCH] Show expressions in errortrace profiles, instead of just symbols. Since profile nodes report the time spent in, e.g., an entire call expression (including argument evaluation), and not just in the body of the operator, showing only the operator in the profile is misleading. --- pkgs/profile-pkgs/profile-lib/sampler.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/profile-pkgs/profile-lib/sampler.rkt b/pkgs/profile-pkgs/profile-lib/sampler.rkt index ddd44b0f06..75cef42d52 100644 --- a/pkgs/profile-pkgs/profile-lib/sampler.rkt +++ b/pkgs/profile-pkgs/profile-lib/sampler.rkt @@ -8,12 +8,13 @@ (require errortrace/errortrace-key) -;; (cons sexp srcloc) -> (cons symbol srcloc) -;; just take the first symbol we find +;; (cons sexp srcloc) -> (cons sexp srcloc) +;; abbreviate the expression for concise reports +;; we take the first symbol we can find, and wrap it in a stub expression (define (errortrace-preprocess frame) (cons (and (car frame) (let loop ([e (car frame)]) - (cond [(symbol? e) e] + (cond [(symbol? e) (list e '...)] [(pair? e) (loop (car e))] [else (error 'errortrace-preprocess "unexpected frame: ~a" frame)])))