Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
RefinedC
Commits
2a4c5bcd
Commit
2a4c5bcd
authored
Mar 01, 2021
by
Michael Sammler
Browse files
destructive_gen_data.py for python 3.5
parent
551866b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
destructive_gen_data.py
View file @
2a4c5bcd
...
...
@@ -120,11 +120,11 @@ def compute_annots(FILES, global_rules):
o
=
subprocess
.
check_output
([
"tokei"
,
"--output=json"
,
"--files"
]
+
FILES
).
decode
(
"utf8"
)
# print(o)
inner
=
json
.
loads
(
o
)
if
"CHeader"
not
in
inner
:
inner
[
"CHeader"
]
=
{
"code"
:
0
,
"reports"
:
[]}
lines_total
=
inner
[
"C"
][
"code"
]
+
inner
[
"CHeader"
][
"code"
]
if
"C
Header"
not
in
inner
:
inner
[
"C
Header"
]
=
{
"code"
:
0
,
"reports"
:
[]}
lines_total
=
inner
[
"C"
][
"code"
]
+
inner
[
"C
Header"
][
"code"
]
lines_per_file
=
{}
for
s
in
inner
[
"C"
][
"reports"
]
+
inner
[
"CHeader"
][
"reports"
]:
for
s
in
inner
[
"C"
][
"reports"
]
+
inner
[
"C
Header"
][
"reports"
]:
lines_per_file
[
s
[
"name"
]]
=
s
[
"stats"
][
"code"
]
# count annotations
...
...
@@ -302,8 +302,13 @@ stats = [ {
# liInst Hevar γ.
for
cat
in
stats
:
for
prog
in
cat
[
"progs"
]:
# set to 0 if missing
prog
[
"stats"
][
"annot"
]
=
prog
[
"stats"
].
get
(
"annot"
,
0
)
prog
[
"stats"
][
"pure"
]
=
prog
[
"stats"
].
get
(
"pure"
,
0
)
if
prog
[
"name"
]
==
"Spinlock"
:
prog
[
"stats"
][
"annot"
]
+=
3
prog
[
"stats"
][
"overhead"
]
=
round
((
prog
[
"stats"
][
"annot"
]
+
prog
[
"stats"
][
"pure"
])
/
prog
[
"stats"
][
"LoC"
],
1
)
for
cat
in
stats
:
for
prog
in
cat
[
"progs"
]:
...
...
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