operf_record Class Reference

#include <operf_counter.h>

Collaboration diagram for operf_record:
Collaboration graph
[legend]

Public Member Functions

 operf_record (int output_fd, bool sys_wide, pid_t the_pid, bool pid_running, std::vector< operf_event_t > &evts, OP_perf_utils::vmlinux_info_t vi, bool callgraph, bool separate_by_cpu, bool output_fd_is_file)
 ~operf_record ()
void recordPerfData (void)
int out_fd (void) const
void add_to_total (int n)
int get_total_bytes_recorded (void) const
void register_perf_event_id (unsigned counter, u64 id, perf_event_attr evt_attr)
bool get_valid (void)

Private Member Functions

void create (std::string outfile, std::vector< operf_event_t > &evts)
void setup (void)
int prepareToRecord (int cpu, int fd)
void write_op_header_info (void)
int _write_header_to_file (void)
int _write_header_to_pipe (void)

Private Attributes

int output_fd
bool write_to_file
struct pollfd * poll_data
std::vector< struct mmap_datasamples_array
int num_cpus
pid_t pid
bool pid_started
bool system_wide
bool callgraph
bool separate_cpu
std::vector< std::vector
< operf_counter > > 
perfCounters
int total_bytes_recorded
int poll_count
struct OP_header opHeader
std::vector< operf_event_tevts
bool valid
std::string vmlinux_file
u64 kernel_start
u64 kernel_end

Detailed Description

Definition at line 75 of file operf_counter.h.


Constructor & Destructor Documentation

operf_record::operf_record ( int  output_fd,
bool  sys_wide,
pid_t  the_pid,
bool  pid_running,
std::vector< operf_event_t > &  evts,
OP_perf_utils::vmlinux_info_t  vi,
bool  callgraph,
bool  separate_by_cpu,
bool  output_fd_is_file 
)
operf_record::~operf_record (  ) 

Member Function Documentation

int operf_record::_write_header_to_file ( void   )  [private]
int operf_record::_write_header_to_pipe ( void   )  [private]
void operf_record::add_to_total ( int  n  )  [inline]
void operf_record::create ( std::string  outfile,
std::vector< operf_event_t > &  evts 
) [private]
int operf_record::get_total_bytes_recorded ( void   )  const [inline]

Definition at line 88 of file operf_counter.h.

References total_bytes_recorded.

Referenced by start_profiling().

Here is the caller graph for this function:

bool operf_record::get_valid ( void   )  [inline]

Definition at line 90 of file operf_counter.h.

References valid.

Referenced by start_profiling().

Here is the caller graph for this function:

int operf_record::out_fd ( void   )  const [inline]

Definition at line 86 of file operf_counter.h.

Referenced by OP_perf_utils::op_get_kernel_event_data().

Here is the caller graph for this function:

int operf_record::prepareToRecord ( int  cpu,
int  fd 
) [private]

Definition at line 378 of file operf_counter.cpp.

References mmap_data::base, mmap_data::mask, num_mmap_pages, OP_PERF_HANDLED_ERROR, pagesize, poll_count, poll_data, mmap_data::prev, and samples_array.

Referenced by setup().

Here is the caller graph for this function:

void operf_record::recordPerfData ( void   ) 
void operf_record::register_perf_event_id ( unsigned  counter,
u64  id,
perf_event_attr  evt_attr 
)

Definition at line 359 of file operf_counter.cpp.

References op_header_evt_info::attr, cverb, OP_header::h_attrs, op_header_evt_info::ids, opHeader, and vrecord.

Referenced by operf_counter::perf_event_open().

Here is the caller graph for this function:

void operf_record::setup ( void   )  [private]
void operf_record::write_op_header_info ( void   )  [private]

Definition at line 370 of file operf_counter.cpp.

References _write_header_to_file(), _write_header_to_pipe(), add_to_total(), and write_to_file.

Referenced by setup(), and ~operf_record().

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

bool operf_record::callgraph [private]

Definition at line 107 of file operf_counter.h.

Referenced by setup().

std::vector<operf_event_t> operf_record::evts [private]

Definition at line 116 of file operf_counter.h.

Referenced by recordPerfData().

Definition at line 116 of file operf_counter.h.

Referenced by recordPerfData().

int operf_record::num_cpus [private]

Definition at line 103 of file operf_counter.h.

Referenced by recordPerfData(), and setup().

struct OP_header operf_record::opHeader [read, private]
int operf_record::output_fd [private]
std::vector< std::vector<operf_counter> > operf_record::perfCounters [private]

Definition at line 109 of file operf_counter.h.

Referenced by recordPerfData(), setup(), and ~operf_record().

pid_t operf_record::pid [private]

Definition at line 104 of file operf_counter.h.

Referenced by recordPerfData(), and setup().

bool operf_record::pid_started [private]

Definition at line 105 of file operf_counter.h.

Referenced by recordPerfData(), and setup().

int operf_record::poll_count [private]

Definition at line 111 of file operf_counter.h.

Referenced by prepareToRecord(), and recordPerfData().

struct pollfd* operf_record::poll_data [read, private]

Definition at line 101 of file operf_counter.h.

Referenced by prepareToRecord(), recordPerfData(), setup(), and ~operf_record().

std::vector<struct mmap_data> operf_record::samples_array [private]

Definition at line 102 of file operf_counter.h.

Referenced by prepareToRecord(), recordPerfData(), setup(), and ~operf_record().

Definition at line 108 of file operf_counter.h.

Referenced by setup().

bool operf_record::system_wide [private]

Definition at line 106 of file operf_counter.h.

Referenced by recordPerfData(), and setup().

Definition at line 110 of file operf_counter.h.

Referenced by add_to_total(), get_total_bytes_recorded(), and ~operf_record().

bool operf_record::valid [private]

Definition at line 114 of file operf_counter.h.

Referenced by get_valid(), and setup().

std::string operf_record::vmlinux_file [private]

Definition at line 115 of file operf_counter.h.

Referenced by recordPerfData().

Definition at line 100 of file operf_counter.h.

Referenced by write_op_header_info().


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

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1