+void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event)
+{
+ struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
+ log_sample(cpu_buf, pc, is_kernel, event);
+}
+
+
+void oprofile_add_trace(unsigned long pc)
+{
+ struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
+
+ if (!cpu_buf->tracing)
+ return;
+
+ if (nr_available_slots(cpu_buf) < 1) {
+ cpu_buf->tracing = 0;
+ cpu_buf->sample_lost_overflow++;
+ return;
+ }
+
+ /* broken frame can give an eip with the same value as an escape code,
+ * abort the trace if we get it */
+ if (pc == ESCAPE_CODE) {
+ cpu_buf->tracing = 0;
+ cpu_buf->backtrace_aborted++;
+ return;
+ }
+
+ add_sample(cpu_buf, pc, 0);
+}
+
+
+