Skip to content

Fix cpufreq event #712

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

Merged

Conversation

douglas-raillard-arm
Copy link
Collaborator

No description provided.

…r.stop()

Emiting the current frequency of all CPUs in the stop() hook is not
useful as the current frequency should already be known from the trace.
Either the event is emitted every time the frequency changes and the
up-to-date information is available, or the frequency never changes
(e.g. userspace governor) and the frequencies will be known from
emitting cpu_frequency_devlib in start().
…vents dependent on the configured events

Make cpu_frequency_devlib dependent on whether the "cpu_frequency" event
has been selected rather than dependent on the cpufreq devlib module
being loaded on the target.

The old behavior became particularly problematic with the lazy loading
of modules. However, it was never a reliable way of knowing if the user
was interested in the frequency or not.

Apply a similar mechanism for the extra idle state transitions only done
if "cpu_idle" event is selected.
@douglas-raillard-arm
Copy link
Collaborator Author

Added the branch to our vendored version for dogfooding

self._selected_events = selected_events

@property
def event_string(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change event_string to property? what was the issue when it is a variable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's derived from self._selected_events, leaving it as an attribute both clutters the state of the object with redundant information and also opens the door for mismatching content. Having it as a property makes the broken state impossible to represent.

@marcbonnici marcbonnici merged commit eb9e0c9 into ARM-software:master Mar 1, 2025
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.

3 participants