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

Remove exception-driven programming from EventProvider #343

Open
cvonelm opened this issue Aug 27, 2024 · 0 comments
Open

Remove exception-driven programming from EventProvider #343

cvonelm opened this issue Aug 27, 2024 · 0 comments

Comments

@cvonelm
Copy link
Member

cvonelm commented Aug 27, 2024

The EventProvider makes good use of exception-driven programming of the form:

try
{
open/lookup/whatever_event()
}
catch
{
//event does not exist is not openable etc.

try_next_source()
}

besides try-catch cascades being ugly as all balls, I burned myself while trying to implement pmu-events support (getting events via the same interface perf uses so we match perf events 1:1) with some shenanigans that are probably half constructed objects (?).

Anyways, I think replacing the exception part with std::optional or just returning some kind of EventDescription that is tagged as "invalid" would be better. (The latter is afaik already the direction we are moving in, in #340 )

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