When your Trace32 is open, CPU>>System Settings... menu and configure the JtagClock as fast as possible (here 40MHz) to have fast data streaming:
go in Trace>>Configuration menu
Select to stream the Pointer Counter thus select the mode "PC"
Pass to State to "Arm"
You can increase also the SIZE of the buffer
Launch your code:
In Trace32, CPU>>System Settings, chose IMX8QXP-SCU:
And then do an "Attach":
Then yu should see your SCU core running:
And break your code, your "used" field " should be filled:
Click on "Chart"
On the trace list you can see the sampling rate: around 48µs in our case.
It means you may (almost) not see functions lasting less than 48µs (depends when it is sampled), or you'll see it sometimes.
But for performance analysis it can be useful to see which function is too slow (rather then instrument the code), but as I mentioned in my case function has to last more than 48µs!
You can also get Performance analysis. But keep in mind if your function is faster than 48µs in my case, the result will not be accurate!
Go in Perf>>Perf Configuration (it can also be done un real time with Perf>>Perf List Dynamic)... and select "Snoop":
Then put the State in "Arm" and click on "List" to open the "List Window"
Launch your code and stop it.
In the "List" window you'll see all the function ranked according to their usage occurrence (my SCFW is almost always in sleep!)
With Snooping you cannot trace a function calls.
To do that I add a global variable in the function. You'll have a little overhead due to that.
I will use an i.MXRT1170 with the SDK 2.6.1. I have built the Tiger example (vglite).
April 4th 2020: i.MXRT1170 is not public, meaning not officially supported by Lauterbach.
Please follow the instruction in my SharePoint folder (if the link disappears, it may signify i.MXRT1170 is supported) to add support of the i.MXRT1170.
I want to know the framerate.
To do that I have to monitor the redraw() calls. What I do, is I put the "n" variable as global.
Chose "memory" and "changes" (to log only when the variable is changing):
Then then click on select... and "i"
Search for "n" variable and select it:
Launch your software and then do a break.
Click on "List":
You have the list of your function call (as you can see it is not always the same), in the "ti. call" you have the duration between 2 call (keep in mind the function must not be called at high frequency:
If you click on "draw", you can display the variable values (click on to scale it):
I can also monitor the fps if I pass "time" variable global:
And you can have a reprensentation of you fps (notive I have unchecked "Changes" to have an easy to intrepret curve
Results often depends of several variables.
If you display 2 variables on 1 display window, if the 2 variable does not have the same range, it is not easy to observe.
The best solution I have found in this case is to have 2 "Draw" Windows.
Add the 2 variables in the "SElect" field ("time" and "ScaleCount", beware, it is case sensitive).
Launch your code, and stop it after a while.
Then right click on the "time" and "ScaleCount" variable in your code to display 2 "Draw" window:
Thus you have 2 "Draw" windows, and you see FPS depends on rendering size... logical!