summaryrefslogtreecommitdiffstats
path: root/coveragedb.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-09-10 17:21:44 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-09-10 17:21:44 -0400
commitf76427a2bf80e4451e5e8d0c26b06aca65e4e2c4 (patch)
tree0c90ae0cf7b3c2758226feab577d6273528b2ef1 /coveragedb.cxx
parente0c72583f8fb7a61d052c58b8e9c6df0925bc234 (diff)
downloadsystemtap-steved-f76427a2bf80e4451e5e8d0c26b06aca65e4e2c4.tar.gz
systemtap-steved-f76427a2bf80e4451e5e8d0c26b06aca65e4e2c4.tar.xz
systemtap-steved-f76427a2bf80e4451e5e8d0c26b06aca65e4e2c4.zip
PR6876: translator speedup for many $vars
Diffstat (limited to 'coveragedb.cxx')
-rw-r--r--coveragedb.cxx30
1 files changed, 16 insertions, 14 deletions
diff --git a/coveragedb.cxx b/coveragedb.cxx
index 63cc4c0f..aafcd545 100644
--- a/coveragedb.cxx
+++ b/coveragedb.cxx
@@ -62,11 +62,12 @@ void print_coverage_info(systemtap_session &s)
}
// print out used functions
clog << "---- used functions----- " << endl;
- for (unsigned i=0; i<s.functions.size(); i++) {
- clog << "function: " << s.functions[i]->tok->location
- << " " << s.functions[i]->name
- << endl;
- }
+ for (map<string,functiondecl*>::iterator it = s.functions.begin(); it != s.functions.end(); it++)
+ {
+ clog << "function: " << it->second->tok->location
+ << " " << it->second->name
+ << endl;
+ }
// print out unused functions
clog << "---- unused functions----- " << endl;
for (unsigned i=0; i<s.unused_functions.size(); i++) {
@@ -262,15 +263,16 @@ void
sql_update_used_functions(sqlite3 *db, systemtap_session &s)
{
// update db used functions
- for (unsigned i=0; i<s.functions.size(); i++) {
- struct source_loc place = s.functions[i]->tok->location;
- coverage_element x(place);
-
- x.type = db_type_function;
- x.name = s.functions[i]->name;
- x.compiled = 1;
- increment_element(db, x);
- }
+ for (map<string,functiondecl*>::iterator it = s.functions.begin(); it != s.functions.end(); it++)
+ {
+ struct source_loc place = it->second->tok->location;
+ coverage_element x(place);
+
+ x.type = db_type_function;
+ x.name = it->second->name;
+ x.compiled = 1;
+ increment_element(db, x);
+ }
}