From: Philippe E. <ph...@us...> - 2002-01-17 05:31:39
|
Update of /cvsroot/oprofile/oprofile/gui In directory usw-pr-cvs1:/tmp/cvs-serv24197/oprofile/gui Modified Files: oprof_start.cpp oprof_start.h oprof_start_config.h Log Message: gui: small fix for rtc Index: oprof_start.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/gui/oprof_start.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- oprof_start.cpp 2002/01/15 16:25:28 1.36 +++ oprof_start.cpp 2002/01/17 05:31:36 1.37 @@ -455,7 +455,7 @@ QString count_text; count_text.setNum(cfg[descrp->name].count); event_count_edit->setText(count_text); - event_count_validator->setRange(descrp->min_count, OP_MAX_PERF_COUNT); + event_count_validator->setRange(descrp->min_count, max_perf_count()); event_help_label->setText(descrp->help_str.c_str()); @@ -703,6 +703,11 @@ setup_config_tab->setMinimumSize(setup_config_tab->sizeHint()); } +uint oprof_start::max_perf_count() const +{ + return cpu_type == CPU_RTC ? OP_MAX_RTC_COUNT : OP_MAX_PERF_COUNT; +} + void oprof_start::on_flush_profiler_data() { if (daemon_status().running) @@ -745,13 +750,13 @@ } if (cfg[descr->name].count < descr->min_count || - cfg[descr->name].count > OP_MAX_PERF_COUNT) { + cfg[descr->name].count > max_perf_count()) { std::ostringstream out; out << "event " << descr->name << " count of range: " << cfg[descr->name].count << " must be in [ " << descr->min_count << ", " - << OP_MAX_PERF_COUNT + << max_perf_count() << "]"; QMessageBox::warning(this, 0, out.str().c_str()); Index: oprof_start.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/gui/oprof_start.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- oprof_start.h 2002/01/03 00:51:48 1.16 +++ oprof_start.h 2002/01/17 05:31:36 1.17 @@ -103,6 +103,9 @@ /// set the unit mask widgets for given event void setup_unit_masks(op_event_descr const & descr); + /// return the maximum perf counter value for the current cpu type + uint max_perf_count() const; + /// show an event's settings void display_event(struct op_event_descr const * descrp); Index: oprof_start_config.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/gui/oprof_start_config.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- oprof_start_config.h 2002/01/11 06:17:19 1.8 +++ oprof_start_config.h 2002/01/17 05:31:37 1.9 @@ -25,6 +25,7 @@ // FIXME: must be shared. #define OP_MAX_PERF_COUNT 2147483647UL +#define OP_MAX_RTC_COUNT 4096 #define OP_DEFAULT_BUFFER_SIZE 262144 #define OP_MAX_BUFFER_SIZE 1048576 |