Comments (5)
This is a valid bug.
The problem is that when a class has a class method like __new__
or sometimes _create
, it will create the self
variable in the method. CodeSnap check against class name via self
to match the name of entry and exit.
This bug is fixed in master by ignoring the unmatch when the only difference is class name. This test case will also cause a segfault with c tracer, which is fixed in the same commit.
A regression test is added.
from viztracer.
Another mistake. last line exception. .format(x, y)
or f''
from viztracer.
Hi,
Could you make a minimum script that can reproduce this error? Also what interpreter are you using? Is it CPython or something less common? Did you use Cython? I have never tested the module with Cython.
The Exception string is a valid mistake, thanks!
from viztracer.
Sorry here's a late reply. Just back to the office.
I‘m using CPython 3.8.5 and here's the simplest reproducible script.
# test.py
from datetime import timedelta
a = timedelta(hours=5)
reproduce steps:
python -m codesnap test.py
- Traceback:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "xxx/lib/python3.8/site-packages/codesnap/__main__.py", line 21, in <module>
snap.save()
File "xxx/lib/python3.8/site-packages/codesnap/codesnap.py", line 20, in save
self.parse()
File "xxx/lib/python3.8/site-packages/codesnap/tracer.py", line 50, in parse
self.snaptree.add_exit(data[1], data[2])
File "xxx/lib/python3.8/site-packages/codesnap/snaptree.py", line 38, in add_exit
raise Exception("Function Entry/Exit did not match.{} vs {}", name, self.curr.function_name)
Exception: ('Function Entry/Exit did not match.{} vs {}', 'datetime.timedelta.__new__', 'datetime.__new__')
I didn't look into your code, but I guess the datetime
library is using some trick. Maybe you can take a look at it?
from viztracer.
I‘ve tested with pip install -U git+https://github.com/gaogaotiantian/codesnap
, the fix seems worked! Thanks for your effort. I'm closing this issue
from viztracer.
Related Issues (20)
- Windows下vizviewer在使用被占用的端口时无法使用Ctrl+C退出 HOT 1
- ⭐️support pathos.multiprocessing HOT 1
- `log_sparce` works the other way around
- `log_sparse=True` doesn't work with context manager HOT 10
- Time.monotonic makes it impossible to line up distributed traces HOT 1
- NameError HOT 1
- `SNAPTRACE_TRACE_SELF` typo at `snaptrace.c` HOT 2
- JSONDecodeError in report_builder.py HOT 20
- vizviewer fails HOT 2
- command not found: vizviewer HOT 5
- vizobject/vizcounter not working for Inheritance HOT 3
- Bug: args that overlap with viztracer is lost in subprocess.Popen HOT 1
- Unable to use @trace_and_save with multiprocessing HOT 1
- VSCode extension shows blank screen on vscode remote HOT 9
- VsCode里右键选择Trace with Viztracer后报错 HOT 1
- Linux 上 VSCode extension 打开 viztracer 的结果文件出现问题 HOT 4
- No reminder of port conflict when using the parameter "--use_external_processor" HOT 1
- Clear `viztmp` file even if there's something wrong with trace report saving HOT 1
- Please provide Wheels for Apple Silicon HOT 5
- please provide conda package for the latest version of viztracer HOT 1
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.