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

Implement provider population on demand #115

Open
kvanhees opened this issue Dec 10, 2024 · 0 comments
Open

Implement provider population on demand #115

kvanhees opened this issue Dec 10, 2024 · 0 comments

Comments

@kvanhees
Copy link
Member

Right now, "static" providers (pretty much anything other than pid-providers, USDT-providers, and profile/tick) populate the list of known probes for every dtrace invocation. Probe matching is done based on the list of known probes. This is at times overkill because we really only care about probes that match the probe descriptions of the clauses that are used in a tracing session.

One fairly easy way to optimize this is to only populate the probes for providers that match the probe specifications. In other words, probe population in a given provider can be done on-demand the first time that the provider is identified as a possible source of probes we are interested in. To do this, we can implement a callback in the provider implementation to register the provider without actually populating it with any probes. Then, when probe matching involves a provider whose probes have not been populated yet, populate them, record that population took place, and then try to match any of its probes.

A more complex way would refine this even more by only populating those probes that match the probe specification. That is more efficient in terms of memory usage but it may actually be slower in performance because compilation of multiple clauses may require evaluating the probes in a particular provider multiple times since later clauses may be interested in probes within the same provider, but ones that thus far did not match any probe specifications.

I would suggest that we implement the first solution and then consider whether the second solution is worth evaluating.

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