#include <operf_counter.h>
Public Member Functions | |
operf_read (void) | |
void | init (int sample_data_pipe_fd, std::string input_filename, std::string samples_dir, op_cpu cputype, std::vector< operf_event_t > &evts, bool systemwide) |
~operf_read () | |
int | readPerfHeader (void) |
int | convertPerfData (void) |
bool | is_valid (void) |
int | get_eventnum_by_perf_event_id (u64 id) const |
const operf_event_t * | get_event_by_counter (u32 counter) |
Private Member Functions | |
int | _get_one_perf_event (event_t *) |
int | _read_header_info_with_ifstream (void) |
int | _read_perf_header_from_file (void) |
int | _read_perf_header_from_pipe (void) |
Private Attributes | |
int | sample_data_fd |
std::string | inputFname |
std::string | sampledir |
std::ifstream | istrm |
struct OP_header | opHeader |
std::vector< operf_event_t > | evts |
bool | valid |
bool | syswide |
op_cpu | cpu_type |
Definition at line 119 of file operf_counter.h.
operf_read::operf_read | ( | void | ) | [inline] |
Definition at line 121 of file operf_counter.h.
operf_read::~operf_read | ( | ) |
Definition at line 617 of file operf_counter.cpp.
References evts.
int operf_read::_get_one_perf_event | ( | event_t * | ) | [private] |
int operf_read::_read_header_info_with_ifstream | ( | void | ) | [private] |
Definition at line 623 of file operf_counter.cpp.
References op_header_evt_info::attr, OP_header::attr_offset, cverb, OP_header::data_offset, OP_header::data_size, OP_header::h_attrs, op_header_evt_info::ids, inputFname, istrm, OP_PERF_HANDLED_ERROR, OP_perf_utils::op_read_from_stream(), opHeader, and vconvert.
Referenced by _read_perf_header_from_file().
int operf_read::_read_perf_header_from_file | ( | void | ) | [private] |
Definition at line 686 of file operf_counter.cpp.
References _read_header_info_with_ifstream(), cverb, OP_header::data_size, inputFname, istrm, OP_PERF_HANDLED_ERROR, opHeader, valid, and vconvert.
Referenced by readPerfHeader().
int operf_read::_read_perf_header_from_pipe | ( | void | ) | [private] |
Definition at line 716 of file operf_counter.cpp.
References op_file_attr::attr, op_header_evt_info::attr, OP_file_header::attr_size, OP_file_header::attrs, cverb, OP_header::h_attrs, op_header_evt_info::ids, op_file_attr::ids, OP_file_header::magic, OP_PERF_HANDLED_ERROR, opHeader, sample_data_fd, op_file_section::size, valid, and vconvert.
Referenced by readPerfHeader().
int operf_read::convertPerfData | ( | void | ) |
Definition at line 800 of file operf_counter.cpp.
References op_header_evt_info::attr, cverb, OP_header::data_offset, OP_header::data_size, mmap_info::file_data_offset, mmap_info::file_data_size, first_time_processing, OP_header::h_attrs, inputFname, OP_perf_utils::op_mmap_trace_file(), OP_perf_utils::op_release_resources(), OP_perf_utils::op_reprocess_unresolved_events(), op_write_abi_to_file(), OP_perf_utils::op_write_event(), OPERF_MAX_STATS, operf_print_stats(), operf_stats, opHeader, sample_data_fd, operf_options::session_dir, start_time_human_readable, syswide, throttled, mmap_info::traceFD, and vdebug.
Referenced by convert_sample_data().
const operf_event_t* operf_read::get_event_by_counter | ( | u32 | counter | ) | [inline] |
Definition at line 129 of file operf_counter.h.
References evts.
Referenced by __handle_sample_event(), fill_header(), and mangle_filename().
int operf_read::get_eventnum_by_perf_event_id | ( | u64 | id | ) | const |
Definition at line 788 of file operf_counter.cpp.
References evts, OP_header::h_attrs, op_header_evt_info::ids, and opHeader.
Referenced by __handle_sample_event().
void operf_read::init | ( | int | sample_data_pipe_fd, | |
std::string | input_filename, | |||
std::string | samples_dir, | |||
op_cpu | cputype, | |||
std::vector< operf_event_t > & | evts, | |||
bool | systemwide | |||
) |
bool operf_read::is_valid | ( | void | ) | [inline] |
Definition at line 127 of file operf_counter.h.
References valid.
Referenced by convert_sample_data().
int operf_read::readPerfHeader | ( | void | ) |
Definition at line 780 of file operf_counter.cpp.
References _read_perf_header_from_file(), _read_perf_header_from_pipe(), and inputFname.
Referenced by convert_sample_data().
op_cpu operf_read::cpu_type [private] |
Definition at line 140 of file operf_counter.h.
std::vector<operf_event_t> operf_read::evts [private] |
Definition at line 137 of file operf_counter.h.
Referenced by get_event_by_counter(), get_eventnum_by_perf_event_id(), and ~operf_read().
std::string operf_read::inputFname [private] |
Definition at line 133 of file operf_counter.h.
Referenced by _read_header_info_with_ifstream(), _read_perf_header_from_file(), convertPerfData(), and readPerfHeader().
std::ifstream operf_read::istrm [private] |
Definition at line 135 of file operf_counter.h.
Referenced by _read_header_info_with_ifstream(), and _read_perf_header_from_file().
struct OP_header operf_read::opHeader [read, private] |
Definition at line 136 of file operf_counter.h.
Referenced by _read_header_info_with_ifstream(), _read_perf_header_from_file(), _read_perf_header_from_pipe(), convertPerfData(), and get_eventnum_by_perf_event_id().
int operf_read::sample_data_fd [private] |
Definition at line 132 of file operf_counter.h.
Referenced by _read_perf_header_from_pipe(), and convertPerfData().
std::string operf_read::sampledir [private] |
Definition at line 134 of file operf_counter.h.
bool operf_read::syswide [private] |
Definition at line 139 of file operf_counter.h.
Referenced by convertPerfData(), and operf_read().
bool operf_read::valid [private] |
Definition at line 138 of file operf_counter.h.
Referenced by _read_perf_header_from_file(), _read_perf_header_from_pipe(), is_valid(), and operf_read().