void ca_css_check_interval_and_add(struct pt_regs * const regs) { struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer); if (!cpu_buf) return; if (!ca_css_depth) return; /* NOTE: [Suravee] * Make sure the task has not been switched to prevent paging. */ if (cpu_buf->last_task != current) return; oprofile_begin_trace(cpu_buf); if (cpu_buf->ca_css_interval++ > ca_css_interval) { if ( (ca_css_tgid && cpu_buf->last_task->tgid == ca_css_tgid) || (ca_css_tgid && cpu_buf->last_task->parent && cpu_buf->last_task->parent->pid == ca_css_tgid) ) { oprofile_ops.ca_css(regs, ca_css_depth, cpu_buf->last_task); cpu_buf->ca_css_interval = 0; } } oprofile_end_trace(cpu_buf); }
void ca_css_add_ext_sample(unsigned long pc, struct pt_regs * const regs, unsigned long event, int is_kernel) { struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()]; if (!ca_css_depth) { log_sample(cpu_buf, pc, is_kernel, event); return; } if (!oprofile_begin_trace(cpu_buf)) return; if (log_sample(cpu_buf, pc, is_kernel, event)) { if (cpu_buf->ca_css_interval++ > ca_css_interval) { if ( (ca_css_tgid && cpu_buf->last_task->tgid == ca_css_tgid) || (ca_css_ppid && cpu_buf->last_task->parent && cpu_buf->last_task->parent->pid == ca_css_ppid) ) { oprofile_ops.ca_css(regs, ca_css_depth, cpu_buf->last_task); cpu_buf->ca_css_interval = 0; } } } oprofile_end_trace(cpu_buf); }
static inline void __oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, unsigned long event, int is_kernel) { struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer); unsigned long backtrace = oprofile_backtrace_depth; if (!log_sample(cpu_buf, pc, backtrace, is_kernel, event)) return; if (!backtrace) return; oprofile_begin_trace(cpu_buf); oprofile_ops.backtrace(regs, backtrace); oprofile_end_trace(cpu_buf); }
void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, unsigned long event, int is_kernel) { struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer); if (!backtrace_depth) { log_sample(cpu_buf, pc, is_kernel, event); return; } if (!oprofile_begin_trace(cpu_buf)) return; /* if log_sample() fail we can't backtrace since we lost the source * of this event */ if (log_sample(cpu_buf, pc, is_kernel, event)) oprofile_ops.backtrace(regs, backtrace_depth); oprofile_end_trace(cpu_buf); }
void oprofile_add_sample(struct pt_regs * const regs, unsigned long event) { struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()]; unsigned long pc = profile_pc(regs); int is_kernel = !user_mode(regs); if (!backtrace_depth) { log_sample(cpu_buf, pc, is_kernel, event); return; } if (!oprofile_begin_trace(cpu_buf)) return; /* if log_sample() fail we can't backtrace since we lost the source * of this event */ if (log_sample(cpu_buf, pc, is_kernel, event)) oprofile_ops.backtrace(regs, backtrace_depth); oprofile_end_trace(cpu_buf); }
static inline void __oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, unsigned long event, int is_kernel) { struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); unsigned long backtrace = oprofile_backtrace_depth; /* * if log_sample() fail we can't backtrace since we lost the * source of this event */ if (!log_sample(cpu_buf, pc, backtrace, is_kernel, event)) /* failed */ return; if (!backtrace) return; oprofile_begin_trace(cpu_buf); oprofile_ops.backtrace(regs, backtrace); oprofile_end_trace(cpu_buf); }