From: Philippe E. <ph...@us...> - 2003-04-27 21:10:14
|
Update of /cvsroot/oprofile/oprofile/pp In directory sc8-pr-cvs1:/tmp/cvs-serv12704/pp Modified Files: Tag: pp-interface-branch opreport.cpp opreport_options.cpp opreport_options.h Log Message: handle --threshold, remove --ignore-symbols regards, Phil Index: opreport.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/Attic/opreport.cpp,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -u -d -r1.1.2.11 -r1.1.2.12 --- opreport.cpp 27 Apr 2003 18:51:59 -0000 1.1.2.11 +++ opreport.cpp 27 Apr 2003 21:10:08 -0000 1.1.2.12 @@ -229,9 +229,8 @@ } } - // FIXME options::ignore_symbols vector<symbol_entry const *> symbols = - samples.select_symbols(0.0, false); + samples.select_symbols(options::threshold / 100.0, false); bool need_vma64 = vma64_p(symbols.begin(), symbols.end()); Index: opreport_options.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/Attic/opreport_options.cpp,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -u -d -r1.1.2.10 -r1.1.2.11 --- opreport_options.cpp 25 Apr 2003 15:33:59 -0000 1.1.2.10 +++ opreport_options.cpp 27 Apr 2003 21:10:09 -0000 1.1.2.11 @@ -34,7 +34,6 @@ bool debug_info; bool details; double threshold; - bool percent_threshold; bool include_dependent; bool hide_dependent; bool sort_by_vma; @@ -42,7 +41,6 @@ bool sort_by_symbol; bool sort_by_debug; bool sort_by_image; - vector<string> ignore_symbols; vector<string> exclude_symbols; vector<string> image_path; merge_option merge_by; @@ -77,8 +75,6 @@ "include libs, modules in %-age count but hide them in output"), popt::option(sort_by, "sort", 's', "sort by", "vma,sample,symbol,debug,image"), - popt::option(options::ignore_symbols, "ignore-symbols", 'i', - "ignore these comma separated symbols", "symbols"), popt::option(options::exclude_symbols, "exclude-symbols", 'e', "exclude these comma separated symbols", "symbols"), popt::option(options::image_path, "image-path", 'p', @@ -106,15 +102,20 @@ istringstream ss(threshold); if (ss >> value) { options::threshold = value; - char ch; - if (ss >> ch && ch == '%') { - options::percent_threshold = true; - } + } else { + cerr << "illegal threshold value: " << threshold + << " allowed range: [0-100]" << endl; + exit(EXIT_FAILURE); + } + + if (options::threshold < 0.0 || options::threshold > 100.0) { + cerr << "illegal threshold value: " << threshold + << " allowed range: [0-100]" << endl; + exit(EXIT_FAILURE); } } - cverb << options::threshold << (options::percent_threshold ? "%" : "") - << endl;; + cverb << options::threshold << endl;; } // FIXME: separate file if reused Index: opreport_options.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/Attic/opreport_options.h,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -d -r1.1.2.7 -r1.1.2.8 --- opreport_options.h 27 Apr 2003 18:52:00 -0000 1.1.2.7 +++ opreport_options.h 27 Apr 2003 21:10:09 -0000 1.1.2.8 @@ -31,8 +31,8 @@ extern bool global_percent; extern bool short_filename; extern std::vector<std::string> exclude_symbols; - extern std::vector<std::string> ignore_symbols; extern std::vector<std::string> image_path; + extern double threshold; } /** |