Commit c1e3f5eb authored by nagayama15's avatar nagayama15

ログの出力形式を変更

parent 6eccca3c
#!/bin/zsh #!/bin/zsh
g() { g() {
NAME=$1 SIZE=$(stat -c %s $1)
SIZE=$(stat -c %s $NAME) LINES=$(wc -l $1 | awk '{print $1+1}')
LINES=$(wc -l $NAME | awk '{print $1+1}')
echo "name, $1, size, $SIZE, lines, $LINES" echo "$1, $SIZE, $LINES"
} }
f() { f() {
...@@ -13,5 +12,6 @@ f() { ...@@ -13,5 +12,6 @@ f() {
done done
} }
echo "name, size, lines"
f example/8cc/8cc/*.c f example/8cc/8cc/*.c
f example/zlib/zlib/*.c f example/zlib/zlib/*.c
...@@ -99,6 +99,8 @@ namespace ...@@ -99,6 +99,8 @@ namespace
perm_table_ = nykk::create_permutation_table(partition_opt.getValue().value); perm_table_ = nykk::create_permutation_table(partition_opt.getValue().value);
bit_pos_ = 0; bit_pos_ = 0;
llvm::errs() << "func" << ", " << "blocks" << ", " << "bits" << "\n";
return false; return false;
} }
...@@ -125,15 +127,13 @@ namespace ...@@ -125,15 +127,13 @@ namespace
*/ */
bool runOnFunction(llvm::Function& func) override bool runOnFunction(llvm::Function& func) override
{ {
llvm::errs() llvm::errs() << func.getName() << ", " << func.size() << ", ";
<< "[BlockWatermarker - '" << func.getName() << "' in " << module_name_ << "] Basic blocks: " << func.size() << "\n";
const auto partition = partition_opt.getValue().value; const auto partition = partition_opt.getValue().value;
if (func.size() <= partition) if (func.size() <= partition)
{ {
llvm::errs() llvm::errs() << 0 << "\n";
<< " function '" << func.getName() << "' is too small to watermark" << "\n";
return false; return false;
} }
...@@ -179,8 +179,7 @@ namespace ...@@ -179,8 +179,7 @@ namespace
last_block = &blocks[block_index].get(); last_block = &blocks[block_index].get();
} }
llvm::errs() llvm::errs() << num_embedded_bits << "\n";
<< " " << num_embedded_bits << "bit watermark embedded in function '" << func.getName() << "'" << "\n";
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment