This is in a profiler, not a repl: visualvm. If there's a way to make visualvm aware of clojure fns, I'll be very happy.
On Friday, December 9, 2016 at 3:52:38 PM UTC-8, Ghadi Shayban wrote: > > The stacktrace should be pointing to the correct file & line number -- no > need to reverse engineer the mangling. If it's not for some reason, file a > bug. (It's helpful to eliminate nREPL / lein middleware in case something > is transforming the printing of traces) > If you are missing a trace when the JVM JITs your code, run with -XX:- > *OmitStackTraceInFastThrow* > > On Friday, December 9, 2016 at 6:25:24 PM UTC-5, Brian Craft wrote: >> >> Yes, but not very practical: since I don't know which one to change, this >> would be a huge rewrite of code to eliminate #() and (fn []). >> >> >> On Friday, December 9, 2016 at 3:16:06 PM UTC-8, Alex Engelberg wrote: >>> >>> If you're seeing "fn_123", it's probably coming from an anonymous >>> function. Giving those functions a name with the (fn my-name [] ...) syntax >>> will make the stack trace a little easier to decipher: >>> >>> user=> ((fn [] (/ 1 0))) >>> >>> ArithmeticException Divide by zero clojure.lang.Numbers.divide >>> (Numbers.java:158) >>> >>> user=> (pst) >>> >>> ArithmeticException Divide by zero >>> clojure.lang.Numbers.divide (Numbers.java:158) >>> clojure.lang.Numbers.divide (Numbers.java:3808) >>> user/eval20851/fn--20852 (form-init8836862334241327650.clj:1) >>> ... >>> >>> nil >>> user=> ((fn my-fn-with-a-name [] (/ 1 0)) >>> >>> ArithmeticException Divide by zero clojure.lang.Numbers.divide >>> (Numbers.java:158) >>> user=> (pst) >>> ArithmeticException Divide by zero >>> clojure.lang.Numbers.divide (Numbers.java:158) >>> clojure.lang.Numbers.divide (Numbers.java:3808) >>> user/eval20857/my-fn-with-a-name--20858 >>> (form-init8836862334241327650.clj:1) >>> ... >>> >>> nil >>> >>> On Fri, Dec 9, 2016 at 3:00 PM, Brian Craft <craft...@gmail.com> wrote: >>> >>>> Trying to profile some code, and the stack traces look like >>>> >>>> clojure.something0 >>>> clojure.something1 >>>> clojure.something2 >>>> .... >>>> clojure.something100 >>>> foo$fn_1000$fn_1002$fn_10003.invoke() >>>> >>>> >>>> How can I figure out what that last function is? I can access the >>>> symbol from the repl, but no idea how to connect it to my code. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To post to this group, send email to clo...@googlegroups.com >>>> Note that posts from new members are moderated - please be patient with >>>> your first post. >>>> To unsubscribe from this group, send email to >>>> clojure+u...@googlegroups.com >>>> For more options, visit this group at >>>> http://groups.google.com/group/clojure?hl=en >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to clojure+u...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.