Bug 12146

Summary: Oprofile runtime issue
Product: buildroot Reporter: Prasanth <ragaprasanth>
Component: OtherAssignee: unassigned
Status: RESOLVED INVALID    
Severity: blocker CC: buildroot
Priority: P5    
Version: 2019.02.4   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: defconfig used for Beaglebone Black + oprofile

Description Prasanth 2019-08-26 11:11:55 UTC
Created attachment 8221 [details]
defconfig used for Beaglebone Black + oprofile

Hi,

I tried building oprofile for my Beagle bone Black (cortex-A8), where the build went fine. But, I could see a runtime issue.

Could any help me with this?

Attached defconfig and pasted the error-log at runtime.

# operf --version
Unexpected error running operf: Operation not supported
#
Comment 1 Thomas Petazzoni 2019-11-29 07:35:21 UTC
Thanks for your bug report. This seems like a kernel configuration issue. Did you had CONFIG_OPROFILE=y in your kernel configuration?
Comment 2 Thomas Petazzoni 2019-11-29 13:07:41 UTC
Looked at it in more details, if you get EOPNOTSUPP, then you probably do have CONFIG_OPROFILE=y enabled, but the perf_event_open() syscall fails and returns EOPNOTSUPP. One reason for this to happen is when:

        if (is_sampling_event(event)) {
                if (event->pmu->capabilities & PERF_PMU_CAP_NO_INTERRUPT) {
                        err = -EOPNOTSUPP;
                        goto err_alloc;
                }
        }

So this really depends on your hardware PMU, and the kernel support for it. This is not a Buildroot bug.