#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>
Go to the source code of this file.
Processing the sample buffer
Modified by Maynard Johnson <maynardj@us.ibm.com> These modifications are: (C) Copyright IBM Corporation 2007
Definition in file opd_trans.c.
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().
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().
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.
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.
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.
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.
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.
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.
Definition at line 230 of file opd_trans.c.
References clear_trans_current(), clear_trans_last(), opd_reread_module_info(), trans, verbprintf, and vmodule.
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.
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.
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.
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.
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 | |||
) |
Definition at line 74 of file opd_trans.c.
References OPD_DANGLING_CODE, opd_stats, trans, verbprintf, and vmisc.
Referenced by code_cookie_switch(), code_cpu_switch(), code_ctx_switch(), code_ibs_fetch_sample(), code_ibs_op_sample(), code_spu_ctx_switch(), get_ibs_op_bta_sample(), opd_put_ibs_sample(), and opd_put_sample().
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().
static void opd_put_sample | ( | struct transient * | trans, | |
unsigned long long | pc | |||
) | [static] |
Definition at line 85 of file opd_trans.c.
References clear_trans_current(), operf_transient::current, enough_remaining(), operf_transient::event, find_anon_mapping(), operf_sfile::ignored, operf_transient::in_kernel, operf_transient::last, NO_COOKIE, OPD_KERNEL, OPD_PROCESS, OPD_SAMPLES, opd_stats, operf_transient::pc, pop_buffer_value(), sfile_find(), sfile_log_sample(), TRACING_ON, TRACING_START, trans, and update_trans_last().
uint64_t pop_buffer_value | ( | struct transient * | trans | ) |
Definition at line 51 of file opd_trans.c.
References kernel_pointer_size, and trans.
Referenced by code_cookie_switch(), code_cpu_switch(), code_ctx_switch(), code_ibs_fetch_sample(), code_ibs_op_sample(), code_spu_ctx_switch(), code_spu_profiling(), get_ibs_op_bta_sample(), opd_process_samples(), opd_put_sample(), and process_spu_samples().
{ &code_unknown, &code_ctx_switch, &code_cpu_switch, &code_cookie_switch, &code_kernel_enter, &code_user_enter, &code_module_loaded, &code_unknown, &code_trace_begin, &code_unknown, &code_xen_enter, &code_unknown, &code_unknown, &code_ibs_fetch_sample, &code_ibs_op_sample, }
Definition at line 270 of file opd_trans.c.
Referenced by is_ext_enabled(), is_ext_sfile_enabled(), opd_ext_find_counter_event(), opd_ext_print_stats(), opd_ext_sfile_close(), opd_ext_sfile_create(), opd_ext_sfile_dup(), opd_ext_sfile_get(), opd_ext_sfile_sync(), and process_spu_samples().
size_t kernel_pointer_size |
void(* special_processor)(struct transient *) |
Referenced by code_spu_profiling(), and opd_process_samples().