void oprofile_add_ibs_op_sample(struct pt_regs *const regs,
				unsigned int * const ibs_op)
{
	int is_kernel = !user_mode(regs);
	unsigned long pc = profile_pc(regs);

	struct oprofile_cpu_buffer *cpu_buf = &cpu_buffer[smp_processor_id()];

#ifdef CONFIG_CA_CSS
	if (!ca_css_depth) {
		log_ibs_sample(cpu_buf, pc, is_kernel, ibs_op, IBS_OP_BEGIN);
		return;
	}

	/* if log_sample() fails we can't backtrace since we lost the source
	* of this event */
	if (log_ibs_sample(cpu_buf, pc, is_kernel, ibs_op, IBS_OP_BEGIN))
		oprofile_ops.ca_css(regs, ca_css_depth, cpu_buf->last_task);
#else
	if (!backtrace_depth) {
		log_ibs_sample(cpu_buf, pc, is_kernel, ibs_op, IBS_OP_BEGIN);
		return;
	}

	/* if log_sample() fails we can't backtrace since we lost the source
	* of this event */
	if (log_ibs_sample(cpu_buf, pc, is_kernel, ibs_op, IBS_OP_BEGIN))
		oprofile_ops.backtrace(regs, backtrace_depth);
#endif
}
Пример #2
0
void oprofile_add_ibs_sample(struct pt_regs *const regs,
				unsigned int * const ibs_sample, u8 code)
{
	int is_kernel = !user_mode(regs);
	unsigned long pc = profile_pc(regs);

	struct oprofile_cpu_buffer *cpu_buf =
			 &per_cpu(cpu_buffer, smp_processor_id());

	if (!backtrace_depth) {
		log_ibs_sample(cpu_buf, pc, is_kernel, ibs_sample, code);
		return;
	}

	/* if log_sample() fails we can't backtrace since we lost the source
	* of this event */
	if (log_ibs_sample(cpu_buf, pc, is_kernel, ibs_sample, code))
		oprofile_ops.backtrace(regs, backtrace_depth);
}