Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Skyward Boardcore
Commits
986d0cfe
Commit
986d0cfe
authored
2 years ago
by
Alberto Nidasio
Browse files
Options
Downloads
Patches
Plain Diff
[CPUMeter] Added stack and heap statistics
parent
5267de4e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/diagnostic/CpuMeter/CpuMeter.cpp
+5
-1
5 additions, 1 deletion
src/shared/diagnostic/CpuMeter/CpuMeter.cpp
src/shared/diagnostic/CpuMeter/CpuMeterData.h
+10
-2
10 additions, 2 deletions
src/shared/diagnostic/CpuMeter/CpuMeterData.h
with
15 additions
and
3 deletions
src/shared/diagnostic/CpuMeter/CpuMeter.cpp
+
5
−
1
View file @
986d0cfe
...
...
@@ -45,7 +45,11 @@ static volatile unsigned int update = 0;
CpuMeterData
getCpuStats
()
{
Lock
<
FastMutex
>
l
(
utilizationMutex
);
return
CpuMeterData
(
TimestampTimer
::
getTimestamp
(),
utilization
.
getStats
());
return
CpuMeterData
(
TimestampTimer
::
getTimestamp
(),
utilization
.
getStats
(),
MemoryProfiling
::
getAbsoluteFreeHeap
(),
MemoryProfiling
::
getCurrentFreeHeap
(),
MemoryProfiling
::
getAbsoluteFreeStack
(),
MemoryProfiling
::
getCurrentFreeStack
());
}
void
resetCpuStats
()
{
utilization
.
reset
();
}
...
...
This diff is collapsed.
Click to expand it.
src/shared/diagnostic/CpuMeter/CpuMeterData.h
+
10
−
2
View file @
986d0cfe
...
...
@@ -36,12 +36,20 @@ struct CpuMeterData
float
stdDev
=
0
;
///< Standard deviation of dataset.
uint32_t
nSamples
=
0
;
///< Number of samples.
uint32_t
minFreeHeap
=
0
;
uint32_t
freeHeap
=
0
;
uint32_t
minFreeStack
=
0
;
uint32_t
freeStack
=
0
;
CpuMeterData
()
{}
explicit
CpuMeterData
(
uint64_t
timestamp
,
StatsResult
stats
)
explicit
CpuMeterData
(
uint64_t
timestamp
,
StatsResult
stats
,
uint32_t
freeHeap
,
uint32_t
minFreeHeap
,
uint32_t
minFreeStack
,
uint32_t
freeStack
)
:
timestamp
(
timestamp
),
minValue
(
stats
.
minValue
),
maxValue
(
stats
.
maxValue
),
mean
(
stats
.
mean
),
stdDev
(
stats
.
stdDev
),
nSamples
(
stats
.
nSamples
)
nSamples
(
stats
.
nSamples
),
minFreeHeap
(
minFreeHeap
),
freeHeap
(
freeHeap
),
minFreeStack
(
minFreeStack
),
freeStack
(
freeStack
)
{
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment