projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fall back to .debug_info scan in fatal signal handler
[folly.git]
/
folly
/
experimental
/
symbolizer
/
test
/
DwarfBenchmark.cpp
diff --git
a/folly/experimental/symbolizer/test/DwarfBenchmark.cpp
b/folly/experimental/symbolizer/test/DwarfBenchmark.cpp
index 877b58118014fbc40851761f4da0707860d79bfc..50f63c80f94d30f6d4a8a93e6b5ea25ee55dbc8c 100644
(file)
--- a/
folly/experimental/symbolizer/test/DwarfBenchmark.cpp
+++ b/
folly/experimental/symbolizer/test/DwarfBenchmark.cpp
@@
-20,9
+20,12
@@
void dummy() {}
void dummy() {}
-BENCHMARK(DwarfFindAddress, n) {
+namespace {
+
+using namespace folly::symbolizer;
+
+void run(Dwarf::LocationInfoMode mode, size_t n) {
folly::BenchmarkSuspender suspender;
folly::BenchmarkSuspender suspender;
- using namespace folly::symbolizer;
// NOTE: Using '/proc/self/exe' only works if the code for @dummy is
// statically linked into the binary.
ElfFile elf("/proc/self/exe");
// NOTE: Using '/proc/self/exe' only works if the code for @dummy is
// statically linked into the binary.
ElfFile elf("/proc/self/exe");
@@
-30,10
+33,20
@@
BENCHMARK(DwarfFindAddress, n) {
suspender.dismiss();
for (size_t i = 0; i < n; i++) {
Dwarf::LocationInfo info;
suspender.dismiss();
for (size_t i = 0; i < n; i++) {
Dwarf::LocationInfo info;
- dwarf.findAddress(uintptr_t(&dummy), info);
+ dwarf.findAddress(uintptr_t(&dummy), info
, mode
);
}
}
}
}
+} // namespace
+
+BENCHMARK(DwarfFindAddressFast, n) {
+ run(folly::symbolizer::Dwarf::LocationInfoMode::FAST, n);
+}
+
+BENCHMARK(DwarfFindAddressFull, n) {
+ run(folly::symbolizer::Dwarf::LocationInfoMode::FULL, n);
+}
+
int main(int argc, char* argv[]) {
gflags::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);
int main(int argc, char* argv[]) {
gflags::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);