Conversation
Lucien950
left a comment
There was a problem hiding this comment.
basic code style things, will look at functionality later. todo validate.
5ee2be6 to
5bbd586
Compare
10637da to
e1e9bdd
Compare
e1e9bdd to
10c4e0c
Compare
There was a problem hiding this comment.
is this autogenerated? otherwise same comment about setare's freertos
There was a problem hiding this comment.
yes this is part is
There was a problem hiding this comment.
wait this is not autogenerated, you added these in. Is there a better place we can put these to make it more clear?
| if (runTimeStats[task].xHandle == idleHandle) | ||
| { | ||
| idle_counter = runTimeStats[task].ulRunTimeCounter; | ||
|
|
||
| // Calculate total current cpu usage and max cpu usage | ||
| cpu_runtime_stat->cpu_curr_usage = 1.0f - ((float)idle_counter / (float)ulHighFrequencyTimerTick); | ||
|
|
||
| cpu_runtime_stat->cpu_max_usage = MAX(cpu_runtime_stat->cpu_curr_usage, cpu_runtime_stat->cpu_max_usage); | ||
| break; | ||
| } |
There was a problem hiding this comment.
throw this guy as a special case of the guys below, cuz you are 1) iterating over the same list anyways and 2) would be nice to have a built in exception detector
There was a problem hiding this comment.
So the reason there is two loops is because I need to find the idle_counter in the array first before I start calculating the cpu load for each task. Unless I mean I can go look through the source code to see if they place idle counter at a specific index in the array
| // get the idle time that we need to calculate the cpu usage associated | ||
| if (tasks_runtime_stat[task] != NULL) | ||
| { | ||
| if ((idle_counter + runTimeStats[task].ulRunTimeCounter) != 0) |
There was a problem hiding this comment.
so how you calculate cpu load is make sure time spent in the task / time of task + cpu load. So I am just doing a divide by zero check
| return EXIT_CODE_OK; | ||
| } | ||
|
|
||
| void hw_runTimeStat_hookCallBack(void) |
There was a problem hiding this comment.
is this a summarization? do you do the broadcasting here as well? I think that is a key component to the design of this sturcture is how do you do your broadcasting for each task
Jugveer-Sandher
left a comment
There was a problem hiding this comment.
We should think about providing support for h5 now too.
There was a problem hiding this comment.
wait this is not autogenerated, you added these in. Is there a better place we can put these to make it more clear?
| /* Functions needed when configGENERATE_RUN_TIME_STATS is on */ | ||
| __weak void configureTimerForRunTimeStats(void) {} | ||
|
|
||
| __weak unsigned long getRunTimeCounterValue(void) | ||
| { | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
maybe put these in the shared file?
Changelist
The purpose of this MR is to create a functionality in which we can measure cpu and stack usage within our system for all high compute ECU such as the VC and BMS
Testing Done
Resolved Tickets
FIRM-462