X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fretrace.cpp;h=ee876ca3eae2c5ebe092c374df1340b1c4a42020;hb=52cd6f0c427a1345ffeb578c01294bf602f16894;hp=1630995cdb440551232c6bdfcd214ea1f61f2abe;hpb=9d27a54b0381610c30964880a5fdd4c27bb6e732;p=apitrace diff --git a/retrace/retrace.cpp b/retrace/retrace.cpp index 1630995..ee876ca 100644 --- a/retrace/retrace.cpp +++ b/retrace/retrace.cpp @@ -35,18 +35,12 @@ namespace retrace { -trace::Parser parser; - - -int verbosity = 0; -bool profiling = false; - - static bool call_dumped = false; static void dumpCall(trace::Call &call) { if (verbosity >= 0 && !call_dumped) { + std::cout << std::hex << call.thread_id << std::dec << " "; std::cout << call; std::cout.flush(); call_dumped = true; @@ -89,13 +83,6 @@ void Retracer::addCallbacks(const Entry *entries) { void Retracer::retrace(trace::Call &call) { call_dumped = false; - if (verbosity >= 1) { - if (verbosity >= 2 || - !(call.flags & trace::CALL_FLAG_VERBOSE)) { - dumpCall(call); - } - } - Callback callback = 0; trace::Id id = call.sig->id; @@ -119,20 +106,15 @@ void Retracer::retrace(trace::Call &call) { assert(callback); assert(callbacks[id] == callback); - if (retrace::profiling) { - long long startTime = os::getTime(); - callback(call); - long long stopTime = os::getTime(); - float timeInterval = (stopTime - startTime) * (1.0E6 / os::timeFrequency); - - std::cout - << call.no << " " - << "[" << timeInterval << " usec] " - ; - trace::dump(call, std::cout, trace::DUMP_FLAG_NO_CALL_NO | trace::DUMP_FLAG_NO_COLOR); - } else { - callback(call); + if (verbosity >= 1) { + if (verbosity >= 2 || + (!(call.flags & trace::CALL_FLAG_VERBOSE) && + callback != &ignore)) { + dumpCall(call); + } } + + callback(call); }