Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python profiling to Savant #67

Closed
bwsw opened this issue Feb 18, 2023 · 2 comments
Closed

Add python profiling to Savant #67

bwsw opened this issue Feb 18, 2023 · 2 comments
Assignees

Comments

@bwsw
Copy link
Contributor

bwsw commented Feb 18, 2023

Add an option to run a code with profiling with: https://github.com/gaogaotiantian/viztracer

The feature allows monitoring the code for bottlenecks and awaiting for GIL in various components.

By default, the profiling is disabled.

Use inline profiling:
https://github.com/gaogaotiantian/viztracer#inline

The tracing must be optionally enabled with the use of arguments (e.g. --with-profiling or with a parameter in the config or with the environment variable SAVANT_PROFILING=enable.

The periodicity of the profile dump must be implemented with the extra parameter --profiling-dump-interval=5 or with or with a parameter in the config (default 5).

When the profiling file is dumped, the name must be constructed using the timestamp: /tmp/profiling/savant-profiling-%{TS}.json.

To use the profiling dumps, the user maps the dump directory to a host directory and analyzes the profiling with the vizviewer program.

Also support with the configuration directives:

@bwsw bwsw added this to the 0.2.0 milestone Feb 22, 2023
@bwsw
Copy link
Contributor Author

bwsw commented Mar 1, 2023

@abramov-oleg please take a look at this section: https://github.com/gaogaotiantian/viztracer#json-alternative

@bwsw bwsw removed this from the 0.2.0 milestone Mar 1, 2023
@abramov-oleg
Copy link
Collaborator

Unfortunately it wasn't possible to complete the task using viztracer out of the box:

  1. Viztracer doesn't trace python callbacks from gstreamer C part. As a result, only waiting for next pipeline message was traced.
  2. Custom Viztracer events in python callbacks crash the pipeline with no message when using single global tracer object.
  3. Creating separate tracer objects for each target function call is not convenient and presents separate problem with combining resulting files.

@abramov-oleg abramov-oleg self-assigned this Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants