Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
llvm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
llvm-watermarker
Commits
f5292cf0
Commit
f5292cf0
authored
Dec 14, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
集計スクリプトを更新
parent
9bc6505e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
9 deletions
+34
-9
Makefile
example/zlib/Makefile
+1
-1
aggregate.zsh
scripts/aggregate.zsh
+32
-7
InstructionWatermarkPass.cpp
src/nykk/pass/InstructionWatermarkPass.cpp
+1
-1
No files found.
example/zlib/Makefile
View file @
f5292cf0
...
...
@@ -66,7 +66,7 @@ ${OBJ_DIR}/zlib-wm/%.o: zlib/%.c
@
mkdir
-p
${
@D
}
clang
${
CFLAGS
}
-emit-llvm
-S
-o
${
@
:.o
=.ll
}
$<
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-block-wm.ll
}
${
@
:.o
=.ll
}
2>
${
@
:%.o
=%-block-wm.txt
}
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-
block
-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-inst-wm.ll
}
${
@
:.o
=-block-wm.ll
}
2>
${
@
:%.o
=%-inst-wm.txt
}
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-
inst
-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-inst-wm.ll
}
${
@
:.o
=-block-wm.ll
}
2>
${
@
:%.o
=%-inst-wm.txt
}
clang
${
CFLAGS
}
-o
$@
-c
${
@
:%.o
=%-inst-wm.ll
}
${OBJ_DIR}/test.o
:
test.cpp
...
...
scripts/aggregate.zsh
View file @
f5292cf0
#!/bin/zsh
g
()
{
g
1
()
{
FILE
=
$(
basename
${
1
/-block-wm.txt/.c
})
FUNCS
=
$(
tail
-n
+2
$1
|
wc
-l
)
BLOCKS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$2} END {print a}'
)
...
...
@@ -8,19 +8,44 @@ g() {
echo
"
$FILE
,
$FUNCS
,
$BLOCKS
,
$BITS
"
}
f
()
{
f
1
()
{
for
i
in
"
$@
"
do
g
$i
do
g
1
$i
done
}
h
()
{
R
=
$(
f
$@
)
h
1
()
{
R
=
$(
f
1
$@
)
echo
"file, funcs, blocks, bits"
echo
"
$R
"
echo
"
$R
"
|
awk
'{f++; a+=$2; b+=$3; c+=$4} END {print "files: " f ", funcs: " a ", blocks: " b ", bits: " c}'
}
h obj/example/8cc/stage1-wm/
*
-block-wm
.txt
h obj/example/zlib/zlib-wm/
*
-block-wm
.txt
g2
()
{
FILE
=
$(
basename
${
1
/-inst-wm.txt/.c
})
INSTS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$2} END {print a}'
)
BITS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$3} END {print a}'
)
echo
"
$FILE
,
$INSTS
,
$BITS
"
}
f2
()
{
for
i
in
"
$@
"
do
g2
$i
done
}
h2
()
{
R
=
$(
f2
$@
)
echo
"file, insts, bits"
echo
"
$R
"
echo
"
$R
"
|
awk
'{f++; a+=$2; b+=$3} END {print "files: " f ", insts: " a ", bits: " b}'
}
h1 obj/example/8cc/stage1-wm/
*
-block-wm
.txt
h1 obj/example/zlib/zlib-wm/
*
-block-wm
.txt
h2 obj/example/8cc/stage1-wm/
*
-inst-wm
.txt
h2 obj/example/zlib/zlib-wm/
*
-inst-wm
.txt
src/nykk/pass/InstructionWatermarkPass.cpp
View file @
f5292cf0
...
...
@@ -104,7 +104,7 @@ namespace
}
}
llvm
::
errs
()
<<
block
.
getParent
()
->
getName
()
<<
",
"
<<
block
.
size
()
<<
",
"
<<
num_embedded_bits
<<
"
\n
"
;
llvm
::
errs
()
<<
block
.
getParent
()
->
getName
()
<<
",
"
<<
block
.
size
()
<<
",
"
<<
num_embedded_bits
<<
"
\n
"
;
return
is_changed
;
}
...
...
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