Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <levon@movementarian.org>2003-08-21 02:57:19 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-08-21 02:57:19 -0700
commit86fcce36faf43c7c92e9fc7a45db25e61d3c52f2 (patch)
tree001c61ca0da1013ce99d855a148334e25b323439
parent46480a97d81e57150b8218ceeaae2c8ee5f4e9e7 (diff)
[PATCH] OProfile: add a useful statistic
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.
-rw-r--r--drivers/oprofile/buffer_sync.c4
-rw-r--r--drivers/oprofile/oprofile_stats.c3
-rw-r--r--drivers/oprofile/oprofile_stats.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index ad105b881410..2dac57b618a3 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -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);
diff --git a/drivers/oprofile/oprofile_stats.c b/drivers/oprofile/oprofile_stats.c
index 5624c1e017e0..f01e1935072c 100644
--- a/drivers/oprofile/oprofile_stats.c
+++ b/drivers/oprofile/oprofile_stats.c
@@ -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);
}
diff --git a/drivers/oprofile/oprofile_stats.h b/drivers/oprofile/oprofile_stats.h
index e3f67d5c0910..9f4d4d2046db 100644
--- a/drivers/oprofile/oprofile_stats.h
+++ b/drivers/oprofile/oprofile_stats.h
@@ -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;
};