Comments (4)
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.
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.
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.
hm that's an interesting idea that I hadn't realized was possible, will give it a try
from viztracer.
Related Issues (20)
- jupyter integration not working properly on remote jupyter lab HOT 2
- Test failed on Arch Linux against Python 3.12 HOT 6
- asyncio.create_subprocess_shell().communicate() hangs HOT 6
- 无法绑定ip及jupyter中无法更改端口号 HOT 1
- Gives warning: "Found and ignore invalid json file, you may lost some process data." HOT 6
- VizTracer not tracing some functions HOT 1
- Build wheels for free-threading version HOT 3
- [optimize] always add quotes when printing file path HOT 2
- Is it possible to record the function in which tracer is stopped? HOT 3
- Viztracer/vizviewer displays only 1 of N threads with the same name HOT 1
- 关于c++编译的扩展模块中类成员函数没有记录的问题 HOT 6
- 关于长时间记录监控线程导致记录过多的问题 HOT 15
- traced script option parsing is broken HOT 4
- TypeError: CodeMonkey.compile() got an unexpected keyword argument '_feature_version' HOT 3
- Allow users to use `objprint` in `log_func_args` and `log_func_retval`
- Very long process of getting repr of huge objects in torch HOT 7
- clang compile failure: "-Werror -Wunused-command-line-argument" makes "-fno-strict-overflow" fatal HOT 1
- log_sparse=True is not propagated to subprocesses when using multiprocessing with spawn HOT 1
- Ignore python library packages HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from viztracer.