summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--runtime/ChangeLog4
-rw-r--r--runtime/sduprobes.h51
-rw-r--r--tapsets.cxx9
-rw-r--r--testsuite/ChangeLog4
-rw-r--r--testsuite/systemtap.base/static_uprobes.exp8
6 files changed, 47 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b3007b7..7c267e28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-21 Stan Cox <scox@redhat.com>
+
+ * tapsets.cxx (dwflpp::die_has_pc): Don't abort if dwarf_ranges fails.
+ (dwflpp::find_variable_and_frame_base): A pc requires dwarf_nscopes
+
2008-12-19 Elliott Baron <ebaron@redhat.com>
PR3668
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index 7026b276..ca852d53 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-21 Stan Cox <scox@redhat.com>
+
+ * sduprobes.h (STAP_PROBE): Put block around probe point.
+
2008-12-16 Stan Cox <scox@redhat.com>
* sduprobes.h (STAP_PROBE): Add synthetic reference to probe label.
diff --git a/runtime/sduprobes.h b/runtime/sduprobes.h
index efa25be7..17c1be71 100644
--- a/runtime/sduprobes.h
+++ b/runtime/sduprobes.h
@@ -25,6 +25,7 @@ struct _probe_ ## probe \
}; \
static volatile struct _probe_ ## probe _probe_ ## probe __attribute__ ((section (".probes"))) = {#probe,type,argc};
+// The goto _probe_ prevents the label from "drifting"
#ifdef USE_STAP_PROBE
#define STAP_PROBE(provider,probe) \
STAP_PROBE_STRUCT(probe,0,0) \
@@ -45,12 +46,12 @@ _probe_ ## probe: \
_stap_probe_1 (_probe_ ## probe.probe_name,(size_t)arg1);
#else
#define STAP_PROBE1(provider,probe,parm1) \
- volatile typeof(parm1) probe ## _arg1 = parm1; \
+ {volatile typeof(parm1) arg1 = parm1; \
_probe_ ## probe: \
- asm volatile ("nop" :: "r"(probe ## _arg1)); \
+ asm volatile ("nop" :: "r"(arg1)); \
STAP_PROBE_STRUCT(probe,1,(size_t)&& _probe_ ## probe) \
if (__builtin_expect(_probe_ ## probe.probe_type < 0, 0)) \
- goto _probe_ ## probe;
+ goto _probe_ ## probe;}
#endif
@@ -60,13 +61,13 @@ _probe_ ## probe: \
_stap_probe_2 (_probe_ ## probe.probe_name,(size_t)arg1,(size_t)arg2);
#else
#define STAP_PROBE2(provider,probe,parm1,parm2) \
- volatile typeof(parm1) probe ## _arg1 = parm1; \
- volatile typeof(parm2) probe ## _arg2 = parm2; \
+ {volatile typeof(parm1) arg1 = parm1; \
+ volatile typeof(parm2) arg2 = parm2; \
_probe_ ## probe: \
- asm volatile ("nop" :: "r"(probe ## _arg1), "r"(probe ## _arg2)); \
+ asm volatile ("nop" :: "r"(arg1), "r"(arg2)); \
STAP_PROBE_STRUCT(probe,1,(size_t)&& _probe_ ## probe)\
if (__builtin_expect(_probe_ ## probe.probe_type < 0, 0)) \
- goto _probe_ ## probe;
+ goto _probe_ ## probe;}
#endif
#ifdef USE_STAP_PROBE
@@ -75,14 +76,14 @@ _probe_ ## probe: \
_stap_probe_3 (_probe_ ## probe.probe_name,(size_t)arg1,(size_t)arg2,(size_t)arg3);
#else
#define STAP_PROBE3(provider,probe,parm1,parm2,parm3) \
- volatile typeof(parm1) probe ## _arg1 = parm1; \
- volatile typeof(parm2) probe ## _arg2 = parm2; \
- volatile typeof(parm3) probe ## _arg3 = parm3; \
+ {volatile typeof(parm1) arg1 = parm1; \
+ volatile typeof(parm2) arg2 = parm2; \
+ volatile typeof(parm3) arg3 = parm3; \
_probe_ ## probe: \
- asm volatile ("nop" :: "r"(probe ## _arg1), "r"(probe ## _arg2), "r"(probe ## _arg3)); \
+ asm volatile ("nop" :: "r"(arg1), "r"(arg2), "r"(arg3)); \
STAP_PROBE_STRUCT(probe,1,(size_t)&& _probe_ ## probe) \
if (__builtin_expect(_probe_ ## probe.probe_type < 0, 0)) \
- goto _probe_ ## probe;
+ goto _probe_ ## probe;}
#endif
#ifdef USE_STAP_PROBE
@@ -91,15 +92,15 @@ _probe_ ## probe: \
_stap_probe_4 (_probe_ ## probe.probe_name,(size_t)arg1,(size_t)arg2,(size_t)arg3,(size_t)arg4);
#else
#define STAP_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \
- volatile typeof(parm1) probe ## _arg1 = parm1; \
- volatile typeof(parm2) probe ## _arg2 = parm2; \
- volatile typeof(parm3) probe ## _arg3 = parm3; \
- volatile typeof(parm4) probe ## _arg4 = parm4; \
+ {volatile typeof(parm1) arg1 = parm1; \
+ volatile typeof(parm2) arg2 = parm2; \
+ volatile typeof(parm3) arg3 = parm3; \
+ volatile typeof(parm4) arg4 = parm4; \
_probe_ ## probe: \
- asm volatile ("nop" "r"(probe ## _arg1), "r"(probe ## _arg2), "r"(probe ## _arg3), "r"(probe ## _arg4)); \
+ asm volatile ("nop" "r"(arg1), "r"(arg2), "r"(arg3), "r"(arg4)); \
STAP_PROBE_STRUCT(probe,1,(size_t)&& _probe_ ## probe) \
if (__builtin_expect(_probe_ ## probe.probe_type < 0, 0)) \
- goto _probe_ ## probe;
+ goto _probe_ ## probe;}
#endif
#ifdef USE_STAP_PROBE
@@ -108,16 +109,16 @@ _probe_ ## probe: \
_stap_probe_5 (_probe_ ## probe.probe_name,(size_t)arg1,(size_t)arg2,(size_t)arg3,(size_t)arg4,(size_t)arg5);
#else
#define STAP_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \
- volatile typeof(parm1) probe ## _arg1 = parm1; \
- volatile typeof(parm2) probe ## _arg2 = parm2; \
- volatile typeof(parm3) probe ## _arg3 = parm3; \
- volatile typeof(parm4) probe ## _arg4 = parm4; \
- volatile typeof(parm5) probe ## _arg5 = parm5; \
+ {volatile typeof(parm1) arg1 = parm1; \
+ volatile typeof(parm2) arg2 = parm2; \
+ volatile typeof(parm3) arg3 = parm3; \
+ volatile typeof(parm4) arg4 = parm4; \
+ volatile typeof(parm5) arg5 = parm5; \
_probe_ ## probe: \
- asm volatile ("nop" "r"(probe ## _arg1), "r"(probe ## _arg2), "r"(probe ## _arg3), "r"(probe ## _arg4), "r"(probe ## _arg5)); \
+ asm volatile ("nop" "r"(arg1), "r"(arg2), "r"(arg3), "r"(arg4), "r"(arg5)); \
STAP_PROBE_STRUCT(probe,1,(size_t)&& _probe_ ## probe) \
if (__builtin_expect(_probe_ ## probe.probe_type < 0, 0)) \
- goto _probe_ ## probe;
+ goto _probe_ ## probe;}
#endif
#define DTRACE_PROBE(provider,probe) \
diff --git a/tapsets.cxx b/tapsets.cxx
index 0efaf455..20bea45d 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -1578,8 +1578,9 @@ struct dwflpp
bool die_has_pc (Dwarf_Die & die, Dwarf_Addr pc)
{
int res = dwarf_haspc (&die, pc);
- if (res == -1)
- dwarf_assert ("dwarf_haspc", res);
+ // dwarf_ranges will return -1 if a function die has no DW_AT_ranges
+ // if (res == -1)
+ // dwarf_assert ("dwarf_haspc", res);
return res == 1;
}
@@ -1708,7 +1709,7 @@ struct dwflpp
assert (cu);
- if (scope_die)
+ if (scope_die && pc == 0)
nscopes = dwarf_getscopes_die (scope_die, &scopes);
else
nscopes = dwarf_getscopes (cu, pc, &scopes);
@@ -5387,8 +5388,6 @@ dwarf_builder::build(systemtap_session & sess,
Dwarf_Die *cudie = dwarf_offdie (dwarf, off + cuhl, &cudie_mem);
if (cudie == NULL)
continue;
- if (0)
- printf("2 diename=%s module_name=%s probe_type=%d probe_arg=%#Lx\n",dwarf_diename(&cudie_mem),module_name.c_str(), (int)probe_type, (long long)probe_arg);
if (probe_type == no_debuginfo)
{
if (strncmp (dwarf_diename(&cudie_mem), "sduprobes", 9) == 0)
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index dc91a215..b18ccf61 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-21 Stan Cox <scox@redhat.com>
+
+ * systemtap.base/static_uprobes.exp: Parms now called $argN
+
2008-12-16 Stan Cox <scox@redhat.com>
* systemtap.base/static_uprobes.exp: Generate our own probes file.
diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp
index f3f26d8a..354256db 100644
--- a/testsuite/systemtap.base/static_uprobes.exp
+++ b/testsuite/systemtap.base/static_uprobes.exp
@@ -112,7 +112,7 @@ set fp [open "[pwd]/static_uprobes.stp" "w"]
puts $fp "
probe process(\"static_uprobes.x\").mark(\"label0\")
{
- printf(\"In label0 probe %#x\\n\", \$label0_arg1)
+ printf(\"In label0 probe %#x\\n\", \$arg1)
}
probe process(\"static_uprobes.x\").mark(\"label1\")
{
@@ -120,15 +120,15 @@ probe process(\"static_uprobes.x\").mark(\"label1\")
}
probe process(\"static_uprobes.x\").mark(\"label2\")
{
- printf(\"In label2 probe %#x\\n\", \$label2_arg1)
+ printf(\"In label2 probe %#x\\n\", \$arg1)
}
probe process(\"static_uprobes.x\").mark(\"label3\")
{
- printf(\"In label3 probe %#x %#x\\n\", \$label3_arg1, \$label3_arg2)
+ printf(\"In label3 probe %#x %#x\\n\", \$arg1, \$arg2)
}
probe process(\"static_uprobes.x\").mark(\"label4\")
{
- printf(\"In label4 dtrace probe %#x\\n\", \$label4_arg1)
+ printf(\"In label4 dtrace probe %#x\\n\", \$arg1)
}
"
close $fp