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 first simple test #360

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Add first simple test #360

wants to merge 7 commits into from

Conversation

cvonelm
Copy link
Member

@cvonelm cvonelm commented Jan 23, 2025

This is a proposal for a first simple test, testing if sampling works.

Sadly, I think I can throw the GitHub Action Idea into the bin because PMUs are not passed to the VM, and working around that (by only testing perf software events) seems to be like inviting a whole lot of weirdness into the test process that is not worth the hassle.

Add a function for printing the perf_event_attr of Event's. This is
incredibly useful for debugging.

Printing out the perf_event_attr is triggered on event open and is only
printed when the log level trace is specified

Move pre-defined event table from global to function scope, so that the
events in  it do not get initialized before we set up logging.
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
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
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

Successfully merging this pull request may close these issues.

1 participant