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

Issue 216 alder lake support #217

Merged
merged 1 commit into from
Oct 7, 2022
Merged

Conversation

cvonelm
Copy link
Member

@cvonelm cvonelm commented Aug 25, 2022

This PR adds lo2s support for the heterogenous Alder Lake architecture.

Sadly, this did not make topdown available as simple perf events as I thought, but all other events work now.

this archive contains a simple example trace recorded with

lo2s -A -E cpu_core/cache-misses -E cpu_atom/cache-misses

One of the currently rather ugly things is that I'm creating a metric_class for every cpu (As every cpu can possibly have completely different metric_members) which looks like this in Vampir:

image

A fix would be using the same metric_class and writing 0 to events not supported on that core. I think this is a hack we have to take, but I would like prior input. Problems with this approach is that tracking which events are supported and which arent might be costly to do during measurements.

This fixes #216

Copy link
Member

@bmario bmario left a comment

Choose a reason for hiding this comment

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

One of the currently rather ugly things is that I'm creating a metric_class for every cpu (As every cpu can possibly have completely different metric_members) which looks like this in Vampir:

I think you're overengineering here a bit. Shouldn't all events from the cpu PMU be available
on all cpus. And events from cpu_core or cpu_atom only be available on their distinct groups of cpus? Hence, there is either one metric_class for all cpus, or two metric_classes with completely distinct CPU groups, which might be a nightmare to track, but should be possible nonetheless.

src/config.cpp Outdated Show resolved Hide resolved
include/lo2s/topology.hpp Outdated Show resolved Hide resolved
include/lo2s/topology.hpp Outdated Show resolved Hide resolved
include/lo2s/topology.hpp Outdated Show resolved Hide resolved
include/lo2s/topology.hpp Outdated Show resolved Hide resolved
src/perf/event_provider.cpp Outdated Show resolved Hide resolved
src/perf/event_provider.cpp Outdated Show resolved Hide resolved
src/perf/event_provider.cpp Outdated Show resolved Hide resolved
src/perf/event_provider.cpp Outdated Show resolved Hide resolved
@@ -119,46 +119,51 @@ Trace::Trace()
registry_.create<otf2::definition::system_tree_node_domain>(
system_tree_root_node_, otf2::common::system_tree_node_domain::shared_memory);
const auto& sys = Topology::instance();
for (auto& package : sys.packages())
for (auto& cpu : sys.cpus())
Copy link
Member

Choose a reason for hiding this comment

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

This is where not having the relations between package->core->cpu really hurts, as you constantly need to check whether things are there, making the code hard to understand in comparison. I'm not sure if I like that.

include/lo2s/perf/counter/group/reader.hpp Outdated Show resolved Hide resolved
include/lo2s/perf/counter/counter_provider.hpp Outdated Show resolved Hide resolved
include/lo2s/measurement_scope.hpp Outdated Show resolved Hide resolved
include/lo2s/perf/counter/group/writer.hpp Outdated Show resolved Hide resolved
include/lo2s/perf/counter/userspace/writer.hpp Outdated Show resolved Hide resolved
src/perf/counter/userspace/reader.cpp Outdated Show resolved Hide resolved
src/perf/counter/userspace/reader.cpp Outdated Show resolved Hide resolved
src/perf/event_provider.cpp Show resolved Hide resolved
src/topology.cpp Outdated Show resolved Hide resolved
src/perf/event_provider.cpp Outdated Show resolved Hide resolved
With Alder Lake, the Linux kernel gained an architecture, where
different cores can have different sets of events available.

This commit makes lo2s respect the
/sys/bus/event_source/devices/[pmu]/cpus file, which specifies which
CPUs support that PMU and subsequently only opens the events on the CPUs
that support it.
@cvonelm cvonelm force-pushed the issue-216-alder-lake-support branch from fdd2bba to af5596a Compare October 7, 2022 09:26
@bmario bmario merged commit 0fc8564 into master Oct 7, 2022
@bmario bmario deleted the issue-216-alder-lake-support branch October 7, 2022 11:02
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.

Support for Alder Lake
2 participants