91 Commits

Author SHA1 Message Date
Rasmus Wriedt Larsen
8c8656ccca Python: CG trace: Handle BUILD_TUPLE 2020-07-21 23:05:49 +02:00
Rasmus Wriedt Larsen
0d05d96b50 Python: CG trace: Handle CALL_FUNCTION_EX 2020-07-21 22:54:45 +02:00
Rasmus Wriedt Larsen
3539798c22 Python: CG trace: ignore with statement for now 2020-07-21 22:54:19 +02:00
Rasmus Wriedt Larsen
4843d29ad6 Python: CG trace: Cache calls seen
This improved runtime from ~10 seconds to 1 seconds when running one of the
tests fo wcwidth
2020-07-21 22:54:10 +02:00
Rasmus Wriedt Larsen
ebbea0cd61 Python: CG trace: Ignore IMPORT_NAME 2020-07-21 22:17:17 +02:00
Rasmus Wriedt Larsen
6830804112 Python: CG trace: More logging 2020-07-21 22:08:15 +02:00
Rasmus Wriedt Larsen
3752a25665 Python: CG trace: Handle LOAD_DEREF 2020-07-21 22:02:25 +02:00
Rasmus Wriedt Larsen
61b1d3eef3 Python: CG trace: Handle subscript 2020-07-21 21:45:53 +02:00
Rasmus Wriedt Larsen
79c2c682d7 Python: CG trace: Nicer logging 2020-07-21 21:34:20 +02:00
Rasmus Wriedt Larsen
0a7e6a9938 Python: CG trace: Avoid handling jumps for now 2020-07-21 20:07:33 +02:00
Rasmus Wriedt Larsen
4e3ae98ddf Python: CG trace: Handle list-comprehension and iteration
Which relies on LOAD_CONST and MAKE_FUNCTION
2020-07-21 19:54:59 +02:00
Rasmus Wriedt Larsen
58f11194a8 Python: CG trace: Refactoring 2020-07-21 19:53:05 +02:00
Rasmus Wriedt Larsen
290eb638f9 Python: CG trace: Handle SystemExit
otherwise, with-exit would end the tracer without producing any output :|
2020-07-21 19:40:58 +02:00
Rasmus Wriedt Larsen
296d7d1725 Python: CG trace: Allow tracing modules
As would normally be invoked by `python -m <module-name>` now works with
`cg-trace --module <module-name>`.

This is useful for tracing invocations of `pytest`.
2020-07-21 19:39:51 +02:00
Rasmus Wriedt Larsen
89e8202d11 Python: CG trace: Add some tests using classes 2020-07-21 11:16:52 +02:00
Rasmus Wriedt Larsen
eeeadad359 Python: CG trace: Don't commit examples traces all the time 2020-07-21 11:14:07 +02:00
Rasmus Wriedt Larsen
38af1930fe Python: CG trace: Rename ValidRecordedCall to IdentifiedRecordedCall 2020-07-21 10:19:47 +02:00
Rasmus Wriedt Larsen
bbfea44db0 Python: CG trace: Handle multiple calls to same func on same line
Such as

```
one(); one()
```

Now there are no InvalidRecordedCall in the current examples.
2020-07-20 14:54:05 +02:00
Rasmus Wriedt Larsen
cb98f4433d Python: CG trace: Handle multiple calls on one line
Reduced number of InvalidRecordedCall from 16 to 2. This is the calls

```
one(); one()
```

since they are not distinguishable from the expression.
2020-07-20 14:07:09 +02:00
Rasmus Wriedt Larsen
a1c1ab080b Python: CG trace: Add examples of multiple calls on one line
There are currently 16 InvalidRecordedCall
2020-07-20 14:03:37 +02:00
Rasmus Wriedt Larsen
49a90c058d Python: CG trace: minor adjustment to recreate-dh.sh 2020-07-20 13:00:47 +02:00
Rasmus Wriedt Larsen
5ef817012a Python: CG trace: restructure QL for new XML format 2020-07-20 13:00:07 +02:00
Rasmus Wriedt Larsen
c2748bf7cf Python: CG trace: reconstruct call expr from bytecode
So we can differentiate multiple calls in one line.
2020-07-20 11:28:05 +02:00
Rasmus Wriedt Larsen
d46b410111 Python: CG trace: Proper exception handling 2020-07-20 01:22:33 +02:00
Rasmus Wriedt Larsen
10ec1e078a Python: CG trace: Better type hints 2020-07-18 17:56:56 +02:00
Rasmus Wriedt Larsen
8b6de17461 Python: CG trace: Use logging module for debuging 2020-07-18 17:56:10 +02:00
Rasmus Wriedt Larsen
acc5f70d4a Python: CG trace: Python 3.7 is minimal version 2020-07-18 17:10:53 +02:00
Rasmus Wriedt Larsen
6c60881cbe Python: CG trace: Move code to src/
As recommended in https://blog.ionelmc.ro/2014/05/25/python-packaging/ and
following pattern of black and pytest
2020-07-17 14:41:49 +02:00
Rasmus Wriedt Larsen
0a0c24f3c5 Python: CG trace: Make code modular 2020-07-17 14:40:54 +02:00
Rasmus Wriedt Larsen
94a03d73a3 Python: CG trace: blackify
And make code pass flake8 tests
2020-07-17 13:49:25 +02:00
Rasmus Wriedt Larsen
1c2e259970 Python: CG trace: Handle builtins 2020-07-16 18:04:04 +02:00
Rasmus Wriedt Larsen
92e8e1622c Python: CG trace: move traces to own dir 2020-07-16 16:47:23 +02:00
Rasmus Wriedt Larsen
abcc76baec Python: CG trace: use lxml to pretty-print xml 2020-07-15 14:48:58 +02:00
Rasmus Wriedt Larsen
7ac4ea9bf1 Python: CG trace: use standardized etree import
makes it easy to switch out XML library.
2020-07-15 14:41:39 +02:00
Rasmus Wriedt Larsen
ba4207fc90 Python: CG trace: sort output before writing/printing
Allows comparing output of one run with another
2020-07-15 14:37:41 +02:00
Rasmus Wriedt Larsen
e6873956ca Python: CG trace: add canonic_filename helper 2020-07-15 14:25:42 +02:00
Rasmus Wriedt Larsen
f1601d643a Python: autoformat 2020-07-14 14:12:56 +02:00
Rasmus Wriedt Larsen
1d9c3b3bcd Python: call-graph tracing: callable => callee
to use consistent naming
2020-07-14 14:12:02 +02:00
Rasmus Wriedt Larsen
3127bb27d0 Python: Remove strange empty line 2020-07-13 10:55:43 +02:00
Rasmus Wriedt Larsen
42227c625d Python: Fix grammar
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2020-07-07 11:33:54 +02:00
Rasmus Wriedt Larsen
27d1512a75 Python: MWE for call-graph tracing and ql comparison 2020-07-07 11:05:03 +02:00