From: Philippe E. <ph...@us...> - 2001-09-16 03:27:49
|
Update of /cvsroot/oprofile/oprofile/pp In directory usw-pr-cvs1:/tmp/cvs-serv21923/oprofile/pp Modified Files: opf_container.cpp opf_filter.cpp Log Message: typo Index: opf_container.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/opf_container.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- opf_container.cpp 2001/09/06 18:13:28 1.5 +++ opf_container.cpp 2001/09/16 03:27:47 1.6 @@ -25,10 +25,7 @@ #include "opf_filter.h" -namespace { - // FIXME ! - uint op_nr_counters = 2; -} +extern uint op_nr_counters; //--------------------------------------------------------------------------- // Functors used as predicate for vma comparison. @@ -185,10 +182,10 @@ if (range_iterator_sorted_p(v.begin(), v.end(), less_sample_entry_by_vma()) == false) { - cerr << "post condition fail : symbol_vector not " + cerr << "opf_filter: post condition fail : symbol_vector not " << "sorted by increased vma" << endl; - exit(1); + exit(EXIT_FAILURE); } } @@ -383,10 +380,10 @@ if (range_iterator_sorted_p(v.begin(), v.end(), less_sample_entry_by_vma()) == false) { - cerr << "post condition fail : counter_vector not " + cerr << "opf_filter: post condition fail : counter_vector not " << "sorted by increased vma" << endl; - exit(1); + exit(EXIT_FAILURE); } } Index: opf_filter.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/opf_filter.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- opf_filter.cpp 2001/09/08 21:46:04 1.6 +++ opf_filter.cpp 2001/09/16 03:27:47 1.7 @@ -45,9 +45,10 @@ double do_ratio(size_t a, size_t total); +} + // The correct value is passed by oprofpp on standard input. uint op_nr_counters = 2; -} //--------------------------------------------------------------------------- // Just allow to read one line in advance and to put_back this line. @@ -103,7 +104,7 @@ bool treat_input(input &); - void debug_dump_vector(ostream & out) const; + void debug_dump_vector() const; private: void output_command_line() const; @@ -353,23 +354,23 @@ { } -void output::debug_dump_vector(ostream & out) const { +void output::debug_dump_vector() const { - out << "total samples :"; + cerr << "total samples :"; for (size_t i = 0 ; i < op_nr_counters ; ++i) - cout << " " << counter_info[i].total_samples; + cerr << " " << counter_info[i].total_samples; - cout << endl; + cerr << endl; for (size_t i = 0 ; i < symbols.size() ; ++i) { - symbols[i].debug_dump(cout); - cout << endl; + symbols[i].debug_dump(cerr); + cerr << endl; for (size_t j = symbols[i].first ; j < symbols[i].last; ++j) { - samples[j].debug_dump(cout); - cout << endl; + samples[j].debug_dump(cerr); + cerr << endl; } } } @@ -461,12 +462,11 @@ for (size_t i = 0 ; i < op_nr_counters ; ++i) { if (total_counter[i] != counter_info[i].total_samples) { - cerr << "output::calc_total_samples() : " - << "bad counter accumulation" + cerr << "opf_filter: output::calc_total_samples() : bad counter accumulation" << " " << total_counter[i] << " " << counter_info[i].total_samples << endl; - exit(1); + exit(EXIT_FAILURE); } } } @@ -734,7 +734,7 @@ ifstream in(file_by_samples[i].filename.c_str()); if (!in) { - cerr << "unable to open for reading: " << file_by_samples[i].filename << endl; + cerr << "opf_filter (warning): unable to open for reading: " << file_by_samples[i].filename << endl; } else { if (until_more_than_samples) { do_output_one_file(in, file_by_samples[i].filename, @@ -766,7 +766,8 @@ break; } - cerr << "sort_by_counter invalid or counter[sort_by_counter] disabled : switch " + cerr << "opf_filter (warning): sort_by_counter invalid or " + << "counter[sort_by_counter] disabled : switch " << "to the first valid counter " << index << endl; } @@ -825,9 +826,9 @@ for (size_t i = 0 ; i < symbols.size() ; ++i) { if (sanity_check_symbol_entry(i) == false) { - cerr << "post condition fail : symbols range failure" << endl; + cerr << "opf_filter: post condition fail : symbols range failure" << endl; - exit(1); + exit(EXIT_FAILURE); } } } @@ -927,7 +928,7 @@ in.read_line(str); if (sscanf(str.c_str(), "Cpu type: %d", &cpu_type) != 1) { - cerr << "unable to read cpu_type\n"; + cerr << "opf_filter: unable to read cpu_type\n"; return false; } @@ -938,7 +939,7 @@ in.read_line(str); if (sscanf(str.c_str(), "Cpu speed was (MHz estimation) : %lf", &cpu_speed) != 1) { - cerr << "unable to read cpu_speed\n"; + cerr << "opf_filter: unable to read cpu_speed\n"; return false; } @@ -950,7 +951,7 @@ } if (!have_counter_info) { - cerr << "Malformed input, expect at least one counter description" << endl; + cerr << "opf_filter: malformed input, expect at least one counter description" << endl; return false; } @@ -960,7 +961,7 @@ // debug_dump_vector(out); if (calc_total_samples() == false) { - cerr << "The input contains zero samples" << endl; + cerr << "opf_filter: the input contains zero samples" << endl; return false; } @@ -1081,15 +1082,15 @@ } catch (const string & e) { - cerr << "Exception : " << e << endl; + cerr << "opf_filter: Exception : " << e << endl; return 1; } catch (const char * e) { - cerr << "Exception : " << e << endl; + cerr << "opf_flter: Exception : " << e << endl; return 1; } catch (...) { - cerr << "Unknown exception : really sorry " << endl; + cerr << "opf_filter: Unknown exception : really sorry " << endl; return 1; } |