Skip to content

Commit

Permalink
oprofile: simplify sync_buffer()
Browse files Browse the repository at this point in the history
Make code more readable. No functional changes.

Signed-off-by: Robert Richter <robert.richter@amd.com>
  • Loading branch information
Robert Richter committed Dec 29, 2008
1 parent 9741b30 commit 317f33b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions drivers/oprofile/buffer_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,12 +579,20 @@ void sync_buffer(int cpu)
add_user_ctx_switch(new, cookie);
break;
}
} else if (state >= sb_bt_start &&
!add_sample(mm, s, in_kernel)) {
if (state == sb_bt_start) {
state = sb_bt_ignore;
atomic_inc(&oprofile_stats.bt_lost_no_mapping);
}
continue;
}

if (state < sb_bt_start)
/* ignore sample */
continue;

if (add_sample(mm, s, in_kernel))
continue;

/* ignore backtraces if failed to add a sample */
if (state == sb_bt_start) {
state = sb_bt_ignore;
atomic_inc(&oprofile_stats.bt_lost_no_mapping);
}
}
release_mm(mm);
Expand Down

0 comments on commit 317f33b

Please sign in to comment.