summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-06-08 16:37:00 -0700
committerJosh Stone <jistone@redhat.com>2009-06-08 16:37:00 -0700
commitf517ee24c58413f7de89ede71c728579c12ace5b (patch)
tree8fdc568392f071b62eac5264ae326ba10662cc85 /dwflpp.cxx
parent0e14e0793ffb891bccd465cf518480685e3cd49e (diff)
downloadsystemtap-steved-f517ee24c58413f7de89ede71c728579c12ace5b.tar.gz
systemtap-steved-f517ee24c58413f7de89ede71c728579c12ace5b.tar.xz
systemtap-steved-f517ee24c58413f7de89ede71c728579c12ace5b.zip
Remove dwflpp::default_name
It was just a basic NULL check, but creating its string temporaries was causing a fair slowdown. Removing this function and adjusting the callers shaves ~5% off the syscall.* elaboration time.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index 1a589771..74294384 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -84,15 +84,6 @@ dwflpp::~dwflpp()
}
-string const
-dwflpp::default_name(char const * in, char const *)
-{
- if (in)
- return in;
- return string("");
-}
-
-
void
dwflpp::get_module_dwarf(bool required, bool report)
{
@@ -129,10 +120,8 @@ dwflpp::focus_on_module(Dwfl_Module * m, module_info * mi)
mod_info = mi;
if (m)
{
- module_name = default_name(dwfl_module_info(module, NULL,
- &module_start, &module_end,
- NULL, NULL, NULL, NULL),
- "module");
+ module_name = dwfl_module_info(module, NULL, &module_start, &module_end,
+ NULL, NULL, NULL, NULL) ?: "module";
}
else
{
@@ -162,7 +151,7 @@ dwflpp::focus_on_cu(Dwarf_Die * c)
assert(module);
cu = c;
- cu_name = default_name(dwarf_diename(c), "CU");
+ cu_name = dwarf_diename(c) ?: "CU";
// Reset existing pointers and names
function_name.clear();
@@ -181,7 +170,7 @@ dwflpp::focus_on_function(Dwarf_Die * f)
assert(cu);
function = f;
- function_name = default_name(dwarf_diename(function), "function");
+ function_name = dwarf_diename(function) ?: "function";
}