On 9/9/21 2:56 AM, Stephane Eranian wrote: > This patch improves the error message printed by perf when perf_event_open() > fails on AMD Zen3 when using the branch sampling feature. In the case of > EINVAL, there are two main reasons: frequency mode or period is smaller than > the depth of the branch sampling buffer (16). The patch checks the parameters > of the call and tries to print a relevant message to explain the error: > > $ perf record -b -e cpu/branch-brs/ -c 10 ls > Error: > AMD Branch Sampling does not support sampling period smaller than what is reported in /sys/devices/cpu/caps/branches. > > $ perf record -b -e cpu/branch-brs/ ls > Error: > AMD Branch Sampling does not support frequency mode sampling, must pass a fixed sampling period via -c option or cpu/branch-brs,period=xxxx/. > > Signed-off-by: Stephane Eranian > --- Hi Stephane, I've rewritten this patch based on Arnaldo's comments to the previous (11/13) patch. The new version attached depends on this 2-patch series: https://lore.kernel.org/lkml/20211004214114.188477-1-kim.phillips@amd.com/T/#mc4c9c582e3816ab31af6d0187e6803de1a98ac84 Thanks, Kim