-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix various remaining issues with EventDescription Rework, streamline interfaces, move configuration of Events in own EventConfig class. #358
base: master
Are you sure you want to change the base?
Conversation
bc45d53
to
2f1196c
Compare
Somehow, base_path does not get initialized correctly before read_proc is called, so move it all into read_proc
Also move use-case specific tracepoint code out of TracepointEvent
- Make Event clean base class. Use SimpleEvent when the event configuration needs to be specified manually. - Move almost all logic outside of the Event class. Event Configuration should happen fully from the outside - fix boolean operators - move sysfs specific code from Event to SysfsEvent
print [CPUS 0-0] as [CPU 0]
Designwise, the EventConfig class should handle all the ugly details of configuring the Events from the given Config(), such as setting specific bits. The sample::Reader for example asks the EventConfig for a sample event. The EventConfig then selects the correct sampling event using the EventProvider and the Config, configures all the options, such as sample_period and then gives it back to the sample::Reader. The sample::Reader does not need to change anything about the event. The EventProvider should only provide events, reading them from different sources, such as pre-defined, PFM, PMU events. The CounterProvider did not do anything special enough to warrant its continuing existence, merge it with EventConfig Smaller fixes - delete needless getter in CounterCollection - provide default values for bools in Config() - check exclude_kernel once in EventConfig() instead of for every event
2f1196c
to
2e5ef19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you finally lost me with the naming.
What do the Event instances represent? (And their subclass instances)
What is the difference between EventProvider and EventConfig?
include/lo2s/perf/event_config.hpp
Outdated
void watermark(Event& ev) | ||
{ | ||
ev.set_watermark(0.8 * config().mmap_pages * sysconf(_SC_PAGESIZE)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here? It seems to be not worth a function on its own. Especially because the name is not really telling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use this calculation for the watermark at three different spots in the code and I dont want to spread the arcane knowledge that watermark is 80% of config().mmap_pages * page_size all through the code.
Also, I hate inheritance. Why is a SimpleEvent an Extension of an Event? How does one become simple by extending? |
{Tracepoint, Breakpoint, Simple}Event -> EventAttr EventConfig -> EventComposer EventProvider -> EventResolver also, make it impossible for invalid EventAttrs to exist
#Move Event Configuration to EventConfig class
Test for debugfs when specifying tracepoint dependent options,
Refactor Event class
Pass TracepointEvent directly instead of name of event
Add definition of base_path into read_proc()