diff --git a/collects/profile/analyzer.rkt b/collects/profile/analyzer.rkt index 63880af..2298157 100644 --- a/collects/profile/analyzer.rkt +++ b/collects/profile/analyzer.rkt @@ -2,10 +2,10 @@ ;; Analyzer for the sampler results -(provide analyze-samples) - (require "structs.rkt" "utils.rkt" racket/list) +(provide analyze-samples (all-from-out "structs.rkt")) + (define-syntax-rule (with-hash ) (hash-ref! (lambda () ))) diff --git a/collects/profile/main.rkt b/collects/profile/main.rkt index be53d1b..9827f42 100644 --- a/collects/profile/main.rkt +++ b/collects/profile/main.rkt @@ -2,7 +2,7 @@ (provide profile-thunk profile) -(require "sampler.rkt" "analyzer.rkt" +(require "sampler.rkt" (except-in "analyzer.rkt" profile) (prefix-in text: "render-text.rkt") (for-syntax racket/base)) diff --git a/collects/profile/render-graphviz.rkt b/collects/profile/render-graphviz.rkt index 8e063df..0c23a53 100644 --- a/collects/profile/render-graphviz.rkt +++ b/collects/profile/render-graphviz.rkt @@ -2,7 +2,7 @@ (provide render) -(require "structs.rkt" "analyzer.rkt" "utils.rkt") +(require "analyzer.rkt" "utils.rkt") (define (render profile #:hide-self [hide-self% 1/100] diff --git a/collects/profile/render-text.rkt b/collects/profile/render-text.rkt index a6c6abe..61f21f3 100644 --- a/collects/profile/render-text.rkt +++ b/collects/profile/render-text.rkt @@ -2,7 +2,7 @@ (provide render) -(require "structs.rkt" "analyzer.rkt" "utils.rkt" racket/list) +(require "analyzer.rkt" "utils.rkt" racket/list) (define (f:msec msec) (number->string (round (inexact->exact msec)))) diff --git a/collects/profile/structs.rkt b/collects/profile/structs.rkt index 7ecbeff..49cea4d 100644 --- a/collects/profile/structs.rkt +++ b/collects/profile/structs.rkt @@ -14,8 +14,9 @@ ;; identifiable by having both id and src fields being #f. Can be used to ;; start a graph traversal from the top or the bottom. (provide (struct-out profile)) -(define-struct profile - (total-time cpu-time sample-number thread-times nodes *-node)) +(struct profile + (total-time cpu-time sample-number thread-times nodes *-node) + #:constructor-name make-profile) ;; An entry for a single profiled function: ;; - id, src: the corresponding values from `continuation-mark-set->context'. @@ -36,7 +37,8 @@ #:property prop:custom-write (lambda (node o w?) (fprintf o "#" - (or (node-id node) (if (node-src node) '??? 'ROOT))))) + (or (node-id node) (if (node-src node) '??? 'ROOT)))) + #:constructor-name make-node) ;; An edge representing function calls between two nodes: ;; - total: the total time spent while the call was anywhere on the stack. @@ -52,4 +54,5 @@ (lambda (edge o w?) (fprintf o "#" (or (node-id (edge-caller edge)) '???) - (or (node-id (edge-callee edge)) '???)))) + (or (node-id (edge-callee edge)) '???))) + #:constructor-name make-edge)