From: Giri P. <sha...@gm...> - 2022-04-05 09:59:39
|
1) I installed operf in linux machine, below is the version: operf: oprofile 1.3.0 compiled on Feb 2 2020 20:33:34 2) I wrote a simple program and ran : *operf ./a.out* 3) it generated the folder: *oprofile_data* 4) when i run opreport as below: *##> opreport session:oprofile_data event:DATA_MEM_REFSUsing /home/prasadgi/tools/cpp/oprofile_data/samples/ for samples directory.opreport error: No sample found: Please specify a session containingsample data.* *Please help what is missing ?* Regards, Giri Prasad |
From: William C. <wc...@re...> - 2022-04-05 14:21:50
|
On 4/5/22 05:59, Giri Prasad wrote: > 1) I installed operf in linux machine, below is the version: > > operf: oprofile 1.3.0 compiled on Feb 2 2020 20:33:34 > > 2) I wrote a simple program and ran : *operf ./a.out* > > 3) it generated the folder: *oprofile_data* > * > * > 4) when i run opreport as below: > * > * > *##> opreport session:oprofile_data event:DATA_MEM_REFS > Using /home/prasadgi/tools/cpp/oprofile_data/samples/ for samples directory. > opreport error: No sample found: Please specify a session containing > sample data.* > * > * > *Please help what is missing ?* > * > * > Regards, > Giri Prasad > > > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list Hi, By default operf is going to use a clock cycle event to record samples . You should see samples if you do "opreport". However, if the program runs for a very short amount of time there might not be enough events (cycles) to trigger a sample. If you want to get samples of the DATA_MEM_REFS you are going to need to specify the events with the --events / -e option for operf: https://oprofile.sourceforge.io/doc/controlling-profiler.html#controlling-operf You might also consider using linux perf: https://perf.wiki.kernel.org/index.php/Main_Page -Will |
From: will s. <wil...@vn...> - 2022-04-05 16:09:51
|
On Tue, 2022-04-05 at 15:29 +0530, Giri Prasad wrote: > > 1) I installed operf in linux machine, below is the version: > > operf: oprofile 1.3.0 compiled on Feb 2 2020 20:33:34 > > 2) I wrote a simple program and ran : operf ./a.out > > 3) it generated the folder: oprofile_data > > 4) when i run opreport as below: > > ##> opreport session:oprofile_data event:DATA_MEM_REFS > Using /home/prasadgi/tools/cpp/oprofile_data/samples/ for samples > directory. > opreport error: No sample found: Please specify a session containing > sample data. > > Please help what is missing ? Most likely the program did not run long enough or simply did not trigger any DATA_MEM_REFS events. Does opreport give you any output if you leave off the "event:" qualifier? Thanks -Will (Schmidt) > > Regards, > Giri Prasad > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list |
From: Giri P. <sha...@gm...> - 2022-04-06 03:27:05
|
Thanks a lot Will and William for your responses. My apologies for being novice in this aspect: 1) My program looks like this. [Just to learn operf] *#include <iostream>using namespace std;void fun1(){ for(auto i = 0; i < 1000000000; i++) { std::cout << "Fun1" << endl; }}void fun2(){ for(auto i = 0; i < 1000000000; i++) { std::cout << "Fun2" << endl; }}int main(){ fun1(); fun2();}* 2) I ran the command : *operf -g ./a.out* 3) It ran for almost 20 minutes and then I killed the process. 4) Can you please let me know how to run opreport to : get the call graph *with details of Functions fun1 and fun2 *with details such as *how many cycles they consumed, how many times they're called* etc. Regards, Giri Prasad On Tue, Apr 5, 2022 at 9:16 PM will schmidt <wil...@vn...> wrote: > On Tue, 2022-04-05 at 15:29 +0530, Giri Prasad wrote: > > > > 1) I installed operf in linux machine, below is the version: > > > > operf: oprofile 1.3.0 compiled on Feb 2 2020 20:33:34 > > > > > 2) I wrote a simple program and ran : operf ./a.out > > > > 3) it generated the folder: oprofile_data > > > > 4) when i run opreport as below: > > > > ##> opreport session:oprofile_data event:DATA_MEM_REFS > > Using /home/prasadgi/tools/cpp/oprofile_data/samples/ for samples > > directory. > > opreport error: No sample found: Please specify a session containing > > sample data. > > > > Please help what is missing ? > > > Most likely the program did not run long enough or simply did not > trigger any DATA_MEM_REFS events. > > Does opreport give you any output if > you leave off the "event:" qualifier? > > Thanks > -Will (Schmidt) > > > > > > Regards, > > Giri Prasad > > _______________________________________________ > > oprofile-list mailing list > > opr...@li... > > https://lists.sourceforge.net/lists/listinfo/oprofile-list > > |