summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-08-21 13:29:50 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-08-21 13:29:50 -0400
commitb6921d5942950cb988318c36ee0e0792311f1ccc (patch)
treec6093273bdc69fd0d617edb2d1a718a82530e313
parent73812da575ff92ea388c8bb16e42a9c5aaa6ee20 (diff)
downloadsystemtap-steved-b6921d5942950cb988318c36ee0e0792311f1ccc.tar.gz
systemtap-steved-b6921d5942950cb988318c36ee0e0792311f1ccc.tar.xz
systemtap-steved-b6921d5942950cb988318c36ee0e0792311f1ccc.zip
cleanup: rename task_finder_target->pathname -> procname
The previous name made it easy to misread the purpose of this field. It is only for matching executable names, not for shared libraries. * runtime/task_finder.c (task_finder_target): Rename field. (*): Adjust. * tapset-itrace.cxx, tapset-utrace.cxx, tapsets.cxx, translate.cxx: Ditto.
-rw-r--r--runtime/task_finder.c26
-rw-r--r--tapset-itrace.cxx4
-rw-r--r--tapset-utrace.cxx4
-rw-r--r--tapsets.cxx6
-rw-r--r--translate.cxx4
5 files changed, 22 insertions, 22 deletions
diff --git a/runtime/task_finder.c b/runtime/task_finder.c
index d6b2b6da..ca807020 100644
--- a/runtime/task_finder.c
+++ b/runtime/task_finder.c
@@ -100,7 +100,7 @@ struct stap_task_finder_target {
size_t pathlen;
/* public: */
- const char *pathname;
+ const char *procname;
pid_t pid;
stap_task_finder_callback callback;
stap_task_finder_mmap_callback mmap_callback;
@@ -170,8 +170,8 @@ stap_register_task_finder_target(struct stap_task_finder_target *new_tgt)
if (new_tgt == NULL)
return EFAULT;
- if (new_tgt->pathname != NULL)
- new_tgt->pathlen = strlen(new_tgt->pathname);
+ if (new_tgt->procname != NULL)
+ new_tgt->pathlen = strlen(new_tgt->procname);
else
new_tgt->pathlen = 0;
@@ -188,14 +188,14 @@ stap_register_task_finder_target(struct stap_task_finder_target *new_tgt)
new_tgt->ops.report_syscall_exit = \
&__stp_utrace_task_finder_target_syscall_exit;
- // Search the list for an existing entry for pathname/pid.
+ // Search the list for an existing entry for procname/pid.
list_for_each(node, &__stp_task_finder_list) {
tgt = list_entry(node, struct stap_task_finder_target, list);
if (tgt != NULL
- /* pathname-based target */
+ /* procname-based target */
&& ((new_tgt->pathlen > 0
&& tgt->pathlen == new_tgt->pathlen
- && strcmp(tgt->pathname, new_tgt->pathname) == 0)
+ && strcmp(tgt->procname, new_tgt->procname) == 0)
/* pid-based target (a specific pid or all
* pids) */
|| (new_tgt->pathlen == 0 && tgt->pathlen == 0
@@ -737,15 +737,15 @@ __stp_utrace_attach_match_filename(struct task_struct *tsk,
tgt = list_entry(tgt_node, struct stap_task_finder_target,
list);
- // If we've got a matching pathname or we're probing
+ // If we've got a matching procname or we're probing
// all threads, we've got a match. We've got to keep
// matching since a single thread could match a
- // pathname and match an "all thread" probe.
+ // procname and match an "all thread" probe.
if (tgt == NULL)
continue;
else if (tgt->pathlen > 0
&& (tgt->pathlen != filelen
- || strcmp(tgt->pathname, filename) != 0))
+ || strcmp(tgt->procname, filename) != 0))
continue;
/* Ignore pid-based target, they were handled at startup. */
else if (tgt->pid != 0)
@@ -783,8 +783,8 @@ __stp_utrace_attach_match_filename(struct task_struct *tsk,
}
// This function handles the details of getting a task's associated
-// pathname, and calling __stp_utrace_attach_match_filename() to
-// attach to it if we find the pathname "interesting". So, what's the
+// procname, and calling __stp_utrace_attach_match_filename() to
+// attach to it if we find the procname "interesting". So, what's the
// difference between path_tsk and match_tsk? Normally they are the
// same, except in one case. In an UTRACE_EVENT(EXEC), we need to
// detach engines from the newly exec'ed process (since its path has
@@ -1403,10 +1403,10 @@ stap_start_task_finder(void)
struct stap_task_finder_target, list);
if (tgt == NULL)
continue;
- /* pathname-based target */
+ /* procname-based target */
else if (tgt->pathlen > 0
&& (tgt->pathlen != mmpathlen
- || strcmp(tgt->pathname, mmpath) != 0))
+ || strcmp(tgt->procname, mmpath) != 0))
continue;
/* pid-based target */
else if (tgt->pid != 0 && tgt->pid != tsk->pid)
diff --git a/tapset-itrace.cxx b/tapset-itrace.cxx
index 57c20539..dee2fe64 100644
--- a/tapset-itrace.cxx
+++ b/tapset-itrace.cxx
@@ -148,12 +148,12 @@ itrace_derived_probe_group::emit_probe_decl (systemtap_session& s,
if (p->has_path)
{
- s.op->line() << " .pathname=\"" << p->path << "\",";
+ s.op->line() << " .procname=\"" << p->path << "\",";
s.op->line() << " .pid=0,";
}
else
{
- s.op->line() << " .pathname=NULL,";
+ s.op->line() << " .procname=NULL,";
s.op->line() << " .pid=" << p->pid << ",";
}
diff --git a/tapset-utrace.cxx b/tapset-utrace.cxx
index 5de62835..0fc02d6e 100644
--- a/tapset-utrace.cxx
+++ b/tapset-utrace.cxx
@@ -652,12 +652,12 @@ utrace_derived_probe_group::emit_probe_decl (systemtap_session& s,
if (p->has_path)
{
- s.op->line() << " .pathname=\"" << p->path << "\",";
+ s.op->line() << " .procname=\"" << p->path << "\",";
s.op->line() << " .pid=0,";
}
else
{
- s.op->line() << " .pathname=NULL,";
+ s.op->line() << " .procname=NULL,";
s.op->line() << " .pid=" << p->pid << ",";
}
diff --git a/tapsets.cxx b/tapsets.cxx
index 04d03503..f94bea99 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -4432,8 +4432,8 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s)
if (p->pid != 0)
s.op->line() << " .pid=" << p->pid;
else if (p->section == ".absolute")
- s.op->line() << " .pathname=" << lex_cast_qstring(p->module) << ", ";
- // else ".dynamic" gets pathname=0, pid=0, activating task_finder "global tracing"
+ s.op->line() << " .procname=" << lex_cast_qstring(p->module) << ", ";
+ // else ".dynamic" gets procname=0, pid=0, activating task_finder "global tracing"
s.op->line() << "},";
if (p->section != ".absolute")
s.op->line() << " .pathname=" << lex_cast_qstring(p->module) << ", ";
@@ -4684,7 +4684,7 @@ uprobe_derived_probe_group::emit_module_init (systemtap_session& s)
s.op->newline() << "for (i=0; i<" << probes.size() << "; i++) {";
s.op->newline(1) << "struct stap_uprobe_spec *sups = & stap_uprobe_specs[i];";
s.op->newline() << "probe_point = sups->pp;"; // for error messages
- s.op->newline() << "if (sups->finder.pathname) sups->finder.callback = & stap_uprobe_process_found;";
+ s.op->newline() << "if (sups->finder.procname) sups->finder.callback = & stap_uprobe_process_found;";
s.op->newline() << "else if (sups->pathname) sups->finder.mmap_callback = & stap_uprobe_mmap_found;";
s.op->newline() << "rc = stap_register_task_finder_target (& sups->finder);";
diff --git a/translate.cxx b/translate.cxx
index 7e0d9d96..56d6de4c 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -1170,7 +1170,7 @@ c_unparser::emit_module_init ()
o->newline() << "if (rc) {";
o->newline(1) << "_stp_error ("
<< "\"couldn't initialize task-finder for %s\\n\","
- << "_stp_modules[i]->vmcb->pathname);";
+ << "_stp_modules[i]->vmcb->procname);";
o->newline() << "goto out;";
o->newline(-1) << "}";
o->newline(-1) << "}";
@@ -4863,7 +4863,7 @@ dump_unwindsyms (Dwfl_Module *m,
// NB: runtime/sym.c
c->output << "static struct stap_task_finder_target _stp_vmcb_" << stpmod_idx << "= {\n";
c->output << "#ifdef CONFIG_UTRACE\n";
- c->output << ".pathname = " << lex_cast_qstring (mainfile) << ",\n";
+ c->output << ".procname = " << lex_cast_qstring (mainfile) << ",\n";
c->output << ".mmap_callback = &_stp_tf_mmap_cb,\n";
c->output << ".munmap_callback = &_stp_tf_munmap_cb,\n";
c->output << "#endif\n";