Commit 86fcce36 authored by John Levon's avatar John Levon Committed by Linus Torvalds

[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.
parent 46480a97
...@@ -308,8 +308,10 @@ static void add_us_sample(struct mm_struct * mm, struct op_sample * s) ...@@ -308,8 +308,10 @@ static void add_us_sample(struct mm_struct * mm, struct op_sample * s)
cookie = lookup_dcookie(mm, s->eip, &offset); cookie = lookup_dcookie(mm, s->eip, &offset);
if (!cookie) if (!cookie) {
atomic_inc(&oprofile_stats.sample_lost_no_mapping);
return; return;
}
if (cookie != last_cookie) { if (cookie != last_cookie) {
add_cookie_switch(cookie); add_cookie_switch(cookie);
......
...@@ -32,6 +32,7 @@ void oprofile_reset_stats(void) ...@@ -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_mm, 0);
atomic_set(&oprofile_stats.sample_lost_no_mapping, 0);
atomic_set(&oprofile_stats.event_lost_overflow, 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) ...@@ -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", oprofilefs_create_ro_atomic(sb, dir, "sample_lost_no_mm",
&oprofile_stats.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", oprofilefs_create_ro_atomic(sb, dir, "event_lost_overflow",
&oprofile_stats.event_lost_overflow); &oprofile_stats.event_lost_overflow);
} }
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
struct oprofile_stat_struct { struct oprofile_stat_struct {
atomic_t sample_lost_no_mm; atomic_t sample_lost_no_mm;
atomic_t sample_lost_no_mapping;
atomic_t event_lost_overflow; atomic_t event_lost_overflow;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment