Giter Site home page Giter Site logo

contrail's People

Contributors

enaeher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

contrail's Issues

Add :within option

This would allow you to trace only those calls to a given function where another function is on the stack.

Tracing across threads sucks

To wit:

contrail.core-test> (def foo identity)
#'contrail.core-test/foo
contrail.core-test> (trace #'foo)
#'contrail.core-test/foo
contrail.core-test> (pmap foo (range 5))
   0 000 ::0:: :  (#'contrail.core-test/foo 3)(#'contrail.core-test/foo 0) (#'contrail.core-test/foo 1)(#'contrail.core-test/foo 2) (#'contrail.core-test/foo 4)




 0  00:::  #'contrail.core-test/foo returned 30  0#'contrail.core-test/foo returned 1 #'contrail.core-test/foo returned 0:
:

  #'contrail.core-test/foo returned 4#'contrail.core-test/foo returned 2

(0 1 2 3 4)

Compare with clojure.tools.trace:

contrail.core> (clojure.tools.trace/trace-vars foo)
#'contrail.core/foo
contrail.core> (pmap foo (range 5))
TRACE t112227: (contrail.core/foo 1)TRACE t112228: (contrail.core/foo 3)TRACE t112230: (contrail.core/foo 2)


TRACE t112229: (contrail.core/foo 4)
TRACE t112231: (contrail.core/foo 0)
TRACE t112231: => 0TRACE t112227: => 1

TRACE t112230: => 2
TRACE t112229: => 4
TRACE t112228: => 3
(0 1 2 3 4)

Handle var re-definition better

When a var is redefined (e.g., by a user re-compiling a file or expression in their editor), the trace reporting wrapping of its function is blown away, and so traced-vars becomes out-of-sync with the true state of things.

I see three possible solutions:

  • detect when this happens and remove the var from traced-vars
  • detect when this happens and try to re-trace the var, such that trace state is preserved until the user explicitly calls untrace (this is what SBCL does, at least by default)
  • stop using traced-vars and instead rely on var introspection (of all vars in all namespaces) to support the functionality of all-traced, zero-arity untrace, etc

Add :count option

This would let you limit trace output to the first n calls to the traced function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.