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
75db8254
Commit
75db8254
authored
Dec 02, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解析スクリプトに集計機能を追加
parent
0757d4f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
4 deletions
+45
-4
aggregate.zsh
scripts/aggregate.zsh
+30
-0
analyze.zsh
scripts/analyze.zsh
+15
-4
No files found.
scripts/aggregate.zsh
0 → 100644
View file @
75db8254
#!/bin/zsh
g
()
{
FILE
=
$(
basename
${
1
/-log.txt/.c
})
FUNCS
=
$(
tail
-n
+2
$1
|
wc
-l
)
BLOCKS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$2} END {print a}'
)
BITS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$3} END {print a}'
)
echo
"
$FILE
,
$FUNCS
,
$BLOCKS
,
$BITS
"
}
f
()
{
for
i
in
"
$@
"
do
g
$i
done
}
h
()
{
R
=
$(
f
$@
)
FILES
=
$(
echo
$R
|
wc
-l
)
FUNCS
=
$(
echo
$R
|
awk
'{a+=$2} END {print a}'
)
BLOCKS
=
$(
echo
$R
|
awk
'{a+=$3} END {print a}'
)
BITS
=
$(
echo
$R
|
awk
'{a+=$4} END {print a}'
)
echo
"file, funcs, blocks, bits"
echo
$R
echo
"files:
$FILES
, funcs:
$FUNCS
, blocks:
$BLOCKS
, bits:
$BITS
"
}
h obj/example/8cc/stage1-wm/
*
-log
.txt
h obj/example/zlib/zlib-77/
*
-log
.txt
scripts/analyze.zsh
View file @
75db8254
#!/bin/zsh
#!/bin/zsh
g
()
{
g
()
{
FILE
=
$(
basename
$1
)
SIZE
=
$(
stat
-c
%s
$1
)
SIZE
=
$(
stat
-c
%s
$1
)
LINES
=
$(
wc
-l
$1
|
awk
'{print $1+1}'
)
LINES
=
$(
wc
-l
$1
|
awk
'{print $1+1}'
)
echo
"
$
1
,
$SIZE
,
$LINES
"
echo
"
$
FILE
,
$SIZE
,
$LINES
"
}
}
f
()
{
f
()
{
...
@@ -12,6 +13,16 @@ f() {
...
@@ -12,6 +13,16 @@ f() {
done
done
}
}
echo
"name, size, lines"
h
()
{
f example/8cc/8cc/
*
.c
R
=
$(
f
$@
)
f example/zlib/zlib/
*
.c
FILES
=
$(
echo
$R
|
wc
-l
)
SIZE
=
$(
echo
$R
|
awk
'{a+=$2} END {print a}'
)
LINES
=
$(
echo
$R
|
awk
'{a+=$3} END {print a}'
)
echo
"name, size, lines"
echo
"
$R
"
echo
"files:
$FILES
, size:
$SIZE
, lines:
$LINES
"
}
h
`
ls
example/8cc/8cc/
*
.c |
awk
-F
'example/8cc/8cc/utiltest.c'
'{print $NF}'
`
h example/zlib/zlib/
*
.c
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