-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Description
Feature or enhancement
Proposal:
I'm thinking how to make #145464 more managable, and I realized that sole --jsonl is actually a good first step.
Adding --jsonl does not depend actually on streaming and will be immediately useful anyway.
The format described in #145464 for:
% cat /tmp/hello_world.py
import time
print("Hello, World!")
time.sleep(0.1)
could be as simple as:
{"type":"meta","v":1,"run_id":"ab2e464d9d814af4b653302f03256520","sample_interval_usec":1000,"mode":"wall"}
{"type":"str_def","v":1,"run_id":"ab2e464d9d814af4b653302f03256520","defs":[{"str_id":1,"value":"<module>"},{"str_id":2,"value":"/tmp/hello_world.py"},{"str_id":3,"value":"_run_code"},{"str_id":4,"value":"<frozen runpy>"},{"str_id":5,"value":"_run_module_as_main"}]}
{"type":"frame_def","v":1,"run_id":"ab2e464d9d814af4b653302f03256520","defs":[{"frame_id":1,"path_str_id":2,"func_str_id":1,"line":3,"end_line":3,"col":0,"end_col":15},{"frame_id":2,"path_str_id":4,"func_str_id":3,"line":87,"end_line":87,"col":4,"end_col":27},{"frame_id":3,"path_str_id":4,"func_str_id":5,"line":196,"end_line":197,"col":11,"end_col":42}]}
{"type":"agg","v":1,"run_id":"ab2e464d9d814af4b653302f03256520","kind":"frame","scope":"final","samples_total":105,"entries":[{"frame_id":1,"self":105,"cumulative":105},{"frame_id":2,"self":0,"cumulative":105},{"frame_id":3,"self":0,"cumulative":105}]}
{"type":"end","v":1,"run_id":"ab2e464d9d814af4b653302f03256520","samples_total":105}That's without raw, heartbeat, stats, error, as well as without seq and timestamps.
Perhaps it could be marked even as "v":0 while it's polished?
Please use jq . to format. I omitted "\n"s for brevity.
Open Question
The format builds on the existing profiling.sampling internals.
There's a very interesting question what should be the first class objects / semantics of the format?
My honest feeling is that frame_def does not really describe frames but places in the code. pprof itself operates more on location_def level.
I don't know the previous conversations to make an informed decision here. frame_def is much more simpler. Perhaps there's a more complex discussion to be held?
Has this already been discussed elsewhere?
Links to previous discussion of this feature:
No response