Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
osie
Commits
3f6f1d30
Commit
3f6f1d30
authored
Mar 24, 2023
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Analyze more.
parent
6103b95e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
6 deletions
+46
-6
rt_analyzer/analyze.py
rt_analyzer/analyze.py
+46
-6
No files found.
rt_analyzer/analyze.py
View file @
3f6f1d30
f
=
open
(
"digital.csv"
,
"r"
)
"""
Parse logical analyzer logs. Used together with test_latency.c as generator.
Usage: python2 analyze.py digital.csv
"""
import
sys
import
statistics
file_name
=
sys
.
argv
[
1
]
f
=
open
(
file_name
,
"r"
)
# assume it's 0 by default even if in measurement file it can start with 1
# then we simple loose few records but that's acceptable.
...
...
@@ -12,7 +20,8 @@ last_channel1_timestamp = 0.0
timestamp_channel0_delta_list
=
[]
timestamp_channel1_delta_list
=
[]
for
line
in
f
.
readlines
()[
1
:
4000
]:
lines_list
=
f
.
readlines
()
for
line
in
lines_list
[
1
:]:
timestamp
,
channel0
,
channel1
=
line
.
split
(
","
)
timestamp
=
float
(
timestamp
)
channel0
=
int
(
channel0
)
...
...
@@ -51,9 +60,40 @@ for line in f.readlines()[1:4000]:
last_channel0_value
=
channel0
last_channel1_value
=
channel1
# XXX: find average, mean, standard deviation, etc on these lists of deltas
# find average, mean, standard deviation, etc on these lists of deltas
channel0_mean
=
statistics
.
mean
(
timestamp_channel0_delta_list
)
*
1000000
channel0_median
=
statistics
.
median
(
timestamp_channel0_delta_list
)
*
1000000
channel0_stdev
=
statistics
.
stdev
(
timestamp_channel0_delta_list
)
*
1000000
channel0_min
=
min
(
timestamp_channel0_delta_list
)
*
1000000
channel0_max
=
max
(
timestamp_channel0_delta_list
)
*
1000000
channel1_mean
=
statistics
.
mean
(
timestamp_channel1_delta_list
)
*
1000000
channel1_median
=
statistics
.
median
(
timestamp_channel1_delta_list
)
*
1000000
channel1_stdev
=
statistics
.
stdev
(
timestamp_channel1_delta_list
)
*
1000000
channel1_min
=
min
(
timestamp_channel1_delta_list
)
*
1000000
channel1_max
=
max
(
timestamp_channel1_delta_list
)
*
1000000
stop_time
=
lines_list
[
-
1
].
split
(
","
)[
0
]
print
"Timestamp records = "
,
len
(
lines_list
)
print
"Duration (seconds) = "
,
stop_time
print
"Channel0 (stm32mp1-2, PREEMPT, isolcpus=0, in nanoseconds):"
print
"
\
t
Mean = "
,
channel0_mean
print
"
\
t
Median = "
,
channel0_median
print
"
\
t
Min = "
,
channel0_min
print
"
\
t
Max = "
,
channel0_max
print
"
\
t
Standart deviation = "
,
channel0_stdev
print
print
"Channel1 (stm32mp1-3, PREEMPT, isolcpus=1, in nanoseconds):"
print
"
\
t
Mean = "
,
channel1_mean
print
"
\
t
Median = "
,
channel1_median
print
"
\
t
Min = "
,
channel1_min
print
"
\
t
Max = "
,
channel1_max
print
"
\
t
Standart deviation = "
,
channel1_stdev
# convert to nanoseconds
print
"Channel0 deltas (in nanoseconds)"
,
[
round
(
x
*
1000000
,
2
)
for
x
in
timestamp_channel0_delta_list
]
print
"
\
n
Channel1 deltas (in nanoseconds)"
,
[
round
(
x
*
1000000
,
2
)
for
x
in
timestamp_channel1_delta_list
]
f
.
close
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment