summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2008-12-18 19:44:20 +0100
committerRobert Richter <robert.richter@amd.com>2008-12-29 18:53:40 +0100
commit317f33bce6d43367a2fd170bc87ba18a88d2621d (patch)
treebed4d035c7702ba200f09234673e5485854b6f23
parent9741b309bb4493eedd3cdb5c97b566338a0da2cc (diff)
downloadop-kernel-dev-317f33bce6d43367a2fd170bc87ba18a88d2621d.zip
op-kernel-dev-317f33bce6d43367a2fd170bc87ba18a88d2621d.tar.gz
oprofile: simplify sync_buffer()
Make code more readable. No functional changes. Signed-off-by: Robert Richter <robert.richter@amd.com>
-rw-r--r--drivers/oprofile/buffer_sync.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 0abe29e..22cdb51 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -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);
OpenPOWER on IntegriCloud