Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pefoley2 committed May 10, 2016
1 parent 4a570c2 commit 7938023
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
display
dynprof
out_dynprof.*
dyninst.h.gch
CMakeCache.txt
CMakeFiles
work
display
dyninst.h.gch
dynprof
*_dynprof
example/test
example/time
*.swp
*.o
libdynprof.so
test_dynprof
*.o
out_dynprof.*
*.swp
work
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ifneq ($(filter clang++,$(CXX)),)
CXXFLAGS += -Weverything -Wno-c++98-compat
endif

CXXFLAGS += -ggdb3
#CXXFLAGS += -ggdb3
#CXXFLAGS += -O2
#CXXFLAGS += -flto
#CXXFLAGS += -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity
Expand Down
8 changes: 6 additions & 2 deletions display.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ double Output::elapsed_time(CallPair calls) {
}

void Output::process_output(FuncMap funcs) {
std::cerr << "%\tcummulative\tself" << std::endl;
std::cerr << "time\tseconds\t\tseconds\t\tcalls\tname" << std::endl;
double total = elapsed_time(funcs[DEFAULT_ENTRY_POINT].at(0));
std::vector<FuncOutput> output;
for (auto func : funcs) {
Expand All @@ -65,8 +63,14 @@ void Output::process_output(FuncMap funcs) {
}
output.push_back({(ftime / total * 100), ftime, func.second.size(), func.first});
}
std::cerr << "%\tcummulative\tself" << std::endl;
std::cerr << "time\tseconds\t\tseconds\t\tcalls\tname" << std::endl;
std::sort(output.begin(), output.end());
for(auto func: output) {
// FIXME: figure out what's going on here.
if(func.percent < 0) {
func.percent = func.elapsed = -1;
}
std::cerr << std::fixed << std::setprecision(2) << func.percent << "\t"
<< "TODO"
<< "\t\t" << std::setprecision(5) << func.elapsed << "\t\t" << func.calls << "\t"
Expand Down
4 changes: 2 additions & 2 deletions display.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ struct FuncOutput {
double elapsed;
size_t calls;
std::string name;
// Default to sorting output by number of calls.
// Default to sorting output by percent of total execution time in descending order.
bool operator<(const FuncOutput &other) {
return calls < other.calls;
return percent > other.percent;
}
};

Expand Down

0 comments on commit 7938023

Please sign in to comment.