summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2008-08-25 11:24:19 -0400
committerDave Brolley <brolley@redhat.com>2008-08-25 11:24:19 -0400
commit4b861159c3f0b11deb52f3feeb56062ff8a287c9 (patch)
treec6e707eebb7933f0992faed1369c6dfcc81c2d18
parentb593551607cc5b6ef512e787b0f881d99c4ac6c5 (diff)
parentcee35f73e024d1f2eacaa42c25b05075fc9039a3 (diff)
downloadsystemtap-steved-4b861159c3f0b11deb52f3feeb56062ff8a287c9.tar.gz
systemtap-steved-4b861159c3f0b11deb52f3feeb56062ff8a287c9.tar.xz
systemtap-steved-4b861159c3f0b11deb52f3feeb56062ff8a287c9.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
-rw-r--r--ChangeLog13
-rw-r--r--README15
-rw-r--r--runtime/ChangeLog12
-rw-r--r--runtime/task_finder.c41
-rw-r--r--tapsets.cxx58
-rw-r--r--testsuite/ChangeLog4
-rwxr-xr-xtestsuite/buildok/process-all-probes.stp9
7 files changed, 96 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e7e2c68..ebbef729 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-08-24 Frank Ch. Eigler <fche@elastic.org>
+
+ * tapsets.cxx (query_statement): Leave empty string for unknown file
+ name.
+ (dwarf_derived_probe ctor): Don't synthesize "@filename:lineno"
+ probe point pieces for unknown files/lines.
+
+2008-08-21 David Smith <dsmith@redhat.com>
+
+ * tapsets.cxx (itrace_derived_probe_group::emit_module_decls):
+ Updated task finder callback function signature.
+ (utrace_derived_probe_group::emit_module_decls): Ditto.
+
2008-08-20 David Smith <dsmith@redhat.com>
* tapsets.cxx (utrace_derived_probe_group::emit_probe_decl):
diff --git a/README b/README
index 512881af..6b62c772 100644
--- a/README
+++ b/README
@@ -25,7 +25,7 @@ Build steps:
- Install the kernel-debuginfo, kernel-[smp-]devel, gcc and libcap-devel
packages (or see below if you are building your own kernels from source).
- If avaialable, install your distribution's copy of elfutils and its
+ 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
@@ -48,13 +48,15 @@ Build steps:
Consider configuring with "--enable-dejazilla" to automatically
contribute to our public test result database.
- % make all check
+ % make all
% sudo make install
+
+ To run the full test suite:
% sudo make installcheck
Tips:
-- Systemtap looks for the debug info in these locations:
+- By default, systemtap looks for the debug info in these locations:
/boot/vmlinux-`uname -r`
/usr/lib/debug/lib/modules/`uname -r`/vmlinux
/lib/modules/`uname -r`/vmlinux
@@ -65,16 +67,13 @@ Building a kernel.org kernel:
- Build the kernel using your normal procedures. Enable
CONFIG_DEBUG_INFO, CONFIG_KPROBES, and optionally CONFIG_RELAY and
CONFIG_DEBUG_FS.
+- Run "make install modules_install headers_install" as needed.
- Boot into the kernel.
- Make sure the large unstripped kernel image 'vmlinux' from your
build can be found by systemtap (see above) You can just symlink
it to one of these locations.
-- Symlink your source directory to these two places, though systemtap
- does not at present use such source code.
- - /usr/src/kernels/`uname -r`
- - /lib/modules/`uname -r`/source
- Symlink your build directory to here:
- - /lib/modules/`uname -r`/build
+ /lib/modules/`uname -r`/build
- For example, if your kernel source is in /home/me/linux/2.6.17-rc6
and you build your kernel in the source directory, you would do
this (be sure you are running the right kernel or `uname -r`
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index f829a883..3e1e400a 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,15 @@
+2008-08-21 David Smith <dsmith@redhat.com>
+
+ * task_finder.c (__stp_tf_vm_cb): Added task finder target
+ parameter.
+ (__stp_utrace_attach_match_filename): Updated task finder callback
+ call.
+ (__stp_utrace_task_finder_target_death): Ditto.
+ (__stp_utrace_task_finder_target_quiesce): Ditto.
+ (__stp_target_call_vm_callback): Ditto.
+ (__stp_utrace_task_finder_target_syscall_exit): Ditto.
+ (stap_start_task_finder): Ditto.
+
2008-08-20 David Smith <dsmith@redhat.com>
* task_finder.c: Supports original and new utrace interfaces.
diff --git a/runtime/task_finder.c b/runtime/task_finder.c
index 6b73d9b4..d81ad115 100644
--- a/runtime/task_finder.c
+++ b/runtime/task_finder.c
@@ -27,19 +27,21 @@ atomic_t __stp_attach_count = ATOMIC_INIT (0);
#define debug_task_finder_report() /* empty */
#endif
-typedef int (*stap_task_finder_callback)(struct task_struct *tsk,
+typedef int (*stap_task_finder_callback)(struct stap_task_finder_target *tgt,
+ struct task_struct *tsk,
int register_p,
- int process_p,
- struct stap_task_finder_target *tgt);
+ int process_p);
-typedef int (*stap_task_finder_vm_callback)(struct task_struct *tsk,
+typedef int (*stap_task_finder_vm_callback)(struct stap_task_finder_target *tgt,
+ struct task_struct *tsk,
int map_p, char *vm_path,
unsigned long vm_start,
unsigned long vm_end,
unsigned long vm_pgoff);
#ifdef DEBUG_TASK_FINDER_VMA
-int __stp_tf_vm_cb(struct task_struct *tsk,
+int __stp_tf_vm_cb(struct stap_task_finder_target *tgt,
+ struct task_struct *tsk,
int map_p, char *vm_path,
unsigned long vm_start,
unsigned long vm_end,
@@ -443,8 +445,9 @@ __stp_utrace_attach_match_filename(struct task_struct *tsk,
continue;
if (cb_tgt->callback != NULL) {
- int rc = cb_tgt->callback(tsk, register_p,
- process_p, cb_tgt);
+ int rc = cb_tgt->callback(cb_tgt, tsk,
+ register_p,
+ process_p);
if (rc != 0) {
_stp_error("callback for %d failed: %d",
(int)tsk->pid, rc);
@@ -655,9 +658,9 @@ __stp_utrace_task_finder_target_death(struct utrace_attached_engine *engine,
int rc;
// Call the callback
- rc = tgt->callback(tsk, 0,
- (tsk->signal == NULL) || (atomic_read(&tsk->signal->live) == 0),
- tgt);
+ rc = tgt->callback(tgt, tsk, 0,
+ ((tsk->signal == NULL)
+ || (atomic_read(&tsk->signal->live) == 0)));
if (rc != 0) {
_stp_error("death callback for %d failed: %d",
(int)tsk->pid, rc);
@@ -728,7 +731,8 @@ __stp_utrace_task_finder_target_quiesce(enum utrace_resume_action action,
#endif
if (mmpath) {
// Call the callback
- rc = tgt->vm_callback(tsk, 1, mmpath,
+ rc = tgt->vm_callback(tgt, tsk, 1,
+ mmpath,
vma->vm_start,
vma->vm_end,
(vma->vm_pgoff
@@ -863,7 +867,7 @@ __stp_target_call_vm_callback(struct stap_task_finder_target *tgt,
rc, (int)tsk->pid);
}
else {
- rc = tgt->vm_callback(tsk, 1, mmpath, vma->vm_start,
+ rc = tgt->vm_callback(tgt, tsk, 1, mmpath, vma->vm_start,
vma->vm_end,
(vma->vm_pgoff << PAGE_SHIFT));
if (rc != 0) {
@@ -939,8 +943,8 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action,
: ((syscall_no == MMAP2_SYSCALL_NO(tsk)) ? "mmap2"
: ((syscall_no == MPROTECT_SYSCALL_NO(tsk)) ? "mprotect"
: ((syscall_no == MUNMAP_SYSCALL_NO(tsk)) ? "munmap"
- : "UNKNOWN"))),
- arg0, rv);
+ : "UNKNOWN")))),
+ arg0, rv);
#endif
// Try to find the vma info we might have saved.
@@ -982,7 +986,7 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action,
// FIXME: We'll need to figure out to
// retrieve the path of a deleted
// vma.
- rc = tgt->vm_callback(tsk, 0, NULL,
+ rc = tgt->vm_callback(tgt, tsk, 0, NULL,
entry->vm_start,
entry->vm_end,
(entry->vm_pgoff
@@ -1016,7 +1020,7 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action,
// FIXME: We'll need to figure out to
// retrieve the path of a deleted
// vma.
- rc = tgt->vm_callback(tsk, 0, NULL,
+ rc = tgt->vm_callback(tgt, tsk, 0, NULL,
entry->vm_start,
entry->vm_end,
(entry->vm_pgoff
@@ -1149,9 +1153,8 @@ stap_start_task_finder(void)
// the thread is a thread group
// leader, it is a process.
if (cb_tgt->callback != NULL) {
- rc = cb_tgt->callback(tsk, 1,
- (tsk->pid == tsk->tgid),
- cb_tgt);
+ rc = cb_tgt->callback(cb_tgt, tsk, 1,
+ (tsk->pid == tsk->tgid));
if (rc != 0) {
_stp_error("attach callback for %d failed: %d",
(int)tsk->pid, rc);
diff --git a/tapsets.cxx b/tapsets.cxx
index d2e5bdba..b924f1fc 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -237,7 +237,7 @@ common_probe_entryfn_prologue (translator_output* o, string statestr,
o->newline() << "#ifdef STP_OVERLOAD";
o->newline() << "c->cycles_sum = 0;";
o->newline() << "c->cycles_base = 0;";
- o->newline() << "#endif";
+ o->newline() << "#endif";
*/
}
@@ -1220,7 +1220,7 @@ struct dwflpp
// XXX: it is probably desirable to search other CU's declarations
// in the same module.
-
+
if (v->find(name) == v->end())
return NULL;
@@ -1257,15 +1257,15 @@ struct dwflpp
dwarf_query * q = static_cast<dwarf_query *>(data);
int lineno = lines[0];
auto_free_ref<Dwarf_Line**> free_srcsp(srcsp);
-
+
get_module_dwarf();
- if (line_type == RELATIVE)
+ if (line_type == RELATIVE)
{
Dwarf_Addr addr;
Dwarf_Line *line;
int line_number;
-
+
dwarf_assert ("dwarf_entrypc", dwarf_entrypc (this->function, &addr));
line = dwarf_getsrc_die (this->cu, addr);
dwarf_assert ("dwarf_getsrc_die", line == NULL);
@@ -1274,7 +1274,7 @@ struct dwflpp
}
else if (line_type == WILDCARD)
function_line (&lineno);
-
+
for (int l = lineno; ; l = l + 1)
{
set<int> lines_probed;
@@ -2125,12 +2125,12 @@ struct dwflpp
else
{
// We have the pointer: cast it to an integral type via &(*(...))
-
+
// NB: per bug #1187, at one point char*-like types were
// automagically converted here to systemtap string values.
// For several reasons, this was taken back out, leaving
// pointer-to-string "conversion" (copying) to tapset functions.
-
+
ty = pe_long;
if (typetag == DW_TAG_array_type)
c_translate_array (pool, 1, module_bias, typedie, tail, NULL, 0);
@@ -2669,7 +2669,7 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, void * arg),
assert (module);
assert (cu);
dwarf_query * q = static_cast<dwarf_query *>(data);
-
+
string key = module_name + ":" + cu_name;
cu_function_cache_t *v = cu_function_cache[key];
if (v == 0)
@@ -2680,7 +2680,7 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, void * arg),
if (q->sess.verbose > 4)
clog << "function cache " << key << " size " << v->size() << endl;
}
-
+
string subkey = q->function;
if (v->find(subkey) != v->end())
{
@@ -2699,7 +2699,7 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, void * arg),
{
if (q->sess.verbose > 4)
clog << "function cache " << key << " match " << func_name << " vs " << subkey << endl;
-
+
rc = (*callback)(& die, data);
if (rc != DWARF_CB_OK) break;
}
@@ -3025,7 +3025,7 @@ dwarf_query::build_blacklist()
blfn_ret += ")$";
blfile += ")$";
- if (sess.verbose > 2)
+ if (sess.verbose > 2)
{
clog << "blacklist regexps:" << endl;
clog << "blfn: " << blfn << endl;
@@ -3073,7 +3073,7 @@ dwarf_query::parse_function_spec(string & spec)
while (i != e && *i != ':' && *i != '+')
file += *i++;
- if (*i == ':')
+ if (*i == ':')
{
if (*(i + 1) == '*')
line_type = WILDCARD;
@@ -3101,7 +3101,7 @@ dwarf_query::parse_function_spec(string & spec)
if (line_type != WILDCARD)
{
string::const_iterator dash = i;
-
+
while (dash != e && *dash != '-')
dash++;
if (dash == e)
@@ -3113,7 +3113,7 @@ dwarf_query::parse_function_spec(string & spec)
line[1] = lex_cast<int>(string(dash + 1, e));
}
}
-
+
if (sess.verbose>2)
clog << "parsed '" << spec
<< "' -> func '"<< function
@@ -3395,7 +3395,7 @@ query_statement (string const & func,
{
try
{
- q->add_probe_point(func, file ? file : "?",
+ q->add_probe_point(func, file ? file : "",
line, scope_die, stmt_addr);
}
catch (const semantic_error& e)
@@ -3705,7 +3705,7 @@ query_cu (Dwarf_Die * cudie, void * arg)
if (rc != DWARF_CB_OK)
q->query_done = true;
- if (q->sess.prologue_searching
+ if (q->sess.prologue_searching
&& !q->has_statement_str && !q->has_statement_num) // PR 2608
if (! q->filtered_functions.empty())
q->dw.resolve_prologue_endings (q->filtered_functions);
@@ -4297,7 +4297,7 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
Dwarf_Die *scopes;
if (dwarf_getscopes_die (scope_die, &scopes) == 0)
return;
-
+
target_symbol *tsym = new target_symbol;
print_format* pf = new print_format;
@@ -4323,7 +4323,7 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
{
tsym->tok = e->tok;
tsym->base_name = "$return";
-
+
// Ignore any variable that isn't accessible.
tsym->saved_conversion_error = 0;
this->visit_target_symbol(tsym); // NB: throws nothing ...
@@ -4355,16 +4355,16 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
if (e->base_name == "$$locals")
continue;
break;
-
+
default:
continue;
}
-
+
const char *diename = dwarf_diename (&result);
tsym->tok = e->tok;
tsym->base_name = "$";
tsym->base_name += diename;
-
+
// Ignore any variable that isn't accessible.
tsym->saved_conversion_error = 0;
this->visit_target_symbol(tsym); // NB: throws nothing ...
@@ -4587,9 +4587,11 @@ dwarf_derived_probe::dwarf_derived_probe(const string& funcname,
{
string retro_name = funcname;
if (filename != "")
+ {
retro_name += ("@" + string (filename));
- if (line != -1)
+ if (line > 0)
retro_name += (":" + lex_cast<string> (line));
+ }
comps.push_back
(new probe_point::component
(fn_or_stmt, new literal_string (retro_name)));
@@ -5019,7 +5021,7 @@ dwarf_builder::build(systemtap_session & sess,
sess.sym_kprobes_text_end = lookup_symbol_address (km, "__kprobes_text_end");
if (! sess.sym_stext)
sess.sym_stext = lookup_symbol_address (km, "_stext");
-
+
if (sess.verbose > 2)
{
clog << "control symbols:"
@@ -5103,7 +5105,7 @@ symbol_table::read_symbols(FILE *f, const string& path)
line++;
if (ret < 3)
{
- cerr << "Symbol table error: Line "
+ cerr << "Symbol table error: Line "
<< line
<< " of symbol list from "
<< path
@@ -5684,7 +5686,7 @@ itrace_derived_probe_group::emit_module_decls (systemtap_session& s)
// Output task finder callback routine that gets called for all
// itrace probe types.
- s.op->newline() << "static int _stp_itrace_probe_cb(struct task_struct *tsk, int register_p, int process_p, struct stap_task_finder_target *tgt) {";
+ s.op->newline() << "static int _stp_itrace_probe_cb(struct stap_task_finder_target *tgt, struct task_struct *tsk, int register_p, int process_p) {";
s.op->indent(1);
s.op->newline() << "int rc = 0;";
s.op->newline() << "struct stap_itrace_probe *p = container_of(tgt, struct stap_itrace_probe, tgt);";
@@ -6283,7 +6285,7 @@ utrace_derived_probe_group::emit_module_decls (systemtap_session& s)
// Output task_finder callback routine that gets called for all
// utrace probe types.
- s.op->newline() << "static int _stp_utrace_probe_cb(struct task_struct *tsk, int register_p, int process_p, struct stap_task_finder_target *tgt) {";
+ s.op->newline() << "static int _stp_utrace_probe_cb(struct stap_task_finder_target *tgt, struct task_struct *tsk, int register_p, int process_p) {";
s.op->indent(1);
s.op->newline() << "int rc = 0;";
s.op->newline() << "struct stap_utrace_probe *p = container_of(tgt, struct stap_utrace_probe, tgt);";
@@ -8133,7 +8135,7 @@ mark_builder::build(systemtap_session & sess,
mark_cache_const_iterator_pair_t ret;
mark_cache_const_iterator_t it;
bool matching_format_string = false;
-
+
ret = mark_cache.equal_range(name);
for (it = ret.first; it != ret.second; ++it)
{
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index 9c7f8fec..27b0a0c1 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-22 Wenji Huang <wenji.huang@oracle.com>
+
+ * buildok/process-all-probes.stp: Change system-wide probes to detailed ones to avoid including user space ones.
+
2008-08-15 David Smith <dsmith@redhat.com>
* systemtap.base/utrace_p4.exp: Change system-wide probes from
diff --git a/testsuite/buildok/process-all-probes.stp b/testsuite/buildok/process-all-probes.stp
index ec6ceab0..91a96514 100755
--- a/testsuite/buildok/process-all-probes.stp
+++ b/testsuite/buildok/process-all-probes.stp
@@ -2,4 +2,11 @@
// Tests if all probes in the process tapset are resolvable.
-probe process.* {}
+probe process.create,
+ process.start,
+ process.exec,
+ process.exec_complete,
+ process.exit,
+ process.release
+{
+}