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

how best to handle perfetto::Tracing::Initialize arguments #11

Open
batesj opened this issue Feb 25, 2021 · 2 comments
Open

how best to handle perfetto::Tracing::Initialize arguments #11

batesj opened this issue Feb 25, 2021 · 2 comments

Comments

@batesj
Copy link
Collaborator

batesj commented Feb 25, 2021

@gerddie raised this issue with the current INIT API that once we support a shared library C API it will not work well, because only the first call to init will get to set the config options.

Design alternatives:

  1. Same as perfetto: passed in parameters to percetto_init.
  2. Config file loaded during percetto_init -- if it is found it is used as defaults.
  3. Build option to specify default values.
  4. Update perfetto to handle dynamic changes to these settings to compromise between different options for different libraries. ie: if mesa wants shmem_size_hint_kb of 400 and virglrenderer wants 200, perfetto could dynamically update it to the greater of the two options -- 400.
  5. A combination of the above.
@batesj
Copy link
Collaborator Author

batesj commented Feb 25, 2021

Note that with the current static library design of percetto, this isn't a problem. Mesa and virglrenderer, for example, should have their own percetto instance with their own config. That actually works well because those projects can choose perfetto config options based on their own tracing usage patterns.

  1. Allow overriding perfetto config options via env vars.
    With the current perfetto SDK design, another option similar to a config file is environment variables that override config options. For an application like crosvm that links against multiple libraries that use perfetto, the system would run it with environment variables that override each necessary perfetto option. This is slightly cleaner than a config file on systems where there are no commonly accessible file paths for all the security contexts where perfetto runs.

@batesj
Copy link
Collaborator Author

batesj commented Feb 26, 2021

Implemented (6) to begin with.

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

1 participant