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
Christian Dietrich
clang-hash
Commits
2d15ea88
Commit
2d15ea88
authored
Jan 30, 2017
by
Christian Dietrich
Browse files
historical experiment: record ccache stats and hits
parent
19a70510
Changes
2
Hide whitespace changes
Inline
Side-by-side
experiments/historical_build.py
View file @
2d15ea88
...
...
@@ -27,6 +27,8 @@ class HistoricalCompilation(Experiment, ClangHashHelper):
}
outputs
=
{
"stats"
:
File
(
"summary.dict"
),
"ccache_stats"
:
File
(
"ccache.stats"
),
"clang_hash_stats"
:
File
(
"clang-hash.stats"
),
}
def
build_parent
(
self
,
commit
,
from_scratch
=
False
):
...
...
@@ -88,6 +90,9 @@ class HistoricalCompilation(Experiment, ClangHashHelper):
"commit-hash"
:
self
.
metadata
[
"project-hash"
],
'builds'
:
[]}
if
self
.
mode
.
value
==
"ccache-clang-hash"
:
os
.
environ
[
"CLANG_HASH_LOGFILE"
]
=
self
.
clang_hash_stats
.
path
with
self
.
project
as
src_path
:
(
commits
,
_
)
=
shell
(
"cd %s; git log --no-merges --oneline --topo-order --format='%%H %%P %%s'"
,
src_path
)
# [0] is hash. [1] is parent, [2] rest
...
...
@@ -145,6 +150,9 @@ class HistoricalCompilation(Experiment, ClangHashHelper):
with
open
(
self
.
stats
.
path
,
"w+"
)
as
fd
:
fd
.
write
(
repr
(
self
.
build_info
))
if
"ccache"
in
self
.
mode
.
value
:
shell
(
"ccache -s > %s"
,
self
.
ccache_stats
.
path
)
def
variant_name
(
self
):
return
"%s-%s"
%
(
self
.
project_name
(),
self
.
metadata
[
'mode'
])
...
...
experiments/lib.py
View file @
2d15ea88
...
...
@@ -30,6 +30,8 @@ class ClangHashHelper:
cache_dir
=
os
.
path
.
join
(
self
.
tmp_directory
.
path
,
"ccache"
)
os
.
mkdir
(
cache_dir
)
os
.
environ
[
"CCACHE_DIR"
]
=
cache_dir
os
.
environ
[
"CCACHE_LOGFILE"
]
=
"/tmp/lua.ccache.log"
if
self
.
mode
.
value
==
"normal"
:
CC
=
os
.
path
.
join
(
clang_path
,
"build/wrappers/clang-normal"
)
...
...
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