3
0
forked from pool/systemtap
systemtap/systemtap-probe-at-function-entry.diff

103 lines
3.1 KiB
Diff

diff -Naur F/hash.cxx P/hash.cxx
--- F/hash.cxx 2007-02-13 16:12:11.000000000 -0800
+++ P/hash.cxx 2007-02-13 16:11:31.000000000 -0800
@@ -97,6 +97,7 @@
h.add(s.bulk_mode); // '-b'
h.add(s.merge); // '-M'
h.add(s.timing); // '-t'
+ h.add(s.prologue_searching); // '-P'
for (unsigned i = 0; i < s.macros.size(); i++)
h.add(s.macros[i]);
diff -Naur F/main.cxx P/main.cxx
--- F/main.cxx 2007-02-13 16:12:11.000000000 -0800
+++ P/main.cxx 2007-02-13 16:11:31.000000000 -0800
@@ -71,6 +71,8 @@
<< " -k keep temporary directory" << endl
<< " -u unoptimized translation" << (s.unoptimized ? " [set]" : "") << endl
<< " -g guru mode" << (s.guru_mode ? " [set]" : "") << endl
+ << " -P prologue-searching for function probes"
+ << (s.prologue_searching ? " [set]" : "") << endl
<< " -b bulk (relayfs) mode" << (s.bulk_mode ? " [set]" : "") << endl
<< " -M Don't merge per-cpu files for bulk (relayfs) mode" << (s.merge ? "" : " [set]") << endl
<< " -s NUM buffer size in megabytes, instead of "
@@ -197,6 +199,13 @@
s.guru_mode = false;
s.bulk_mode = false;
s.unoptimized = false;
+
+#ifdef ENABLE_PROLOGUES
+ s.prologue_searching = true;
+#else
+ s.prologue_searching = false;
+#endif
+
s.buffer_size = 0;
s.last_pass = 5;
s.module_name = "stap_" + stringify(getpid());
@@ -256,7 +265,7 @@
while (true)
{
- int grc = getopt (argc, argv, "hVMvtp:I:e:o:R:r:m:kgc:x:D:bs:u");
+ int grc = getopt (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:u");
if (grc < 0)
break;
switch (grc)
@@ -328,6 +337,10 @@
s.guru_mode = true;
break;
+ case 'P':
+ s.prologue_searching = true;
+ break;
+
case 'b':
s.bulk_mode = true;
break;
diff -Naur F/session.h P/session.h
--- F/session.h 2007-02-13 16:12:41.000000000 -0800
+++ P/session.h 2007-02-13 16:11:44.000000000 -0800
@@ -94,6 +94,7 @@
int buffer_size;
unsigned perfmon;
bool symtab;
+ bool prologue_searching;
// Cache data
bool use_cache;
diff -Naur F/tapsets.cxx P/tapsets.cxx
--- F/tapsets.cxx 2007-02-13 16:12:11.000000000 -0800
+++ P/tapsets.cxx 2007-02-13 16:11:31.000000000 -0800
@@ -2413,19 +2413,19 @@
}
else
{
-#ifdef __ia64__
- // In IA64 platform function probe point is set at its
- // entry point rather than prologue end pointer
- query_statement (fi.name, fi.decl_file, fi.decl_line,
- &fi.die, entrypc, q);
-
-#else
- if (fi.prologue_end == 0)
- throw semantic_error("could not find prologue-end "
+ if (q->sess.prologue_searching)
+ {
+ if (fi.prologue_end == 0)
+ throw semantic_error("could not find prologue-end "
"for probed function '" + fi.name + "'");
- query_statement (fi.name, fi.decl_file, fi.decl_line,
+ query_statement (fi.name, fi.decl_file, fi.decl_line,
&fi.die, fi.prologue_end, q);
-#endif
+ }
+ else
+ {
+ query_statement (fi.name, fi.decl_file, fi.decl_line,
+ &fi.die, entrypc, q);
+ }
}
}
catch (semantic_error &e)