2017-01-31 10 views
0

У меня есть эта основная программа OpenCV:профилирующего OpenCV с использованием OProfile

#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. Тем не менее, работает:

operf ./ReadImage > ReadImage.log 

Возвраты:

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?

ответ

0

Я смог запустить operf в приложении opencv, с этим результатом, это то, что вы ищете?

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

Нет, мне нужно знать процент (и возможное время), потраченный на каждую вызванную функцию, поэтому я могу найти самые дорогие и попытаться распараллелить их – justHelloWorld

 Смежные вопросы

  • Нет связанных вопросов^_^