opd_ibs.c File Reference

AMD Family10h Instruction Based Sampling (IBS) handling. More...

#include "op_hw_config.h"
#include "op_events.h"
#include "op_string.h"
#include "op_hw_specific.h"
#include "op_libiberty.h"
#include "opd_printf.h"
#include "opd_trans.h"
#include "opd_events.h"
#include "opd_kernel.h"
#include "opd_anon.h"
#include "opd_sfile.h"
#include "opd_interface.h"
#include "opd_mangling.h"
#include "opd_extended.h"
#include "opd_ibs.h"
#include "opd_ibs_trans.h"
#include "opd_ibs_macro.h"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <limits.h>
Include dependency graph for opd_ibs.c:

Functions

int sfile_equal (struct sfile const *sf, struct sfile const *sf2)
void sfile_dup (struct sfile *to, struct sfile *from)
void code_ibs_fetch_sample (struct transient *trans)
 Handle an IBS fetch sample escape code sequence.
void code_ibs_op_sample (struct transient *trans)
 Handle an IBS op sample escape code sequence.
void opd_log_ibs_event (unsigned int event, struct transient *trans)
 Log the specified IBS derived event.
void opd_log_ibs_count (unsigned int event, struct transient *trans, unsigned int count)
 Log the specified IBS cycle count.

Variables

op_cpu cpu_type
int no_event_ok
char * session_dir
struct opd_event ibs_vc [OP_MAX_IBS_COUNTERS]
unsigned int ibs_vci_map [OP_MAX_IBS_COUNTERS]
unsigned int ibs_family
unsigned int ibs_model
unsigned int ibs_stepping
FILE * memaccess_log
FILE * bta_log
struct opd_ext_sfile_handlers ibs_sfile_handlers
struct opd_ext_handlers ibs_handlers

Detailed Description

AMD Family10h Instruction Based Sampling (IBS) handling.

Remarks:
Copyright 2007-2010 OProfile authors
Read the file COPYING
Author:
Jason Yeh <jason.yeh@amd.com>
Paul Drongowski <paul.drongowski@amd.com>
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Copyright (c) 2008 Advanced Micro Devices, Inc.

Function Documentation

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.

References enough_remaining(), ibs_sample::fetch, ibs_fetch_sample::ibs_fetch_ctl_high, ibs_fetch_sample::ibs_fetch_ctl_low, 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, pop_buffer_value(), ibs_fetch_sample::rip, verbprintf, vext, and vsamples.

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.

References enough_remaining(), 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_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_sample::op, pop_buffer_value(), ibs_op_sample::rip, verbprintf, vext, and vsamples.

void opd_log_ibs_count ( unsigned int  event,
struct transient trans,
unsigned int  count 
)

Log the specified IBS cycle count.

References sfile_log_sample_count().

void opd_log_ibs_event ( unsigned int  event,
struct transient trans 
)

Log the specified IBS derived event.

References sfile_log_sample_count().

void sfile_dup ( struct sfile to,
struct sfile from 
)
int sfile_equal ( struct sfile const *  sf,
struct sfile const *  sf2 
)

Variable Documentation

FILE* bta_log

Referenced by trans_ibs_op_bta().

unsigned int ibs_family
Initial value:
{
        .ext_init        = &ibs_init,
        .ext_deinit      = &ibs_deinit,
        .ext_print_stats = &ibs_print_stats,
        .ext_sfile       = &ibs_sfile_handlers
}
unsigned int ibs_model
Initial value:
{
        .create = &ibs_sfile_create,
        .dup    = &ibs_sfile_dup,
        .close  = &ibs_sfile_close,
        .sync   = &ibs_sfile_sync,
        .get    = &ibs_sfile_get,
        .find_counter_event = &ibs_sfile_find_counter_event
}
unsigned int ibs_stepping
struct opd_event ibs_vc[OP_MAX_IBS_COUNTERS]
unsigned int ibs_vci_map[OP_MAX_IBS_COUNTERS]
char* session_dir

Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1