Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add--jsonl flag to theprofiling.sampling #146256

Open
Labels
stdlibStandard Library Python modules in the Lib/ directorytopic-profilingtype-featureA feature request or enhancement
@maurycy

Description

@maurycy

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.pyimport timeprint("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}

Please usejq . to format. I omitted "\n"s for brevity.

That's without fullmeta, withoutraw,heartbeat,stats,error, as well as withoutseq and timestamps, northread_id.

What's the minimum viable format here? Perhaps it could be marked even as"v":0 while it's polished?

Open Question

The format builds on the existingprofiling.sampling internals.

There's a very interesting question what should be the first class objects / semantics of the format?

My honest feeling is thatframe_def does not really describe frames but places in the code. pprof itself seems to operate more onlocation_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? I'm open to any suggestions.

Running a much deeper comparison between various formats might be warranted.

Has this already been discussed elsewhere?

#145464

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-profilingtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp