lkml.org 
[lkml]   [2003]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 3/3] OProfile: add a useful statistic
From
Date

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.

diff -X dontdiff -Naur linux-cvs/drivers/oprofile/buffer_sync.c linux-fixes/drivers/oprofile/buffer_sync.c
--- linux-cvs/drivers/oprofile/buffer_sync.c 2003-06-18 15:06:09.000000000 +0100
+++ linux-fixes/drivers/oprofile/buffer_sync.c 2003-08-19 01:15:36.000000000 +0100
@@ -308,8 +308,10 @@

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 -X dontdiff -Naur linux-cvs/drivers/oprofile/oprofile_stats.c linux-fixes/drivers/oprofile/oprofile_stats.c
--- linux-cvs/drivers/oprofile/oprofile_stats.c 2003-05-04 02:42:47.000000000 +0100
+++ linux-fixes/drivers/oprofile/oprofile_stats.c 2003-08-19 01:17:17.000000000 +0100
@@ -32,6 +32,7 @@
}

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 @@

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 -X dontdiff -Naur linux-cvs/drivers/oprofile/oprofile_stats.h linux-fixes/drivers/oprofile/oprofile_stats.h
--- linux-cvs/drivers/oprofile/oprofile_stats.h 2003-05-04 02:42:47.000000000 +0100
+++ linux-fixes/drivers/oprofile/oprofile_stats.h 2003-08-19 01:16:23.000000000 +0100
@@ -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;
};

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.034 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site