summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--README38
-rw-r--r--elaborate.cxx3
-rw-r--r--runtime/ChangeLog10
-rw-r--r--runtime/addr-map.c100
-rw-r--r--tapsets.cxx6
-rw-r--r--testsuite/ChangeLog5
-rwxr-xr-xtestsuite/semok/thirtythree.stp2
-rw-r--r--testsuite/systemtap.base/optim_arridx.exp2
9 files changed, 118 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index d62f154f..434a2e9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-09-30 Mark Wielaard <mjw@redhat.com>
+
+ * tapsets.cxx (literal_stmt_for_local): Check if alternatives can be
+ provided after calling dwarf_formref_die.
+ (literal_stmt_for_return): Likewise.
+
+2008-09-26 Frank Ch. Eigler <fche@elastic.org>
+
+ * elaborate.cxx (add_global_var_display): Implicitly sort arrays.
+
2008-09-26 Frank Ch. Eigler <fche@elastic.org>
PR 6916
diff --git a/README b/README
index 6b62c772..b7434256 100644
--- a/README
+++ b/README
@@ -10,10 +10,10 @@ See the INSTALL file for generic build instructions.
Prerequisites:
- linux kernel with kprobes (mainline 2.6.11+ or backport)
-- kernel module build environment (kernel-devel or kernel-smp-devel rpm)
+- kernel module build environment (kernel-devel rpm)
- kernel debugging information (kernel-debuginfo rpm)
- C compiler (same as what kernel was compiled with)
-- elfutils with libdwfl for debugging informatin parsing
+- elfutils with libdwfl for debugging information parsing
- root privileges
Installation steps:
@@ -23,12 +23,12 @@ Installation steps:
Build steps:
-- Install the kernel-debuginfo, kernel-[smp-]devel, gcc and libcap-devel
+- Install the kernel-debuginfo, kernel-devel, gcc and dependent
packages (or see below if you are building your own kernels from source).
- If available, install your distribution's copy of elfutils and its
- development headers/libraries.
-- Or if desired, download an elfutils source release to build in
+- If available, install your distribution's copy of elfutils and its
+ development headers/libraries.
+ Or if desired, download an elfutils source release to build in
"bundled mode" (below), and untar it into some new directory.
Or if desired, build elfutils separately one time, and install
it to /usr/local.
@@ -45,15 +45,39 @@ Build steps:
% .../configure [other autoconf options]
Or, with build it with a bundled internal copy of elfutils:
% .../configure --with-elfutils=ELFUTILS-SOURCE-DIR [other autoconf options]
+
Consider configuring with "--enable-dejazilla" to automatically
contribute to our public test result database.
+ Consider configuring with "--prefix=DIRECTORY" to specify an
+ installation directory other than /usr/local. It can be an ordinary
+ personal directory.
+
% make all
% sudo make install
- To run the full test suite:
+ To uninstall systemtap:
+ % sudo make uninstall
+
+- Run systemtap:
+
+ To run systemtap after installation, add $prefix/bin to your $PATH, or
+ refer to $prefix/bin/stap directly. If you keep your build tree
+ around, you can also use the "stap" binary there.
+
+ Some samples should be available under $prefix/share/doc/systemtap/examples.
+
+ Normally, run "stap" as root. If desired, create "stapdev" and
+ "stapusr" entries in /etc/groups. Any users in "stapdev" will be
+ able to run systemtap as if with root privileges. Users in "stapusr"
+ can only launch (with "staprun") pre-compiled probe modules (created
+ by "stap -p4 ...") that a system administrator copied under
+ /lib/modules/`uname -r`/systemtap.
+
+ To run the full test suite from the build tree.
% sudo make installcheck
+
Tips:
- By default, systemtap looks for the debug info in these locations:
diff --git a/elaborate.cxx b/elaborate.cxx
index 94bfd1c5..afdc796e 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -1234,7 +1234,8 @@ void add_global_var_display (systemtap_session& s)
vardecl* idx_v[idx_count];
// Create a foreach loop
foreach_loop* fe = new foreach_loop;
- fe->sort_direction = 0;
+ fe->sort_direction = -1; // imply decreasing sort on value
+ fe->sort_column = 0; // as in foreach ([a,b,c] in array-) { }
fe->limit = NULL;
// Create indices for the foreach loop
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index 6672dbb5..e22bee26 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,13 @@
+2008-10-02 Tim Moore <timoore@redhat.com>
+
+ * addr-map.c (add_bad_addr_entry): Fix bugs in allocating a new
+ table and copying old entries into the new table.
+
+2008-09-30 Tim Moore <timoore@redhat.com>
+
+ * addr-map.c (add_bad_addr_entry): Rewrite allocation of address
+ table to simplify locking and eliminate a race condition.
+
2008-09-26 David Smith <dsmith@redhat.com>
* task_finder.c (__STP_ATTACHED_TASK_EVENTS): Removed UTRACE_STOP,
diff --git a/runtime/addr-map.c b/runtime/addr-map.c
index 8231b57f..706da454 100644
--- a/runtime/addr-map.c
+++ b/runtime/addr-map.c
@@ -113,64 +113,72 @@ add_bad_addr_entry(unsigned long min_addr, unsigned long max_addr,
struct addr_map_entry* max_entry = 0;
struct addr_map_entry* new_entry = 0;
size_t existing = 0;
-
+
+ /* Loop allocating memory for a new entry in the map. */
while (1)
{
- size_t old_size;
+ size_t old_size = 0;
spin_lock(&addr_map_lock);
old_map = blackmap;
- if (!blackmap)
- {
- existing = 0;
- old_size = 0;
- }
- else
+ if (old_map)
+ old_size = old_map->size;
+ /* Either this is the first time through the loop, or we
+ allocated a map previous time, but someone has come in and
+ added an entry while we were sleeping. */
+ if (!new_map || (new_map && new_map->size < old_size + 1))
{
- min_entry = lookup_addr_aux(min_addr, blackmap);
- max_entry = lookup_addr_aux(max_addr, blackmap);
- if (min_entry || max_entry)
+ spin_unlock(&addr_map_lock);
+ if (new_map)
{
- if (existing_min)
- *existing_min = min_entry;
- if (existing_max)
- *existing_max = max_entry;
- spin_unlock(&addr_map_lock);
- return 1;
+ kfree(new_map);
+ new_map = 0;
}
- existing = upper_bound(min_addr, old_map);
- old_size = old_map->size;
+ new_map = kmalloc(sizeof(*new_map)
+ + sizeof(*new_entry) * (old_size + 1),
+ GFP_KERNEL);
+ if (!new_map)
+ return -ENOMEM;
+ new_map->size = old_size + 1;
}
- spin_unlock(&addr_map_lock);
- new_map = kmalloc(sizeof(*new_map)
- + sizeof(*new_entry) * (old_size + 1),
- GFP_KERNEL);
- if (!new_map)
- return -ENOMEM;
- spin_lock(&addr_map_lock);
- if (blackmap != old_map)
+ else
+ break;
+ }
+ if (!blackmap)
+ {
+ existing = 0;
+ }
+ else
+ {
+ min_entry = lookup_addr_aux(min_addr, blackmap);
+ max_entry = lookup_addr_aux(max_addr, blackmap);
+ if (min_entry || max_entry)
{
- kfree(new_map);
+ if (existing_min)
+ *existing_min = min_entry;
+ if (existing_max)
+ *existing_max = max_entry;
spin_unlock(&addr_map_lock);
- continue;
- }
- new_entry = &new_map->entries[existing];
- new_entry->min = min_addr;
- new_entry->max = max_addr;
- if (old_map)
- {
- memcpy(&new_map->entries, old_map->entries,
- existing * sizeof(*new_entry));
- if (old_map->size > existing)
- memcpy(new_entry + 1, &old_map->entries[existing + 1],
- (old_map->size - existing) * sizeof(*new_entry));
+ kfree(new_map);
+ return 1;
}
- new_map->size = blackmap->size + 1;
- blackmap = new_map;
- spin_unlock(&addr_map_lock);
- if (old_map)
- kfree(old_map);
- return 0;
+ existing = upper_bound(min_addr, old_map);
+ }
+ new_entry = &new_map->entries[existing];
+ new_entry->min = min_addr;
+ new_entry->max = max_addr;
+ if (old_map)
+ {
+ memcpy(&new_map->entries, old_map->entries,
+ existing * sizeof(*new_entry));
+ if (old_map->size > existing)
+ memcpy(new_entry + 1, &old_map->entries[existing],
+ (old_map->size - existing) * sizeof(*new_entry));
}
+ blackmap = new_map;
+ spin_unlock(&addr_map_lock);
+ if (old_map)
+ kfree(old_map);
+ return 0;
}
void
diff --git a/tapsets.cxx b/tapsets.cxx
index b1475997..a5a62c7a 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2241,7 +2241,8 @@ struct dwflpp
{
die = dwarf_formref_die (&attr_mem, &vardie);
stringstream alternatives;
- print_members(die,alternatives);
+ if (die != NULL)
+ print_members(die,alternatives);
throw semantic_error("unable to find local '" + local + "'"
+ " near pc " + lex_cast_hex<string>(pc)
+ (alternatives.str() == "" ? "" : (" (alternatives:" + alternatives.str () + ")")));
@@ -2317,7 +2318,8 @@ struct dwflpp
{
die = dwarf_formref_die (&attr_mem, vardie);
stringstream alternatives;
- print_members(die,alternatives);
+ if (die != NULL)
+ print_members(die,alternatives);
throw semantic_error("unable to find return value"
" near pc " + lex_cast_hex<string>(pc)
+ (alternatives.str() == "" ? "" : (" (alternatives:" + alternatives.str () + ")")));
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index f3fad077..4825cd27 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-01 Mark Wielaard <mjw@redhat.com>
+
+ * semok/thirtythree.stp: Use page->mapping instead of page->inuse
+ as annonymous struct value (also available in older kernels).
+
2008-09-26 Frank Ch. Eigler <fche@elastic.org>
PR 6916.
diff --git a/testsuite/semok/thirtythree.stp b/testsuite/semok/thirtythree.stp
index d5171f66..90070370 100755
--- a/testsuite/semok/thirtythree.stp
+++ b/testsuite/semok/thirtythree.stp
@@ -1,5 +1,5 @@
#! stap -p2
# Per bz3016, this should get through the semantic pass without warnings.
probe kernel.function("do_mpage_readpage") {
- printf("\n page ->inuse %u",$page->inuse)
+ printf("\n page->mapping %p",$page->mapping)
}
diff --git a/testsuite/systemtap.base/optim_arridx.exp b/testsuite/systemtap.base/optim_arridx.exp
index bef4d2b4..1f3f4371 100644
--- a/testsuite/systemtap.base/optim_arridx.exp
+++ b/testsuite/systemtap.base/optim_arridx.exp
@@ -58,7 +58,7 @@ end /* <- end */
# locals
idx0:long
{
-foreach ([idx0] in arr3) printf("arr3[%#d]=%#x\\n", idx0, arr3[idx0])
+foreach ([idx0] in arr3-) printf("arr3[%#d]=%#x\\n", idx0, arr3[idx0])
}
end /* <- end */
{