oprof_start Class Reference

#include <oprof_start.h>

Inheritance diagram for oprof_start:
Inheritance graph
[legend]
Collaboration diagram for oprof_start:
Collaboration graph
[legend]

Public Member Functions

 oprof_start ()

Data Fields

QTabWidget * setup_config_tab
QWidget * counter_setup_page
QGroupBox * counter_group
QListView * events_list
QCheckBox * os_ring_count_cb
QCheckBox * user_ring_count_cb
QLabel * TextLabel1_2
QLineEdit * event_count_edit
QButtonGroup * unit_mask_group
QCheckBox * check0
QCheckBox * check1
QCheckBox * check2
QCheckBox * check3
QCheckBox * check4
QCheckBox * check5
QCheckBox * check6
QCheckBox * check7
QCheckBox * check11
QCheckBox * check13
QCheckBox * check15
QCheckBox * check10
QCheckBox * check14
QCheckBox * check9
QCheckBox * check8
QCheckBox * check12
QLabel * event_help_label
QWidget * configuration_page
QLabel * TextLabel1
QLineEdit * kernel_filename_edit
QToolButton * kernel_filename_tb
QCheckBox * no_vmlinux
QLineEdit * buffer_size_edit
QLineEdit * note_table_size_edit
QLabel * cpu_buffer_size_label
QLineEdit * cpu_buffer_size_edit
QLabel * buffer_size_label
QLabel * note_table_size_label
QLineEdit * buffer_watershed_edit
QLabel * buffer_watershed_label
QCheckBox * verbose
QCheckBox * separate_lib_cb
QCheckBox * separate_kernel_cb
QCheckBox * separate_cpu_cb
QCheckBox * separate_thread_cb
QLabel * callgraph_depth_label
QLineEdit * callgraph_depth_edit
QLabel * daemon_label
QPushButton * start_profiler_btn
QPushButton * flush_profiler_data_btn
QPushButton * stop_profiler_btn
QPushButton * reset_sample_files_btn
QPushButton * quit_and_save_btn

Protected Slots

void choose_kernel_filename ()
 select the kernel image filename
void on_flush_profiler_data ()
 flush profiler
void on_start_profiler ()
 start profiler
void on_stop_profiler ()
 stop profiler
void event_selected ()
 events selection change
void event_over (Q3ListViewItem *)
 the mouse is over an event
void on_separate_kernel_cb_changed (int)
 state of separate_kernel_cb changed
void on_reset_sample_files ()
 reset sample files
void accept ()
 close the dialog
void closeEvent (QCloseEvent *e)
 WM hide event.
void timerEvent (QTimerEvent *e)
 timer event
virtual void languageChange ()
virtual void event_over (QListViewItem *)

Protected Attributes

QVBoxLayout * oprof_start_baseLayout
QVBoxLayout * counter_setup_pageLayout
QVBoxLayout * counter_groupLayout
QHBoxLayout * Layout10
QVBoxLayout * Layout9
QHBoxLayout * Layout16
QSpacerItem * Spacer13_2
QGridLayout * unit_mask_groupLayout
QSpacerItem * Spacer14
QVBoxLayout * configuration_pageLayout
QSpacerItem * Spacer9
QHBoxLayout * Layout11
QHBoxLayout * Layout12
QSpacerItem * Spacer11
QGridLayout * Layout11_2
QGridLayout * Layout36
QSpacerItem * Spacer12
QVBoxLayout * Layout34
QHBoxLayout * Layout33
QHBoxLayout * Layout37
QSpacerItem * Spacer5

Private Types

typedef std::map< std::string,
event_setting
event_setting_map
 current event configs for each counter

Private Member Functions

void fill_events_listbox ()
 the counter combo has been activated
void fill_events ()
 fill the event details and gui setup
op_event_descr const & locate_event (std::string const &name) const
 find an event description by name
void record_selected_event_config ()
 update config on user change
bool record_config ()
 update config and validate
void get_unit_mask_part (op_event_descr const &descr, uint num, bool selected, uint &mask)
 calculate unit mask for given event and unit mask part
uint get_unit_mask (op_event_descr const &descr)
 calculate unit mask for given event
void setup_unit_masks (op_event_descr const &descr)
 set the unit mask widgets for given event
uint max_perf_count () const
 return the maximum perf counter value for the current cpu type
void display_event (op_event_descr const &descrp)
 show an event's settings
void hide_masks (void)
 hide unit mask widgets
void read_set_events ()
 read the events set in daemonrc
void setup_default_event ()
 use the default event
void load_config_file ()
 load the extra config file
bool save_config ()
 save the config
void draw_event_list ()
 redraw the event list by changing icon status
bool is_selectable_event (Q3ListViewItem *item)
 return true if item is selectable or already selected
bool alloc_selected_events () const
 try to alloc counters for the selected_events

Private Attributes

QIntValidator * event_count_validator
 validator for event count
std::vector< op_event_descrv_events
 all available events for this hardware
event_setting_map event_cfgs
std::set< Q3ListViewItem * > selected_events
Q3ListViewItem * current_event
config_setting config
 current config
std::string user_dir
 the expansion of "~" directory
op_cpu cpu_type
 CPU type.
double cpu_speed
 CPU speed in MHz.
uint op_nr_counters
 total number of available HW counters
unsigned long total_nr_interrupts
 Total number of samples for this run.

Detailed Description

Definition at line 52 of file oprof_start.h.


Member Typedef Documentation

typedef std::map<std::string, event_setting> oprof_start::event_setting_map [private]

current event configs for each counter

Definition at line 142 of file oprof_start.h.


Constructor & Destructor Documentation

oprof_start::oprof_start (  ) 

Definition at line 123 of file oprof_start.cpp.

References config_setting::buffer_size, oprof_start_base::buffer_size_edit, config_setting::buffer_watershed, oprof_start_base::buffer_watershed_edit, oprof_start_base::buffer_watershed_label, config_setting::callgraph_depth, oprof_start_base::callgraph_depth_edit, oprof_start_base::callgraph_depth_label, config, oprof_start_base::counter_setup_page, config_setting::cpu_buffer_size, oprof_start_base::cpu_buffer_size_edit, oprof_start_base::cpu_buffer_size_label, CPU_TIMER_INT, do_exec_command(), oprof_start_base::event_count_edit, event_count_validator, event_selected(), fill_events(), green_pixmap, green_xpm, hide_masks(), config_setting::kernel_filename, oprof_start_base::kernel_filename_edit, config_setting::no_kernel, oprof_start_base::no_vmlinux, config_setting::note_table_size, oprof_start_base::note_table_size_edit, oprof_start_base::note_table_size_label, OP_BINDIR, op_file_readable(), op_get_cpu_type(), op_get_interface(), op_get_nr_counters(), OP_INTERFACE_26, OP_INTERFACE_NO_GOOD, OP_MAX_BUF_SIZE, OP_MAX_CPU_BUF_SIZE, OP_MAX_NOTE_TABLE_SIZE, OP_MIN_BUF_SIZE, OP_MIN_NOTE_TABLE_SIZE, op_nr_counters, red_pixmap, red_xpm, config_setting::separate_cpu, oprof_start_base::separate_cpu_cb, config_setting::separate_kernel, oprof_start_base::separate_kernel_cb, config_setting::separate_lib, oprof_start_base::separate_lib_cb, config_setting::separate_thread, oprof_start_base::separate_thread_cb, oprof_start_base::setup_config_tab, timerEvent(), and config_setting::verbose.

Here is the call graph for this function:


Member Function Documentation

void oprof_start::accept (  )  [protected, slot]

close the dialog

Definition at line 401 of file oprof_start.cpp.

References record_selected_event_config(), and save_config().

Referenced by closeEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

bool oprof_start::alloc_selected_events (  )  const [private]

try to alloc counters for the selected_events

Definition at line 515 of file oprof_start.cpp.

References events, find_event_by_name(), map_event_to_counter(), and selected_events.

Referenced by event_selected(), and is_selectable_event().

Here is the call graph for this function:

Here is the caller graph for this function:

void oprof_start::choose_kernel_filename (  )  [protected, virtual, slot]

select the kernel image filename

Reimplemented from oprof_start_base.

Definition at line 603 of file oprof_start.cpp.

References do_open_file_or_dir(), and oprof_start_base::kernel_filename_edit.

Here is the call graph for this function:

void oprof_start::closeEvent ( QCloseEvent *  e  )  [protected, slot]

WM hide event.

Definition at line 412 of file oprof_start.cpp.

References accept().

Here is the call graph for this function:

void oprof_start::display_event ( op_event_descr const &  descrp  )  [private]
void oprof_start::draw_event_list (  )  [private]

redraw the event list by changing icon status

Definition at line 503 of file oprof_start.cpp.

References oprof_start_base::events_list, green_pixmap, is_selectable_event(), Q3ListViewItem, and red_pixmap.

Referenced by event_selected().

Here is the call graph for this function:

Here is the caller graph for this function:

void oprof_start_base::event_over ( QListViewItem *   )  [protected, virtual, slot, inherited]

Definition at line 436 of file oprof_start.base.cpp.

Referenced by oprof_start_base::oprof_start_base().

Here is the caller graph for this function:

void oprof_start::event_over ( Q3ListViewItem *  item  )  [protected, slot]

the mouse is over an event

Definition at line 577 of file oprof_start.cpp.

References oprof_start_base::event_help_label, op_event_descr::help_str, is_selectable_event(), locate_event(), Q3ListViewItem, and selected_events.

Here is the call graph for this function:

void oprof_start::event_selected (  )  [protected, virtual, slot]

events selection change

Reimplemented from oprof_start_base.

Definition at line 533 of file oprof_start.cpp.

References alloc_selected_events(), current_event, display_event(), draw_event_list(), oprof_start_base::events_list, locate_event(), Q3ListViewItem, and selected_events.

Referenced by oprof_start().

Here is the call graph for this function:

Here is the caller graph for this function:

void oprof_start::fill_events (  )  [private]
void oprof_start::fill_events_listbox (  )  [private]

the counter combo has been activated

Definition at line 449 of file oprof_start.cpp.

References oprof_start_base::events_list, Q3ListViewItem, and v_events.

Referenced by fill_events().

Here is the caller graph for this function:

uint oprof_start::get_unit_mask ( op_event_descr const &  descr  )  [private]
void oprof_start::get_unit_mask_part ( op_event_descr const &  descr,
uint  num,
bool  selected,
uint &  mask 
) [private]

calculate unit mask for given event and unit mask part

Definition at line 721 of file oprof_start.cpp.

References op_unit_mask::num, op_unit_mask::um, op_event_descr::unit, op_unit_mask::unit_type_mask, utm_bitmask, and op_unit_mask::op_described_um::value.

Referenced by get_unit_mask().

Here is the caller graph for this function:

void oprof_start::hide_masks ( void   )  [private]
bool oprof_start::is_selectable_event ( Q3ListViewItem *  item  )  [private]

return true if item is selectable or already selected

Definition at line 486 of file oprof_start.cpp.

References alloc_selected_events(), and selected_events.

Referenced by draw_event_list(), and event_over().

Here is the call graph for this function:

Here is the caller graph for this function:

void oprof_start_base::languageChange (  )  [protected, virtual, slot, inherited]

Definition at line 368 of file oprof_start.base.cpp.

References oprof_start_base::buffer_size_edit, oprof_start_base::buffer_size_label, oprof_start_base::buffer_watershed_label, oprof_start_base::callgraph_depth_label, oprof_start_base::check0, oprof_start_base::check1, oprof_start_base::check10, oprof_start_base::check11, oprof_start_base::check12, oprof_start_base::check13, oprof_start_base::check14, oprof_start_base::check15, oprof_start_base::check2, oprof_start_base::check3, oprof_start_base::check4, oprof_start_base::check5, oprof_start_base::check6, oprof_start_base::check7, oprof_start_base::check8, oprof_start_base::check9, oprof_start_base::configuration_page, oprof_start_base::counter_group, oprof_start_base::counter_setup_page, oprof_start_base::cpu_buffer_size_label, oprof_start_base::daemon_label, oprof_start_base::event_count_edit, oprof_start_base::event_help_label, oprof_start_base::events_list, oprof_start_base::flush_profiler_data_btn, oprof_start_base::kernel_filename_edit, oprof_start_base::kernel_filename_tb, oprof_start_base::no_vmlinux, oprof_start_base::note_table_size_label, oprof_start_base::os_ring_count_cb, oprof_start_base::quit_and_save_btn, oprof_start_base::reset_sample_files_btn, oprof_start_base::separate_cpu_cb, oprof_start_base::separate_kernel_cb, oprof_start_base::separate_lib_cb, oprof_start_base::separate_thread_cb, oprof_start_base::setup_config_tab, oprof_start_base::start_profiler_btn, oprof_start_base::stop_profiler_btn, oprof_start_base::TextLabel1, oprof_start_base::TextLabel1_2, oprof_start_base::unit_mask_group, and oprof_start_base::user_ring_count_cb.

Referenced by oprof_start_base::oprof_start_base().

Here is the caller graph for this function:

void oprof_start::load_config_file (  )  [private]

load the extra config file

Definition at line 379 of file oprof_start.cpp.

References check_and_create_config_dir(), config, and get_config_filename().

Referenced by fill_events().

Here is the call graph for this function:

Here is the caller graph for this function:

op_event_descr const& oprof_start::locate_event ( std::string const &  name  )  const [private]

find an event description by name

Referenced by event_over(), event_selected(), on_start_profiler(), record_selected_event_config(), and save_config().

Here is the caller graph for this function:

uint oprof_start::max_perf_count (  )  const [private]

return the maximum perf counter value for the current cpu type

Definition at line 837 of file oprof_start.cpp.

References CPU_RTC, OP_MAX_PERF_COUNT, and OP_MAX_RTC_COUNT.

Referenced by display_event(), and on_start_profiler().

Here is the caller graph for this function:

void oprof_start::on_flush_profiler_data (  )  [protected, virtual, slot]

flush profiler

Reimplemented from oprof_start_base.

Definition at line 843 of file oprof_start.cpp.

References do_exec_command(), and OP_BINDIR.

Here is the call graph for this function:

void oprof_start::on_reset_sample_files (  )  [protected, virtual, slot]

reset sample files

Reimplemented from oprof_start_base.

Definition at line 1055 of file oprof_start.cpp.

References oprof_start_base::daemon_label, do_exec_command(), and OP_BINDIR.

Here is the call graph for this function:

void oprof_start::on_separate_kernel_cb_changed ( int  state  )  [protected, virtual, slot]

state of separate_kernel_cb changed

Reimplemented from oprof_start_base.

Definition at line 1049 of file oprof_start.cpp.

References oprof_start_base::separate_lib_cb.

void oprof_start::on_start_profiler (  )  [protected, virtual, slot]
void oprof_start::on_stop_profiler (  )  [protected, virtual, slot]

stop profiler

Reimplemented from oprof_start_base.

Definition at line 1035 of file oprof_start.cpp.

References do_exec_command(), OP_BINDIR, and timerEvent().

Referenced by on_start_profiler().

Here is the call graph for this function:

Here is the caller graph for this function:

void oprof_start::read_set_events (  )  [private]

read the events set in daemonrc

Definition at line 317 of file oprof_start.cpp.

References event_cfgs, oprof_start_base::events_list, get_config_filename(), is_prefix(), op_lexical_cast(), Q3ListViewItem, separate_token(), setup_default_event(), and split().

Referenced by fill_events().

Here is the call graph for this function:

Here is the caller graph for this function:

bool oprof_start::record_config (  )  [private]
void oprof_start::record_selected_event_config (  )  [private]

update config on user change

Definition at line 615 of file oprof_start.cpp.

References current_event, event_cfgs, oprof_start_base::event_count_edit, get_unit_mask(), locate_event(), op_default_event_descr::name, oprof_start_base::os_ring_count_cb, and oprof_start_base::user_ring_count_cb.

Referenced by accept(), and on_start_profiler().

Here is the call graph for this function:

Here is the caller graph for this function:

bool oprof_start::save_config (  )  [private]
void oprof_start::setup_default_event (  )  [private]

use the default event

Definition at line 301 of file oprof_start.cpp.

References op_default_event_descr::count, event_cfgs, oprof_start_base::events_list, op_default_event_descr::name, op_default_event(), Q3ListViewItem, and op_default_event_descr::um.

Referenced by read_set_events().

Here is the call graph for this function:

Here is the caller graph for this function:

void oprof_start::setup_unit_masks ( op_event_descr const &  descr  )  [private]
void oprof_start::timerEvent ( QTimerEvent *  e  )  [protected, slot]

Field Documentation

QLineEdit* oprof_start_base::buffer_size_edit [inherited]
QCheckBox* oprof_start_base::check0 [inherited]
QCheckBox* oprof_start_base::check1 [inherited]
QCheckBox* oprof_start_base::check10 [inherited]
QCheckBox* oprof_start_base::check11 [inherited]
QCheckBox* oprof_start_base::check12 [inherited]
QCheckBox* oprof_start_base::check13 [inherited]
QCheckBox* oprof_start_base::check14 [inherited]
QCheckBox* oprof_start_base::check15 [inherited]
QCheckBox* oprof_start_base::check2 [inherited]
QCheckBox* oprof_start_base::check3 [inherited]
QCheckBox* oprof_start_base::check4 [inherited]
QCheckBox* oprof_start_base::check5 [inherited]
QCheckBox* oprof_start_base::check6 [inherited]
QCheckBox* oprof_start_base::check7 [inherited]
QCheckBox* oprof_start_base::check8 [inherited]
QCheckBox* oprof_start_base::check9 [inherited]

current config

Definition at line 152 of file oprof_start.h.

Referenced by load_config_file(), on_start_profiler(), oprof_start(), record_config(), and save_config().

QVBoxLayout* oprof_start_base::configuration_pageLayout [protected, inherited]

Definition at line 102 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QGroupBox* oprof_start_base::counter_group [inherited]
QVBoxLayout* oprof_start_base::counter_groupLayout [protected, inherited]

Definition at line 95 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QVBoxLayout* oprof_start_base::counter_setup_pageLayout [protected, inherited]

Definition at line 94 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

double oprof_start::cpu_speed [private]

CPU speed in MHz.

Definition at line 161 of file oprof_start.h.

Referenced by fill_events().

CPU type.

Definition at line 158 of file oprof_start.h.

Q3ListViewItem* oprof_start::current_event [private]

Definition at line 149 of file oprof_start.h.

Referenced by event_selected(), and record_selected_event_config().

QLabel* oprof_start_base::daemon_label [inherited]
QLineEdit* oprof_start_base::event_count_edit [inherited]
QIntValidator* oprof_start::event_count_validator [private]

validator for event count

Definition at line 136 of file oprof_start.h.

Referenced by display_event(), and oprof_start().

QListView* oprof_start_base::events_list [inherited]
QToolButton* oprof_start_base::kernel_filename_tb [inherited]
QHBoxLayout* oprof_start_base::Layout10 [protected, inherited]

Definition at line 96 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QHBoxLayout* oprof_start_base::Layout11 [protected, inherited]

Definition at line 104 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QGridLayout* oprof_start_base::Layout11_2 [protected, inherited]

Definition at line 107 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QHBoxLayout* oprof_start_base::Layout12 [protected, inherited]

Definition at line 105 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QHBoxLayout* oprof_start_base::Layout16 [protected, inherited]

Definition at line 98 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QHBoxLayout* oprof_start_base::Layout33 [protected, inherited]

Definition at line 111 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QVBoxLayout* oprof_start_base::Layout34 [protected, inherited]

Definition at line 110 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QGridLayout* oprof_start_base::Layout36 [protected, inherited]

Definition at line 108 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QHBoxLayout* oprof_start_base::Layout37 [protected, inherited]

Definition at line 112 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QVBoxLayout* oprof_start_base::Layout9 [protected, inherited]

Definition at line 97 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QCheckBox* oprof_start_base::no_vmlinux [inherited]

total number of available HW counters

Definition at line 164 of file oprof_start.h.

Referenced by fill_events(), and oprof_start().

QVBoxLayout* oprof_start_base::oprof_start_baseLayout [protected, inherited]

Definition at line 93 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QCheckBox* oprof_start_base::os_ring_count_cb [inherited]
QPushButton* oprof_start_base::quit_and_save_btn [inherited]
QPushButton* oprof_start_base::reset_sample_files_btn [inherited]
std::set<Q3ListViewItem *> oprof_start::selected_events [private]

The currently selected events. We must track this because with multiple selection listbox QT doesn't allow to know what is the last selected item. events_selected() update it

Definition at line 148 of file oprof_start.h.

Referenced by alloc_selected_events(), event_over(), event_selected(), and is_selectable_event().

QCheckBox* oprof_start_base::separate_cpu_cb [inherited]
QCheckBox* oprof_start_base::separate_kernel_cb [inherited]
QCheckBox* oprof_start_base::separate_lib_cb [inherited]
QCheckBox* oprof_start_base::separate_thread_cb [inherited]
QTabWidget* oprof_start_base::setup_config_tab [inherited]
QSpacerItem* oprof_start_base::Spacer11 [protected, inherited]

Definition at line 106 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QSpacerItem* oprof_start_base::Spacer12 [protected, inherited]

Definition at line 109 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QSpacerItem* oprof_start_base::Spacer13_2 [protected, inherited]

Definition at line 99 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QSpacerItem* oprof_start_base::Spacer14 [protected, inherited]

Definition at line 101 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QSpacerItem* oprof_start_base::Spacer5 [protected, inherited]

Definition at line 113 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QSpacerItem* oprof_start_base::Spacer9 [protected, inherited]

Definition at line 103 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

QPushButton* oprof_start_base::start_profiler_btn [inherited]
QPushButton* oprof_start_base::stop_profiler_btn [inherited]
QLabel* oprof_start_base::TextLabel1 [inherited]
QLabel* oprof_start_base::TextLabel1_2 [inherited]
unsigned long oprof_start::total_nr_interrupts [private]

Total number of samples for this run.

Definition at line 167 of file oprof_start.h.

Referenced by on_start_profiler(), and timerEvent().

QButtonGroup* oprof_start_base::unit_mask_group [inherited]
QGridLayout* oprof_start_base::unit_mask_groupLayout [protected, inherited]

Definition at line 100 of file oprof_start.base.h.

Referenced by oprof_start_base::oprof_start_base().

std::string oprof_start::user_dir [private]

the expansion of "~" directory

Definition at line 155 of file oprof_start.h.

QCheckBox* oprof_start_base::user_ring_count_cb [inherited]
std::vector<op_event_descr> oprof_start::v_events [private]

all available events for this hardware

Definition at line 139 of file oprof_start.h.

Referenced by fill_events(), and fill_events_listbox().

QCheckBox* oprof_start_base::verbose [inherited]

Definition at line 78 of file oprof_start.base.h.


The documentation for this class was generated from the following files:

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1