]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
oprofile: simplify sync_buffer()
authorRobert Richter <robert.richter@amd.com>
Thu, 18 Dec 2008 18:44:20 +0000 (19:44 +0100)
committerRobert Richter <robert.richter@amd.com>
Mon, 29 Dec 2008 17:53:40 +0000 (18:53 +0100)
Make code more readable. No functional changes.

Signed-off-by: Robert Richter <robert.richter@amd.com>
drivers/oprofile/buffer_sync.c

index 0abe29e7e4c7dfad977ed665aa8286e46c74301c..22cdb5108360784ce6ef043ed097e9331ff92b32 100644 (file)
@@ -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);