Commit 4e60ab52 authored by Julian Kranz's avatar Julian Kranz

Statistics

parent 6b25734e
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -17,13 +17,13 @@ $ wc -l gdsl.*
1021 gdsl.h
36220 total
libgdsl.so: 457K
gdsl.o=>.text: 295K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.201872 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 1.095589 seconds; memory: 2699667296 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.215298 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 1.144838 seconds; memory: 2699667296 bytes, maximal memory: 2592 bytes
(2)
......@@ -71,13 +71,13 @@ $ wc -l gdsl.*
1021 gdsl.h
36220 total
libgdsl.so: 671K
gdsl.o=>.text: 511K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.197324 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 3.605407 seconds; memory: 2699667296 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.215975 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 3.527424 seconds; memory: 2699667296 bytes, maximal memory: 2592 bytes
(4)
......@@ -125,13 +125,13 @@ $ wc -l gdsl.*
1021 gdsl.h
36234 total
libgdsl.so: 445K
gdsl.o=>.text: 284K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.179657 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 1.186429 seconds; memory: 3112294728 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.195937 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 1.229216 seconds; memory: 3112294728 bytes, maximal memory: 3216 bytes
(6)
......@@ -179,13 +179,13 @@ $ wc -l gdsl.*
1021 gdsl.h
36234 total
libgdsl.so: 659K
gdsl.o=>.text: 499K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.202058 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 4.043878 seconds; memory: 3112294728 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.194375 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 4.045660 seconds; memory: 3112294728 bytes, maximal memory: 3216 bytes
(8)
......@@ -233,13 +233,13 @@ $ wc -l gdsl.*
1018 gdsl.h
37215 total
libgdsl.so: 543K
gdsl.o=>.text: 388K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.206049 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 3.727403 seconds; memory: 12510270112 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.240584 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 3.791024 seconds; memory: 12510270112 bytes, maximal memory: 11184 bytes
(10)
......@@ -287,13 +287,13 @@ $ wc -l gdsl.*
1018 gdsl.h
37215 total
libgdsl.so: 763K
gdsl.o=>.text: 605K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.208432 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 9.883397 seconds; memory: 12510270112 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.272345 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 9.946860 seconds; memory: 12510270112 bytes, maximal memory: 11184 bytes
(12)
......@@ -341,13 +341,13 @@ $ wc -l gdsl.*
1018 gdsl.h
41686 total
libgdsl.so: 939K
gdsl.o=>.text: 764K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.220009 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 3.807403 seconds; memory: 14576513216 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.221912 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 3.839121 seconds; memory: 14576513216 bytes, maximal memory: 14736 bytes
(14)
......@@ -395,13 +395,13 @@ $ wc -l gdsl.*
1018 gdsl.h
41686 total
libgdsl.so: 1,2M
gdsl.o=>.text: 945K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.200499 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 11.397309 seconds; memory: 14576513216 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.244342 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 11.602962 seconds; memory: 14576513216 bytes, maximal memory: 14736 bytes
(16)
......@@ -449,13 +449,13 @@ $ wc -l gdsl.*
1018 gdsl.h
41682 total
libgdsl.so: 939K
gdsl.o=>.text: 765K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.207489 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 3.930880 seconds; memory: 14576513216 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.215973 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 3.945462 seconds; memory: 14576513216 bytes, maximal memory: 14736 bytes
(18)
......@@ -503,13 +503,13 @@ $ wc -l gdsl.*
1018 gdsl.h
41682 total
libgdsl.so: 1,2M
gdsl.o=>.text: 945K
$ ./xed-cmp /usr/bin/clang >/dev/null
file is /usr/bin/clang
.text is 11530764 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.204465 seconds; memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 11.295275 seconds; memory: 14576513216 bytes
XED: Decoded 2667829 opcode sequences (488 invalid/unknown); time: 1.212720 seconds; memory: 0 bytes, maximal memory: 0 bytes
GDSL: Decoded 2667248 opcode sequences (0 invalid/unknown); time: 11.357760 seconds; memory: 14576513216 bytes, maximal memory: 14736 bytes
(20)
......
#!/bin/bash
if [ "$1" -eq 12 ]; then
export XED=/home/jucs/Downloads/pin-2.12-58423-gcc.4.4.7-linux/extras/xed2-intel64
fi
if [ "$1" -eq 11 ]; then
export XED=/home/jucs/Downloads/pin-2.11-49306-gcc.3.4.6-ia32_intel64-linux/extras/xed2-intel64
fi
make -B
./xed-cmp /usr/bin/clang >/dev/null
./xed-cmp /usr/bin/clang >/dev/null
......@@ -13,6 +13,7 @@ struct decode_result {
unsigned int decoded;
unsigned int invalid;
size_t memory;
size_t memory_max;
long time;
};
......@@ -59,8 +60,6 @@ static struct decode_result xed_decode_blob(unsigned char *blob, size_t size) {
clock_gettime(CLOCK_REALTIME, &end);
result.time = end.tv_sec * NANOS + end.tv_nsec - start.tv_nsec - start.tv_sec * NANOS;
result.memory = 0;
return result;
}
......@@ -90,7 +89,10 @@ static struct decode_result gdsl_decode_blob(unsigned char *blob, size_t size) {
string_t fmt = gdsl_merge_rope(state, gdsl_pretty(state, insn));
puts(fmt);
result.memory += gdsl_heap_residency(state);
size_t residency = gdsl_heap_residency(state);
result.memory += residency;
if(residency > result.memory_max)
result.memory_max = residency;
gdsl_reset_heap(state);
......@@ -137,10 +139,10 @@ int main(int argc, char** argv) {
struct decode_result gdsl_result = gdsl_decode_blob(blob, sz);
fprintf(stderr, "XED: Decoded %u opcode sequences (%u invalid/unknown); time: %lf seconds; memory: %zu bytes\n", xed_result.decoded,
xed_result.invalid, xed_result.time / (double)(1000000000), xed_result.memory);
fprintf(stderr, "GDSL: Decoded %u opcode sequences (%u invalid/unknown); time: %lf seconds; memory: %zu bytes\n", gdsl_result.decoded,
gdsl_result.invalid, gdsl_result.time / (double)(1000000000), gdsl_result.memory);
fprintf(stderr, "XED: Decoded %u opcode sequences (%u invalid/unknown); time: %lf seconds; memory: %zu bytes, maximal memory: %zu bytes\n", xed_result.decoded,
xed_result.invalid, xed_result.time / (double)(1000000000), xed_result.memory, xed_result.memory_max);
fprintf(stderr, "GDSL: Decoded %u opcode sequences (%u invalid/unknown); time: %lf seconds; memory: %zu bytes, maximal memory: %zu bytes\n", gdsl_result.decoded,
gdsl_result.invalid, gdsl_result.time / (double)(1000000000), gdsl_result.memory, gdsl_result.memory_max);
return (0);
}
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