00001 00012 #ifndef OPROF_START_H 00013 #define OPROF_START_H 00014 00015 #include <vector> 00016 #include <map> 00017 #include <set> 00018 00019 #include "config.h" 00020 00021 #include "ui/oprof_start.base.h" 00022 #include "oprof_start_config.h" 00023 00024 #include "op_events.h" 00025 00026 #ifndef QT3_SUPPORT 00027 #define Q3ListViewItem QListViewItem 00028 #endif 00029 00030 class QIntValidator; 00031 class QListViewItem; 00032 class QTimerEvent; 00033 00035 struct op_event_descr { 00036 op_event_descr(); 00037 00039 uint counter_mask; 00041 u32 val; 00043 op_unit_mask const * unit; 00045 std::string name; 00047 std::string help_str; 00049 uint min_count; 00050 }; 00051 00052 class oprof_start : public oprof_start_base 00053 { 00054 Q_OBJECT 00055 00056 public: 00057 oprof_start(); 00058 00059 protected slots: 00061 void choose_kernel_filename(); 00063 void on_flush_profiler_data(); 00065 void on_start_profiler(); 00067 void on_stop_profiler(); 00069 void event_selected(); 00071 void event_over(Q3ListViewItem *); 00073 void on_separate_kernel_cb_changed(int); 00075 void on_reset_sample_files(); 00076 00078 void accept(); 00079 00081 void closeEvent(QCloseEvent * e); 00082 00084 void timerEvent(QTimerEvent * e); 00085 00086 private: 00088 void fill_events_listbox(); 00089 00091 void fill_events(); 00092 00094 op_event_descr const & locate_event(std::string const & name) const; 00095 00097 void record_selected_event_config(); 00099 bool record_config(); 00100 00102 void get_unit_mask_part(op_event_descr const & descr, uint num, bool selected, uint & mask); 00104 uint get_unit_mask(op_event_descr const & descr); 00106 void setup_unit_masks(op_event_descr const & descr); 00107 00109 uint max_perf_count() const; 00110 00112 void display_event(op_event_descr const & descrp); 00113 00115 void hide_masks(void); 00116 00118 void read_set_events(); 00120 void setup_default_event(); 00122 void load_config_file(); 00124 bool save_config(); 00125 00127 void draw_event_list(); 00128 00130 bool is_selectable_event(Q3ListViewItem * item); 00131 00133 bool alloc_selected_events() const; 00134 00136 QIntValidator* event_count_validator; 00137 00139 std::vector<op_event_descr> v_events; 00140 00142 typedef std::map<std::string, event_setting> event_setting_map; 00143 event_setting_map event_cfgs; 00144 00148 std::set<Q3ListViewItem *> selected_events; 00149 Q3ListViewItem * current_event; 00150 00152 config_setting config; 00153 00155 std::string user_dir; 00156 00158 op_cpu cpu_type; 00159 00161 double cpu_speed; 00162 00164 uint op_nr_counters; 00165 00167 unsigned long total_nr_interrupts; 00168 }; 00169 00170 #endif // OPROF_START_H