Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
X-Lap
Commits
a2680b19
Commit
a2680b19
authored
Apr 20, 2018
by
Andreas Schmidt
Browse files
Latest notebook.
parent
ce3b7e65
Changes
2
Hide whitespace changes
Inline
Side-by-side
notebook.ipynb
View file @
a2680b19
...
...
@@ -64,8 +64,8 @@
"original3.name = \"3GHz\"\n",
"\n",
"data_files = {\n",
" \"sender\": \"~/Work/Publications/rtn-2018/eval/20180420_
base2
/\",\n",
" \"receiver\": \"~/Work/Publications/rtn-2018/eval/20180420_
base2
/\"\n",
" \"sender\": \"~/Work/Publications/rtn-2018/eval/20180420_
changed
/\",\n",
" \"receiver\": \"~/Work/Publications/rtn-2018/eval/20180420_
changed
/\"\n",
"}\n",
"original4 = evaluate(data_files[\"sender\"] + \"sender-1000000.csv\", data_files[\"receiver\"] + \"receiver-1000000.csv\", config=config, kind=0).iloc[0:x]\n",
"original4.name = \"1GHz [2]\"\n",
...
...
@@ -109,7 +109,7 @@
"def multi_trace_jitter(dfs, config):\n",
" for df in dfs:\n",
" print(\"############################ {} ############################\".format(df.name))\n",
" jitter.trace_jitter(df, config=config, threshold=
2
00)\n",
" jitter.trace_jitter(df, config=config, threshold=
5
00)\n",
" \n",
"multi_trace_jitter(dfs, config)"
]
...
...
%% Cell type:markdown id: tags:
# X-Lap in Action
%% Cell type:markdown id: tags:
## Imports
%% Cell type:code id: tags:
```
python
import
logging
logger
=
logging
.
getLogger
()
logger
.
setLevel
(
logging
.
DEBUG
)
from
ipywidgets
import
interact
,
interactive
,
fixed
,
interact_manual
import
ipywidgets
as
widgets
from
xlap.parse
import
evaluate
,
evaluate_side
,
parse_config
import
xlap.analyse.jitter
as
jitter
from
xlap.analyse.cdf
import
multi_cdf
from
xlap.analyse.regress
import
linear
as
linear_regression
from
xlap.analyse.trace
import
traces
from
xlap.analyse.correlation
import
correlation
,
multi_correlation
from
xlap.analyse.latency
import
analyse
import
matplotlib.pyplot
as
plt
import
pandas
as
pd
%
matplotlib
inline
```
%% Cell type:markdown id: tags:
## Data Retrieval
%% Cell type:code id: tags:
```
python
config
=
parse_config
()
data_files
=
{
"sender"
:
"~/Work/Publications/rtn-2018/eval/20180420_base1/"
,
"receiver"
:
"~/Work/Publications/rtn-2018/eval/20180420_base1/"
}
x
=
4050
original1
=
evaluate
(
data_files
[
"sender"
]
+
"sender-1000000.csv"
,
data_files
[
"receiver"
]
+
"receiver-1000000.csv"
,
config
=
config
,
kind
=
0
).
iloc
[
0
:
x
]
original1
.
name
=
"1GHz"
original2
=
evaluate
(
data_files
[
"sender"
]
+
"sender-2000000.csv"
,
data_files
[
"receiver"
]
+
"receiver-2000000.csv"
,
config
=
config
,
kind
=
0
).
iloc
[
0
:
x
]
original2
.
name
=
"2GHz"
original3
=
evaluate
(
data_files
[
"sender"
]
+
"sender-3000000.csv"
,
data_files
[
"receiver"
]
+
"receiver-3000000.csv"
,
config
=
config
,
kind
=
0
).
iloc
[
0
:
x
]
original3
.
name
=
"3GHz"
data_files
=
{
"sender"
:
"~/Work/Publications/rtn-2018/eval/20180420_
base2
/"
,
"receiver"
:
"~/Work/Publications/rtn-2018/eval/20180420_
base2
/"
"sender"
:
"~/Work/Publications/rtn-2018/eval/20180420_
changed
/"
,
"receiver"
:
"~/Work/Publications/rtn-2018/eval/20180420_
changed
/"
}
original4
=
evaluate
(
data_files
[
"sender"
]
+
"sender-1000000.csv"
,
data_files
[
"receiver"
]
+
"receiver-1000000.csv"
,
config
=
config
,
kind
=
0
).
iloc
[
0
:
x
]
original4
.
name
=
"1GHz [2]"
original5
=
evaluate
(
data_files
[
"sender"
]
+
"sender-2000000.csv"
,
data_files
[
"receiver"
]
+
"receiver-2000000.csv"
,
config
=
config
,
kind
=
0
).
iloc
[
0
:
x
]
original5
.
name
=
"2GHz [2]"
original6
=
evaluate
(
data_files
[
"sender"
]
+
"sender-3000000.csv"
,
data_files
[
"receiver"
]
+
"receiver-3000000.csv"
,
config
=
config
,
kind
=
0
).
iloc
[
0
:
x
]
original6
.
name
=
"3GHz [2]"
dfs
=
[
original1
,
original4
,
original2
,
original5
,
original3
,
original6
]
```
%% Cell type:markdown id: tags:
## Traces
%% Cell type:code id: tags:
```
python
traces
(
original1
,
config
)
```
%% Cell type:markdown id: tags:
## Jitter Analysis
%% Cell type:code id: tags:
```
python
def
multi_trace_jitter
(
dfs
,
config
):
for
df
in
dfs
:
print
(
"############################ {} ############################"
.
format
(
df
.
name
))
jitter
.
trace_jitter
(
df
,
config
=
config
,
threshold
=
2
00
)
jitter
.
trace_jitter
(
df
,
config
=
config
,
threshold
=
5
00
)
multi_trace_jitter
(
dfs
,
config
)
```
%% Cell type:markdown id: tags:
## CDFs
%% Cell type:code id: tags:
```
python
multi_cdf
(
dfs
,
config
,
export
=
True
)
```
%% Cell type:markdown id: tags:
## Correlation
%% Cell type:code id: tags:
```
python
multi_correlation
(
dfs
,
config
,
export
=
True
)
```
%% Cell type:markdown id: tags:
## Latency Criticality
%% Cell type:code id: tags:
```
python
d
=
analyse
(
original1
,
config
)
```
%% Cell type:markdown id: tags:
### Correlations
%% Cell type:code id: tags:
```
python
d
.
corr
.
sort_values
(
ascending
=
False
)
```
%% Cell type:markdown id: tags:
### Control Flow Graph
%% Cell type:code id: tags:
```
python
d
.
cfg
```
%% Cell type:markdown id: tags:
# Kolmogorov
%% Cell type:code id: tags:
```
python
from
scipy
import
stats
from
xlap.analyse.util
import
extract_durations
import
numpy
as
np
def
timing_behaviour
(
df1
,
df2
,
config
,
confidence
=
0.9
):
durations
=
[
x
+
"_D"
for
x
in
extract_durations
(
config
)]
norm
=
lambda
x
:
x
/
np
.
max
(
x
)
for
duration
in
durations
:
rvs1
=
norm
(
df1
[
duration
])
rvs2
=
norm
(
df2
[
duration
])
stat
,
pvalue
=
stats
.
ks_2samp
(
rvs1
,
rvs2
)
result
=
"CANNOT REJECT"
if
pvalue
<
1
-
confidence
:
result
=
"REJECT"
print
(
duration
.
ljust
(
20
),
"{:.6f}"
.
format
(
pvalue
),
result
,
sep
=
"
\t\t
"
)
timing_behaviour
(
original1
,
original2
,
config
)
```
%% Cell type:code id: tags:
```
python
timing_behaviour
(
original1
,
original3
,
config
)
```
%% Cell type:code id: tags:
```
python
timing_behaviour
(
original2
,
original3
,
config
)
```
...
...
xlap.yml
View file @
a2680b19
...
...
@@ -39,14 +39,14 @@ stamps:
Source
:
sender
Thread
:
app_send
Type
:
time
#
PrrtSendPacketStart:
#
Source: sender
#
Thread: trans_send
#
Type: none
#
PrrtSendPacketEnd:
#
Source: sender
#
Thread: trans_send
#
Type: none
PrrtSendPacketStart
:
Source
:
sender
Thread
:
trans_send
Type
:
none
PrrtSendPacketEnd
:
Source
:
sender
Thread
:
trans_send
Type
:
none
PrrtTransmitStart
:
Source
:
sender
...
...
Write
Preview
Supports
Markdown
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