Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Performance counter report

Altera_Forum
Honored Contributor II
996 Views

Hey 

I am running performance counter on my C code 

My problem is that the report only show the result for section 1 !! (even if I change sections order it only show the first) 

It should show 4 sections ! 

What could be the problem ?! 

thnx 

 

%%%%%%%%%%%%%%%% 

 

perf_print_formatted_report((void *)PERFORMANCE_COUNTER_BASE, 

ALT_CPU_FREQ,4, 

"section_1", 

"section_2", 

"section_3", 

"section_4"); 

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

 

--Performance Counter Report-- 

Total Time: 3.35524 seconds (335524437 clock-cycles) 

+---------------+-----+-----------+---------------+-----------+ 

| Section | % | Time (sec)| Time (clocks)|Occurrences| 

+---------------+-----+-----------+---------------+-----------+ 

|section_1 | 0.27| 0.00905| 905319| 1| 

+---------------+-----+-----------+---------------+-----------+ 

|section_2 | 0| 0.00000| 0| 0| 

+---------------+-----+-----------+---------------+-----------+ 

|section_3 | 0| 0.00000| 0| 0| 

+---------------+-----+-----------+---------------+-----------+ 

|section_4 | 0| 0.00000| 0| 10175| 

+---------------+-----+-----------+---------------+-----------+
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
101 Views

It's hard to know without seeing more code, but perhaps you are forgetting to change the second parameter of the PERF_BEGIN/PERF_END calls for the different sections? 

... // Section 1 PERF_BEGIN(PERFORMANCE_COUNTER_BASE, 1); foo(); PERF_END(PERFORMANCE_COUNTER_BASE, 1); // Section 2 PERF_BEGIN(PERFORMANCE_COUNTER_BASE, 2); bar(); PERF_END(PERFORMANCE_COUNTER_BASE, 2); ...
Altera_Forum
Honored Contributor II
101 Views

 

--- Quote Start ---  

It's hard to know without seeing more code, but perhaps you are forgetting to change the second parameter of the PERF_BEGIN/PERF_END calls for the different sections? 

... // Section 1 PERF_BEGIN(PERFORMANCE_COUNTER_BASE, 1); foo(); PERF_END(PERFORMANCE_COUNTER_BASE, 1); // Section 2 PERF_BEGIN(PERFORMANCE_COUNTER_BASE, 2); bar(); PERF_END(PERFORMANCE_COUNTER_BASE, 2); ... 

--- Quote End ---  

 

 

thnx I solved it
Reply