Processing the sample buffer. More...
#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>
Functions | |
| void | clear_trans_last (struct transient *trans) |
| used when we need to clear data that's been freed | |
| void | clear_trans_current (struct transient *trans) |
| used when we need to clear data that's been freed | |
| uint64_t | pop_buffer_value (struct transient *trans) |
| int | enough_remaining (struct transient *trans, size_t size) |
| void | code_spu_profiling (struct transient *trans) |
| void | code_spu_ctx_switch (struct transient *trans) |
| 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_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 *) |
Processing the sample buffer.
Modified by Maynard Johnson <maynardj@us.ibm.com> These modifications are: (C) Copyright IBM Corporation 2007
| void clear_trans_current | ( | struct transient * | trans | ) |
used when we need to clear data that's been freed
Referenced by code_spu_ctx_switch().
| void clear_trans_last | ( | struct transient * | trans | ) |
used when we need to clear data that's been freed
| 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 code_spu_ctx_switch | ( | struct transient * | trans | ) |
References clear_trans_current(), enough_remaining(), find_cookie(), pop_buffer_value(), and vmisc.
| void code_spu_profiling | ( | struct transient * | trans | ) |
References pop_buffer_value(), and special_processor.
| int enough_remaining | ( | struct transient * | trans, | |
| size_t | size | |||
| ) |
References OPD_DANGLING_CODE, opd_stats, verbprintf, and vmisc.
Referenced by code_ibs_fetch_sample(), code_ibs_op_sample(), and code_spu_ctx_switch().
| void opd_process_samples | ( | char const * | buffer, | |
| size_t | count | |||
| ) |
| uint64_t pop_buffer_value | ( | struct transient * | trans | ) |
References kernel_pointer_size.
Referenced by code_ibs_fetch_sample(), code_ibs_op_sample(), code_spu_ctx_switch(), code_spu_profiling(), and opd_process_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,
}
Referenced by 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(), and opd_ext_sfile_sync().
| size_t kernel_pointer_size |
| void(* special_processor)(struct transient *) |
Referenced by code_spu_profiling(), and opd_process_samples().
1.6.1