History

perf: Extend per event callchain limit to branch stack

The commit 97c79a38cd45 ("perf core: Per event callchain limit") introduced a per-event term to allow finer tuning of the depth of callchains to save space. It should be applied to the branch stack as well. For example, autoFDO collections require maximum LBR entries. In the meantime, other system-wide LBR users may only be interested in the latest a few number of LBRs. A per-event LBR depth would save the perf output buffer. The patch simply drops the uninterested branches, but HW still collects the maximum branches. There may be a model-specific optimization that can reduce the HW depth for some cases to reduce the overhead further. But it isn't included in the patch set. Because it's not useful for all cases. For example, ARCH LBR can utilize the PEBS and XSAVE to collect LBRs. The depth should have less impact on the collecting overhead. The model-specific optimization may be implemented later separately.

Kan Liang committed 1 year ago

Commit c53e14f1 parent c96fff32 files · +5 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/perf_event.h+2−0
@@ -385,6 +385,8 @@ enum perf_event_read_format { · 384 unmodified lines
385385 *
386386 * @sample_max_stack: Max number of frame pointers in a callchain,
387387 * should be < /proc/sys/kernel/perf_event_max_stack
388+ * Max number of entries of branch stack
389+ * should be < hardware limit
388390 */
389391 struct perf_event_attr {
390392