首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用OProfile分析OpenCV

使用OProfile分析OpenCV
EN

Stack Overflow用户
提问于 2017-02-01 01:16:29
回答 1查看 287关注 0票数 0

我有一个基本的OpenCV程序:

代码语言:javascript
复制
#include <iostream>
#include "opencv2/opencv.hpp"

int main(){

    std::cout<<"Reading Image..."<<std::endl;
    cv::Mat img = cv::imread("all_souls_000000.jpg", cv::IMREAD_GRAYSCALE);
    if(!img.data)
        std::cerr<<"Error reading image"<<std::endl;
    return 0;
}

它创建了可执行的ReadImage。我想使用OProfile对其进行分析。但是,运行:

代码语言:javascript
复制
operf ./ReadImage > ReadImage.log

返回:

代码语言:javascript
复制
Kernel profiling is not possible with current system config.
Set /proc/sys/kernel/kptr_restrict to 0 to collect kernel samples.
operf: Profiler started
* * * * WARNING: Profiling rate was throttled back by the kernel * * * *
The number of samples actually recorded is less than expected, but is
probably still statistically valid.  Decreasing the sampling rate is the
best option if you want to avoid throttling.

Profiling done.

为什么会发生这种情况?分析OpenCV的最佳方法是什么?

EN

回答 1

Stack Overflow用户

发布于 2017-02-01 06:02:52

我能够在一个opencv应用上运行operf,结果是,这就是你要找的吗?

代码语言:javascript
复制
Profiling started at Tue Jan 31 16:52:48 2017
Profiling stopped at Tue Jan 31 16:52:53 2017

-- OProfile/operf Statistics --
Nr. non-backtrace samples: 337018
Nr. kernel samples: 5603
Nr. user space samples: 331415
Nr. samples lost due to sample address not in expected range for domain: 0
Nr. lost kernel samples: 0
Nr. samples lost due to sample file open failure: 0
Nr. samples lost due to no permanent mapping: 0
Nr. user context kernel samples lost due to no app info available: 0
Nr. user samples lost due to no app info available: 0
Nr. backtraces skipped due to no file mapping: 0
Nr. hypervisor samples dropped due to address out-of-range: 0
Nr. samples lost reported by perf_events kernel: 0
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41963599

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档