opd_trans.c File Reference

#include "opd_trans.h"
#include "opd_kernel.h"
#include "opd_sfile.h"
#include "opd_anon.h"
#include "opd_stats.h"
#include "opd_printf.h"
#include "opd_interface.h"
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <errno.h>
Include dependency graph for opd_trans.c:

Go to the source code of this file.

Functions

void clear_trans_last (struct transient *trans)
void clear_trans_current (struct transient *trans)
uint64_t pop_buffer_value (struct transient *trans)
int enough_remaining (struct transient *trans, size_t size)
static void opd_put_sample (struct transient *trans, unsigned long long pc)
static void code_unknown (struct transient *trans __attribute__((unused)))
static void code_ctx_switch (struct transient *trans)
static void code_cpu_switch (struct transient *trans)
static void code_cookie_switch (struct transient *trans)
static void code_kernel_enter (struct transient *trans)
static void code_user_enter (struct transient *trans)
static void code_module_loaded (struct transient *trans __attribute__((unused)))
static void code_trace_begin (struct transient *trans)
static void code_xen_enter (struct transient *trans)
void code_spu_profiling (struct transient *trans)
void code_spu_ctx_switch (struct transient *trans)
void code_ibs_fetch_sample (struct transient *trans)
void code_ibs_op_sample (struct transient *trans)
void opd_process_samples (char const *buffer, size_t count)

Variables

size_t kernel_pointer_size
handler_t handlers [LAST_CODE+1]
void(* special_processor )(struct transient *)

Detailed Description

Processing the sample buffer

Remarks:
Copyright 2002 OProfile authors
Read the file COPYING
Author:
John Levon
Philippe Elie Modified by Aravind Menon for Xen These modifications are: Copyright (C) 2005 Hewlett-Packard Co.

Modified by Maynard Johnson <maynardj@us.ibm.com> These modifications are: (C) Copyright IBM Corporation 2007

Definition in file opd_trans.c.


Function Documentation

void clear_trans_current ( struct transient trans  ) 

used when we need to clear data that's been freed

Definition at line 44 of file opd_trans.c.

References operf_transient::current, and trans.

Referenced by clear_anon_maps(), code_cookie_switch(), code_cpu_switch(), code_ctx_switch(), code_kernel_enter(), code_module_loaded(), code_spu_ctx_switch(), code_user_enter(), do_lru(), opd_put_ibs_sample(), opd_put_sample(), and opd_put_spu_sample().

Here is the caller graph for this function:

void clear_trans_last ( struct transient trans  ) 

used when we need to clear data that's been freed

Definition at line 37 of file opd_trans.c.

References operf_transient::last, and trans.

Referenced by clear_anon_maps(), code_module_loaded(), code_user_enter(), and do_lru().

Here is the caller graph for this function:

static void code_cookie_switch ( struct transient trans  )  [static]

Definition at line 189 of file opd_trans.c.

References clear_trans_current(), enough_remaining(), pop_buffer_value(), trans, verbose_cookie(), verbprintf, and vmisc.

Here is the call graph for this function:

static void code_cpu_switch ( struct transient trans  )  [static]

Definition at line 175 of file opd_trans.c.

References clear_trans_current(), operf_transient::cpu, enough_remaining(), pop_buffer_value(), trans, verbprintf, and vmisc.

Here is the call graph for this function:

static void code_ctx_switch ( struct transient trans  )  [static]

Definition at line 148 of file opd_trans.c.

References clear_trans_current(), enough_remaining(), find_cookie(), pop_buffer_value(), operf_transient::tgid, operf_transient::tid, trans, and vmisc.

Here is the call graph for this function:

void code_ibs_fetch_sample ( struct transient trans  ) 

Handle an IBS fetch sample escape code sequence. An IBS fetch sample is represented as an escape code sequence. (See the comment for the function code_ibs_op_sample() for the sequence of entries in the event buffer.) When this function is called, the ESCAPE_CODE and IBS_FETCH_CODE have already been removed from the event buffer. Thus, 7 more event buffer entries are needed in order to process a complete IBS fetch sample.

Definition at line 193 of file opd_ibs.c.

References operf_transient::cpu, enough_remaining(), ibs_sample::fetch, ibs_fetch_sample::ibs_fetch_ctl_high, ibs_fetch_sample::ibs_fetch_ctl_low, ibs_fetch_incomplete_stats, ibs_fetch_sample::ibs_fetch_lin_addr_high, ibs_fetch_sample::ibs_fetch_lin_addr_low, ibs_fetch_sample::ibs_fetch_phys_addr_high, ibs_fetch_sample::ibs_fetch_phys_addr_low, ibs_fetch_sample_stats, opd_put_ibs_sample(), operf_transient::pc, pop_buffer_value(), ibs_fetch_sample::rip, operf_transient::tgid, trans, verbprintf, vext, and vsamples.

Here is the call graph for this function:

void code_ibs_op_sample ( struct transient trans  ) 

Handle an IBS op sample escape code sequence. An IBS op sample is represented as an escape code sequence:

IBS fetch IBS op --------------- ---------------- ESCAPE_CODE ESCAPE_CODE IBS_FETCH_CODE IBS_OP_CODE Offset Offset IbsFetchLinAd low IbsOpRip low <-- Logical (virtual) RIP IbsFetchLinAd high IbsOpRip high <-- Logical (virtual) RIP IbsFetchCtl low IbsOpData low IbsFetchCtl high IbsOpData high IbsFetchPhysAd low IbsOpData2 low IbsFetchPhysAd high IbsOpData2 high IbsOpData3 low IbsOpData3 high IbsDcLinAd low IbsDcLinAd high IbsDcPhysAd low IbsDcPhysAd high

When this function is called, the ESCAPE_CODE and IBS_OP_CODE have already been removed from the event buffer. Thus, 13 more event buffer entries are needed to process a complete IBS op sample.

The IbsFetchLinAd and IbsOpRip are the linear (virtual) addresses that were generated by the IBS hardware. These addresses are mapped into the offset.

Definition at line 267 of file opd_ibs.c.

References operf_transient::cpu, enough_remaining(), get_ibs_op_bta_sample(), ibs_op_sample::ibs_op_data1_high, ibs_op_sample::ibs_op_data1_low, ibs_op_sample::ibs_op_data2_high, ibs_op_sample::ibs_op_data2_low, ibs_op_sample::ibs_op_data3_high, ibs_op_sample::ibs_op_data3_low, ibs_op_incomplete_stats, ibs_op_sample::ibs_op_ldst_linaddr_high, ibs_op_sample::ibs_op_ldst_linaddr_low, ibs_op_sample::ibs_op_lin_addr_high, ibs_op_sample::ibs_op_lin_addr_low, ibs_op_sample::ibs_op_phys_addr_high, ibs_op_sample::ibs_op_phys_addr_low, ibs_op_sample_stats, ibs_sample::op, opd_put_ibs_sample(), operf_transient::pc, pop_buffer_value(), ibs_op_sample::rip, operf_transient::tgid, trans, verbprintf, vext, and vsamples.

Here is the call graph for this function:

static void code_kernel_enter ( struct transient trans  )  [static]

Definition at line 208 of file opd_trans.c.

References clear_trans_current(), operf_transient::in_kernel, trans, verbprintf, and vmisc.

Here is the call graph for this function:

static void code_module_loaded ( struct transient *trans   __attribute__(unused)  )  [static]

Definition at line 230 of file opd_trans.c.

References clear_trans_current(), clear_trans_last(), opd_reread_module_info(), trans, verbprintf, and vmodule.

Here is the call graph for this function:

void code_spu_ctx_switch ( struct transient trans  ) 

Definition at line 55 of file opd_spu.c.

References clear_trans_current(), operf_transient::cpu, enough_remaining(), find_cookie(), pop_buffer_value(), operf_transient::tgid, operf_transient::tid, trans, and vmisc.

Here is the call graph for this function:

void code_spu_profiling ( struct transient trans  ) 

Definition at line 44 of file opd_spu.c.

References pop_buffer_value(), process_spu_samples(), special_processor, and trans.

Here is the call graph for this function:

static void code_trace_begin ( struct transient trans  )  [static]

Definition at line 244 of file opd_trans.c.

References TRACING_START, trans, varcs, and verbprintf.

static void code_unknown ( struct transient *trans   __attribute__(unused)  )  [static]

Definition at line 141 of file opd_trans.c.

static void code_user_enter ( struct transient trans  )  [static]

Definition at line 221 of file opd_trans.c.

References clear_trans_current(), clear_trans_last(), operf_transient::in_kernel, trans, verbprintf, and vmisc.

Here is the call graph for this function:

static void code_xen_enter ( struct transient trans  )  [static]

Definition at line 250 of file opd_trans.c.

References operf_transient::current, operf_transient::in_kernel, trans, verbprintf, and vmisc.

int enough_remaining ( struct transient trans,
size_t  size 
)
void opd_process_samples ( char const *  buffer,
size_t  count 
)

Definition at line 296 of file opd_trans.c.

References transient::buffer, INVALID_COOKIE, is_escape_code(), LAST_CODE, OPD_DANGLING_CODE, opd_put_sample(), opd_stats, pop_buffer_value(), transient::remaining, special_processor, TRACING_OFF, UNUSED_EMBEDDED_OFFSET, verbprintf, and vmisc.

Referenced by opd_do_samples().

Here is the call graph for this function:

Here is the caller graph for this function:

static void opd_put_sample ( struct transient trans,
unsigned long long  pc 
) [static]
uint64_t pop_buffer_value ( struct transient trans  ) 

Variable Documentation

handler_t handlers[LAST_CODE+1]

Definition at line 45 of file init.c.

void(* special_processor)(struct transient *)

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1