Bug 8006 - Intel: Backport SRF LBR branch counter support to kernel v6.6
Summary: Intel: Backport SRF LBR branch counter support to kernel v6.6
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: generic (show other bugs) generic
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: maqiao
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-22 15:34 UTC by yunyings
Modified: 2024-01-30 10:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yunyings intel_group 2024-01-22 15:34:58 UTC
The branch counters logging (A.K.A LBR event logging) introduces a per-counter indication of precise event occurrences in LBRs. It can provide a means to attribute exposed retirement latency to combinations of events across a block of instructions. It also provides a means of attributing Timed LBR latencies to events.

The feature will be first introduced with next Intel E-core Xeon Sierra Forest(SRF)/Grand Ridge(GRR). It is an enhancement of the Architectural LBR. It adds new fields in the LBR_INFO MSRs to log the occurrences of events on the GP counters. The information is displayed by the order of counters.

To support this feature, both kernel PMU changes and user space perf tool changes are needed.

Kernel commits(5 patches, from mainline kernel v6.8-rc1):
33744916196b perf/x86/intel: Support branch counters logging
318c49859112 perf/x86/intel: Reorganize attrs and is_visible
1f2376cd03dd perf: Add branch_sample_call_stack
85846b27072d perf/x86: Add PERF_X86_EVENT_NEEDS_BRANCH_STACK flag
571d91dcadfa perf: Add branch stack counters
Reference: https://lore.kernel.org/lkml/20231025201626.3000228-5-kan.liang@linux.intel.com/

Perf tool commits(4 patches, from mainline kernel v6.8-rc1):
697579629f85 perf test: Basic branch counter support
9fbb4b02302b perf tools: Add branch counter knob
ac9cd7245fff perf header: Support num and width of branch counters
76db7aab1fca tools headers UAPI: Sync include/uapi/linux/perf_event.h header with the kernel
Reference: https://lore.kernel.org/lkml/20240109222804.28583-1-acme@kernel.org/

Since perf tool changes are independent to kernel versions, this ticket is only created for backporting the kernel commits to kernel v6.6. The perf tool commits will be useful for testing the kernel backport.
Comment 1 小龙 admin 2024-01-22 15:42:46 UTC
The PR Link: https://gitee.com/anolis/anck-next/pulls/37
Comment 2 小龙 admin 2024-01-30 10:45:57 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2680