GithubHelp home page GithubHelp logo

Comments (4)

gaogaotiantian avatar gaogaotiantian commented on September 20, 2024

So there are two issues.

First of all, viztracer tries to support all python versions that are not EOL and make the behavior consistent on them. Having something that only works on 3.12 is not impossible, but should be justified well enough.

In this specific case, if your thread already started, you can be at any depth in your stack and it's kind of weird to start recording from there. The more important reason is, viztracer is supposed be used as a CLI program, inline usage is not first citizen. Plenty of features won't work if you use it inline - multiprocessing support for example. So I'm trying to make inline usage work for simple cases, a quick trace for some simply scripts, but to utilize it to its full capability, you should use CLI.

from viztracer.

gedalia avatar gedalia commented on September 20, 2024

I was imagining hasattr could be used to decide if a feature was available, we're actually on 3.10 not 3.12, but figured I could be forward looking. It's interesting that you think of it as a mainly CLI tool. I have it hooked into our gui so it can be started and stopped at will, in general I frequently only get a second or two of info before I blow through the buffer, so there's no way I could use the CLI.
I often use the tools like this just to understand systems I'm not that familiar with, works a bit better with https://github.com/wolfpld/tracy which can handle much larger captures.

from viztracer.

gaogaotiantian avatar gaogaotiantian commented on September 20, 2024

I'm not saying this is unsolvable. I'm just not sure tracing at an arbitrary point of a thread generates good data.

I do think of it as a CLI tool, because all the multi-process features rely on it anyway. You won't be able to trace multiprocess programs with inline usage.

The tool probaly will be a bit confused (not a lot) if you have return events that do not correspond to a start (imagine you are deep in the call stack and you start the tracing).

However, if you do want something like that, maybe try to create a single tracer as soon as your GUI started - it will hook the threadings. Then use start() and stop() to collect trace, instead of creating a new tracer every time the user wants to trace.

from viztracer.

gedalia avatar gedalia commented on September 20, 2024

hm that's an interesting idea that I hadn't realized was possible, will give it a try

from viztracer.

Related Issues (20)

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.