]> git.hungrycats.org Git - linux/commitdiff
[PATCH] OProfile: add a useful statistic
authorJohn Levon <levon@movementarian.org>
Thu, 21 Aug 2003 09:57:19 +0000 (02:57 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 21 Aug 2003 09:57:19 +0000 (02:57 -0700)
Add a stat counting the (relatively common) case where a PC value is logged
but there is no (longer) any executable mapping covering that address.

drivers/oprofile/buffer_sync.c
drivers/oprofile/oprofile_stats.c
drivers/oprofile/oprofile_stats.h

index ad105b88141070109828cb86f4b46ee0d960698a..2dac57b618a3bda3387468b583df4512b584792b 100644 (file)
@@ -308,8 +308,10 @@ static void add_us_sample(struct mm_struct * mm, struct op_sample * s)
  
        cookie = lookup_dcookie(mm, s->eip, &offset);
  
-       if (!cookie)
+       if (!cookie) {
+               atomic_inc(&oprofile_stats.sample_lost_no_mapping);
                return;
+       }
 
        if (cookie != last_cookie) {
                add_cookie_switch(cookie);
index 5624c1e017e028799d1a94d413a1c4290160e2a8..f01e1935072c6c126656baf53af198f23749936c 100644 (file)
@@ -32,6 +32,7 @@ void oprofile_reset_stats(void)
        }
  
        atomic_set(&oprofile_stats.sample_lost_no_mm, 0);
+       atomic_set(&oprofile_stats.sample_lost_no_mapping, 0);
        atomic_set(&oprofile_stats.event_lost_overflow, 0);
 }
 
@@ -70,6 +71,8 @@ void oprofile_create_stats_files(struct super_block * sb, struct dentry * root)
  
        oprofilefs_create_ro_atomic(sb, dir, "sample_lost_no_mm",
                &oprofile_stats.sample_lost_no_mm);
+       oprofilefs_create_ro_atomic(sb, dir, "sample_lost_no_mapping",
+               &oprofile_stats.sample_lost_no_mapping);
        oprofilefs_create_ro_atomic(sb, dir, "event_lost_overflow",
                &oprofile_stats.event_lost_overflow);
 }
index e3f67d5c0910936ae823ad16a8a9f777ed9b5461..9f4d4d2046db71d8923475a5351c9183bae48245 100644 (file)
@@ -14,6 +14,7 @@
  
 struct oprofile_stat_struct {
        atomic_t sample_lost_no_mm;
+       atomic_t sample_lost_no_mapping;
        atomic_t event_lost_overflow;
 };