Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123476
b: refs/heads/master
c: fd7826d
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter committed Dec 10, 2008
1 parent c51aa49 commit c2be6f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe615cbf34fc6a1c53c359417da4696328a488ed
refs/heads/master: fd7826d56bde11ab142d2431093773ad2b3f0a59
22 changes: 14 additions & 8 deletions trunk/drivers/oprofile/buffer_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ void sync_buffer(int cpu)
{
struct oprofile_cpu_buffer *cpu_buf = &per_cpu(cpu_buffer, cpu);
struct mm_struct *mm = NULL;
struct mm_struct *oldmm;
struct task_struct *new;
unsigned long cookie = 0;
int in_kernel = 1;
Expand All @@ -586,34 +587,39 @@ void sync_buffer(int cpu)
struct op_sample *s = &cpu_buf->buffer[cpu_buf->tail_pos];

if (is_code(s->eip)) {
if (s->event <= CPU_IS_KERNEL) {
switch (s->event) {
case 0:
case CPU_IS_KERNEL:
/* kernel/userspace switch */
in_kernel = s->event;
if (state == sb_buffer_start)
state = sb_sample_start;
add_kernel_ctx_switch(s->event);
} else if (s->event == CPU_TRACE_BEGIN) {
break;
case CPU_TRACE_BEGIN:
state = sb_bt_start;
add_trace_begin();
break;
#ifdef CONFIG_OPROFILE_IBS
} else if (s->event == IBS_FETCH_BEGIN) {
case IBS_FETCH_BEGIN:
state = sb_bt_start;
add_ibs_begin(cpu_buf, IBS_FETCH_CODE, mm);
} else if (s->event == IBS_OP_BEGIN) {
break;
case IBS_OP_BEGIN:
state = sb_bt_start;
add_ibs_begin(cpu_buf, IBS_OP_CODE, mm);
break;
#endif
} else {
struct mm_struct *oldmm = mm;

default:
/* userspace context switch */
oldmm = mm;
new = (struct task_struct *)s->event;

release_mm(oldmm);
mm = take_tasks_mm(new);
if (mm != oldmm)
cookie = get_exec_dcookie(mm);
add_user_ctx_switch(new, cookie);
break;
}
} else if (state >= sb_bt_start &&
!add_sample(mm, s, in_kernel)) {
Expand Down

0 comments on commit c2be6f3

Please sign in to comment.