operf_utils.cpp File Reference

#include <errno.h>
#include <dirent.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include <cverb.h>
#include <iostream>
#include "operf_counter.h"
#include "operf_utils.h"
#include "op_types.h"
#include "operf_process_info.h"
#include "file_manip.h"
#include "operf_kernel.h"
#include "operf_sfile.h"
#include "op_fileio.h"
#include "op_libiberty.h"
#include "operf_stats.h"
Include dependency graph for operf_utils.cpp:

Go to the source code of this file.

Defines

#define OFFLINE   0x30

Functions

static void update_trans_last (struct operf_transient *trans)
static void clear_trans (struct operf_transient *trans)
static void __handle_fork_event (event_t *event)
static void __handle_comm_event (event_t *event)
static void __handle_mmap_event (event_t *event)
static struct operf_transient__get_operf_trans (struct sample_data *data, bool hypervisor_domain, bool kernel_mode)
static void __handle_callchain (u64 *array, struct sample_data *data)
static void __map_hypervisor_sample (u64 ip, u32 pid)
static void __handle_sample_event (event_t *event, u64 sample_type)
static int __mmap_trace_file (struct mmap_info &info)
static void op_record_process_exec_mmaps (pid_t pid, pid_t tgid, int output_fd, operf_record *pr)
static int _record_one_process_info (pid_t pid, bool sys_wide, operf_record *pr, int output_fd)
static void _record_module_info (int output_fd, operf_record *pr)

Variables

verbose vmisc
 all others not fitting in above category, not voluminous.
volatile bool quit
volatile bool read_quit
operf_read operfRead
int sample_reads
unsigned int pagesize
char * app_name
pid_t app_PID
verbose vrecord
verbose vconvert
map< pid_t, operf_process_info * > process_map
multimap< string, struct
operf_mmap * > 
all_images_map
map< u64, struct operf_mmap * > kernel_modules
struct operf_mmapkernel_mmap
bool first_time_processing
bool throttled
size_t mmap_size
size_t pg_sz
static list< event_t * > unresolved_events
static struct operf_transient trans
static bool sfile_init_done

Detailed Description

Helper methods for perf_events-based OProfile.

Remarks:
Copyright 2011 OProfile authors
Read the file COPYING

Created on: Dec 7, 2011

Author:
Maynard Johnson (C) Copyright IBM Corp. 2011

Modified by Maynard Johnson <maynardj@us.ibm.com> (C) Copyright IBM Corporation 2012

Definition in file operf_utils.cpp.


Define Documentation

#define OFFLINE   0x30

Function Documentation

static struct operf_transient* __get_operf_trans ( struct sample_data data,
bool  hypervisor_domain,
bool  kernel_mode 
) [static, read]
static void __handle_callchain ( u64 array,
struct sample_data data 
) [static]
static void __handle_comm_event ( event_t event  )  [static]

Definition at line 296 of file operf_utils.cpp.

References app_name, app_PID, comm_event::comm, event_union::comm, cverb, operf_process_info::pid, comm_event::pid, and process_map.

Referenced by __handle_mmap_event(), and OP_perf_utils::op_write_event().

Here is the caller graph for this function:

static void __handle_fork_event ( event_t event  )  [static]
static void __handle_mmap_event ( event_t event  )  [static]
static void __handle_sample_event ( event_t event,
u64  sample_type 
) [static]
static void __map_hypervisor_sample ( u64  ip,
u32  pid 
) [static]

Definition at line 637 of file operf_utils.cpp.

References app_name, app_PID, cverb, operf_process_info::process_hypervisor_mapping(), and process_map.

Referenced by __handle_sample_event().

Here is the call graph for this function:

Here is the caller graph for this function:

static int __mmap_trace_file ( struct mmap_info info  )  [static]

Definition at line 970 of file operf_utils.cpp.

References mmap_info::buf, cverb, mmap_info::head, mmap_size, mmap_info::offset, and mmap_info::traceFD.

Referenced by OP_perf_utils::op_mmap_trace_file().

Here is the caller graph for this function:

static void _record_module_info ( int  output_fd,
operf_record pr 
) [static]
static int _record_one_process_info ( pid_t  pid,
bool  sys_wide,
operf_record pr,
int  output_fd 
) [static]

Definition at line 1095 of file operf_utils.cpp.

References operf_record::add_to_total(), align_64bit(), comm_event::comm, cverb, comm_event::header, op_record_process_exec_mmaps(), OP_perf_utils::op_write_output(), comm_event::pid, and comm_event::tid.

Referenced by OP_perf_utils::op_record_process_info().

Here is the call graph for this function:

Here is the caller graph for this function:

static void clear_trans ( struct operf_transient trans  )  [inline, static]

Definition at line 225 of file operf_utils.cpp.

References operf_transient::cur_procinfo, and operf_transient::tgid.

Referenced by __handle_sample_event().

Here is the caller graph for this function:

static void op_record_process_exec_mmaps ( pid_t  pid,
pid_t  tgid,
int  output_fd,
operf_record pr 
) [static]
static void update_trans_last ( struct operf_transient trans  )  [inline, static]

Definition at line 219 of file operf_utils.cpp.

References operf_transient::current, operf_transient::last, operf_transient::last_pc, and operf_transient::pc.

Referenced by __handle_callchain(), and __handle_sample_event().

Here is the caller graph for this function:


Variable Documentation

multimap<string, struct operf_mmap *> all_images_map

Definition at line 54 of file operf_utils.cpp.

Referenced by __handle_mmap_event(), and OP_perf_utils::op_release_resources().

char* app_name
pid_t app_PID

Definition at line 56 of file operf_utils.cpp.

map<u64, struct operf_mmap *> kernel_modules

Definition at line 55 of file operf_utils.cpp.

Referenced by __get_operf_trans(), and __handle_mmap_event().

size_t mmap_size

Definition at line 59 of file operf_utils.cpp.

Referenced by __mmap_trace_file(), and OP_perf_utils::op_mmap_trace_file().

Definition at line 64 of file operf.cpp.

unsigned int pagesize
size_t pg_sz

Definition at line 60 of file operf_utils.cpp.

Referenced by OP_perf_utils::op_mmap_trace_file().

volatile bool quit
volatile bool read_quit

Definition at line 40 of file operf_counter.cpp.

Referenced by OP_perf_utils::op_perfread_sigusr1_handler().

bool sfile_init_done [static]

Definition at line 64 of file operf_utils.cpp.

Referenced by OP_perf_utils::op_write_event().

bool throttled
struct operf_transient trans [static]
list<event_t *> unresolved_events [static]

all others not fitting in above category, not voluminous.

Definition at line 61 of file oprofiled.c.


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1