Skip to content

Instantly share code, notes, and snippets.

@cgrand

cgrand/trace.clj

Last active Jun 29, 2017
Embed
What would you like to do?
;; it's very rough (no line info displayed yet, no return value, no filter etc.)
;; but I believe this is the most comprehensive tracing for Clojure
user=> (trace #(reduce + (range 5)))
> user$eval144$fn__145 / invoke
> clojure.lang.Var / getRawRoot
< clojure.lang.Var / getRawRoot
> clojure.lang.Var / getRawRoot
< clojure.lang.Var / getRawRoot
> clojure.lang.Var / getRawRoot
< clojure.lang.Var / getRawRoot
> clojure.core$range / invoke
> clojure.core$range / invokeStatic
> clojure.lang.RT / longCast
> java.lang.Long / longValue
< java.lang.Long / longValue
< clojure.lang.RT / longCast
> clojure.lang.LongRange / create
> clojure.lang.LongRange / positiveStep
> clojure.lang.LongRange$1 / <init>
> java.lang.Object / <init>
< java.lang.Object / <init>
< clojure.lang.LongRange$1 / <init>
< clojure.lang.LongRange / positiveStep
> clojure.lang.LongRange / <init>
> clojure.lang.ASeq / <init>
> clojure.lang.Obj / <init>
> java.lang.Object / <init>
< java.lang.Object / <init>
< clojure.lang.Obj / <init>
< clojure.lang.ASeq / <init>
< clojure.lang.LongRange / <init>
< clojure.lang.LongRange / create
< clojure.core$range / invokeStatic
< clojure.core$range / invoke
> clojure.core$reduce / invoke
> clojure.core$reduce / invokeStatic
> clojure.lang.LongRange / reduce
> java.lang.Long / valueOf
< java.lang.Long / valueOf
> clojure.lang.LongRange$1 / exceededBounds
< clojure.lang.LongRange$1 / exceededBounds
> java.lang.Long / valueOf
< java.lang.Long / valueOf
> clojure.core$_PLUS_ / invoke
> clojure.core$_PLUS_ / invokeStatic
> clojure.lang.Numbers / add
> clojure.lang.Numbers / ops
> java.lang.Object / getClass
< java.lang.Object / getClass
< clojure.lang.Numbers / ops
> clojure.lang.Numbers / ops
> java.lang.Object / getClass
< java.lang.Object / getClass
< clojure.lang.Numbers / ops
> clojure.lang.Numbers$LongOps / combine
> clojure.lang.Numbers$LongOps / opsWith
< clojure.lang.Numbers$LongOps / opsWith
< clojure.lang.Numbers$LongOps / combine
> clojure.lang.Numbers$LongOps / add
> java.lang.Long / longValue
< java.lang.Long / longValue
> java.lang.Long / longValue
< java.lang.Long / longValue
> clojure.lang.Numbers / add
< clojure.lang.Numbers / add
> clojure.lang.Numbers / num
> java.lang.Long / valueOf
< java.lang.Long / valueOf
< clojure.lang.Numbers / num
< clojure.lang.Numbers$LongOps / add
< clojure.lang.Numbers / add
< clojure.core$_PLUS_ / invokeStatic
< clojure.core$_PLUS_ / invoke
> clojure.lang.LongRange$1 / exceededBounds
< clojure.lang.LongRange$1 / exceededBounds
> java.lang.Long / valueOf
< java.lang.Long / valueOf
> clojure.core$_PLUS_ / invoke
> clojure.core$_PLUS_ / invokeStatic
> clojure.lang.Numbers / add
> clojure.lang.Numbers / ops
> java.lang.Object / getClass
< java.lang.Object / getClass
< clojure.lang.Numbers / ops
> clojure.lang.Numbers / ops
> java.lang.Object / getClass
< java.lang.Object / getClass
< clojure.lang.Numbers / ops
> clojure.lang.Numbers$LongOps / combine
> clojure.lang.Numbers$LongOps / opsWith
< clojure.lang.Numbers$LongOps / opsWith
< clojure.lang.Numbers$LongOps / combine
> clojure.lang.Numbers$LongOps / add
> java.lang.Long / longValue
< java.lang.Long / longValue
> java.lang.Long / longValue
< java.lang.Long / longValue
> clojure.lang.Numbers / add
< clojure.lang.Numbers / add
> clojure.lang.Numbers / num
> java.lang.Long / valueOf
< java.lang.Long / valueOf
< clojure.lang.Numbers / num
< clojure.lang.Numbers$LongOps / add
< clojure.lang.Numbers / add
< clojure.core$_PLUS_ / invokeStatic
< clojure.core$_PLUS_ / invoke
> clojure.lang.LongRange$1 / exceededBounds
< clojure.lang.LongRange$1 / exceededBounds
> java.lang.Long / valueOf
< java.lang.Long / valueOf
> clojure.core$_PLUS_ / invoke
> clojure.core$_PLUS_ / invokeStatic
> clojure.lang.Numbers / add
> clojure.lang.Numbers / ops
> java.lang.Object / getClass
< java.lang.Object / getClass
< clojure.lang.Numbers / ops
> clojure.lang.Numbers / ops
> java.lang.Object / getClass
< java.lang.Object / getClass
< clojure.lang.Numbers / ops
> clojure.lang.Numbers$LongOps / combine
> clojure.lang.Numbers$LongOps / opsWith
< clojure.lang.Numbers$LongOps / opsWith
< clojure.lang.Numbers$LongOps / combine
> clojure.lang.Numbers$LongOps / add
> java.lang.Long / longValue
< java.lang.Long / longValue
> java.lang.Long / longValue
< java.lang.Long / longValue
> clojure.lang.Numbers / add
< clojure.lang.Numbers / add
> clojure.lang.Numbers / num
> java.lang.Long / valueOf
< java.lang.Long / valueOf
< clojure.lang.Numbers / num
< clojure.lang.Numbers$LongOps / add
< clojure.lang.Numbers / add
< clojure.core$_PLUS_ / invokeStatic
< clojure.core$_PLUS_ / invoke
> clojure.lang.LongRange$1 / exceededBounds
< clojure.lang.LongRange$1 / exceededBounds
> java.lang.Long / valueOf
< java.lang.Long / valueOf
> clojure.core$_PLUS_ / invoke
> clojure.core$_PLUS_ / invokeStatic
> clojure.lang.Numbers / add
> clojure.lang.Numbers / ops
> java.lang.Object / getClass
< java.lang.Object / getClass
< clojure.lang.Numbers / ops
> clojure.lang.Numbers / ops
> java.lang.Object / getClass
< java.lang.Object / getClass
< clojure.lang.Numbers / ops
> clojure.lang.Numbers$LongOps / combine
> clojure.lang.Numbers$LongOps / opsWith
< clojure.lang.Numbers$LongOps / opsWith
< clojure.lang.Numbers$LongOps / combine
> clojure.lang.Numbers$LongOps / add
> java.lang.Long / longValue
< java.lang.Long / longValue
> java.lang.Long / longValue
< java.lang.Long / longValue
> clojure.lang.Numbers / add
< clojure.lang.Numbers / add
> clojure.lang.Numbers / num
> java.lang.Long / valueOf
< java.lang.Long / valueOf
< clojure.lang.Numbers / num
< clojure.lang.Numbers$LongOps / add
< clojure.lang.Numbers / add
< clojure.core$_PLUS_ / invokeStatic
< clojure.core$_PLUS_ / invoke
> clojure.lang.LongRange$1 / exceededBounds
< clojure.lang.LongRange$1 / exceededBounds
< clojure.lang.LongRange / reduce
< clojure.core$reduce / invokeStatic
< clojure.core$reduce / invoke
< user$eval144$fn__145 / invoke
< user.TraceThunk / invoke
< user$eval94$fn__133 / invoke
10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment