summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhunt <hunt>2006-01-19 19:26:32 +0000
committerhunt <hunt>2006-01-19 19:26:32 +0000
commit46746514a6943520ff73b6f77d35477e2abb30ba (patch)
tree870674338b7b7b82b87b515886a5d77099390b61
parenta7978f80f7621ffba04999b7c1360afa242b01dd (diff)
downloadsystemtap-steved-46746514a6943520ff73b6f77d35477e2abb30ba.tar.gz
systemtap-steved-46746514a6943520ff73b6f77d35477e2abb30ba.tar.xz
systemtap-steved-46746514a6943520ff73b6f77d35477e2abb30ba.zip
2006-01-19 Martin Hunt <hunt@redhat.com>
* pmap-gen.c (_stp_pmap_get): Fix bug where old data from agg map could be returned after element was deleted.
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/pmap-gen.c13
-rwxr-xr-xruntime/probes/bench/run_bench8
3 files changed, 15 insertions, 11 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index 099949bf..bb04363c 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-19 Martin Hunt <hunt@redhat.com>
+
+ * pmap-gen.c (_stp_pmap_get): Fix bug where old data
+ from agg map could be returned after element was deleted.
+
2006-01-16 Josh Stone <joshua.i.stone@intel.com>
* stat.c (_stp_stat_clear): add a function that just
diff --git a/runtime/pmap-gen.c b/runtime/pmap-gen.c
index 035fccbf..21a0aef4 100644
--- a/runtime/pmap-gen.c
+++ b/runtime/pmap-gen.c
@@ -617,7 +617,7 @@ VALTYPE KEYSYM(_stp_pmap_get_cpu) (PMAP pmap, ALLKEYSD(key))
VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key))
{
unsigned int hv;
- int cpu;
+ int cpu, clear_agg = 0;
struct hlist_head *head, *ahead;
struct hlist_node *e;
struct KEYSYM(pmap_node) *n;
@@ -649,7 +649,7 @@ VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key))
#endif
) {
anode = (struct map_node *)n;
- _new_map_clear_node (anode);
+ clear_agg = 1;
break;
}
}
@@ -681,13 +681,18 @@ VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key))
if (anode == NULL) {
dbug("agg=%lx ahead=%lx\n", (long)agg, (long)ahead);
anode = _stp_new_agg(agg, ahead, (struct map_node *)n);
- } else
+ } else {
+ if (clear_agg) {
+ _new_map_clear_node (anode);
+ clear_agg = 0;
+ }
_stp_add_agg(anode, (struct map_node *)n);
+ }
}
}
spin_unlock(&map->lock);
}
- if (anode)
+ if (anode && !clear_agg)
return MAP_GET_VAL(anode);
/* key not found */
diff --git a/runtime/probes/bench/run_bench b/runtime/probes/bench/run_bench
index 8bbc2dd4..18319013 100755
--- a/runtime/probes/bench/run_bench
+++ b/runtime/probes/bench/run_bench
@@ -5,7 +5,7 @@ proc do_time {module n} {
global Failures
# start kprobes
- if {[catch {exec ../../stpd/stpd -mq $module.ko > xxx &} pid]} {
+ if {[catch {exec ../../stpd/stpd -rmq $module.ko > xxx &} pid]} {
puts $pid
exit -1
}
@@ -72,12 +72,6 @@ set mem [split [exec cat /proc/meminfo] \n]
puts "[lindex $mem 0] [lindex $mem 1]"
puts "--------------------------------------"
-# load the modules
-if {[catch {exec stp_check} res]} {
- puts $res
- exit -1
-}
-
# get the timings without kprobes
if {[catch {exec ./ttest 4} res1]} {
puts $res1