public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "jkenisto at us dot ibm dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sources.redhat.com
Subject: [Bug translator/11376] New: process(pid).statement(addr).absolute bugs + fix
Date: Sat, 13 Mar 2010 22:07:00 -0000	[thread overview]
Message-ID: <20100313220706.11376.jkenisto@us.ibm.com> (raw)

stap's original support for uprobes --
  process(<pid>).statement(<addr>).absolute[.return]
-- doesn't work for me unless I apply the following patch:

----- cut here ----
--- tapsets.cxx.orig	2010-03-12 16:33:54.084773884 -0800
+++ tapsets.cxx	2010-03-13 13:26:25.523494988 -0800
@@ -4812,13 +4812,15 @@
           // only the same fields as we're about to emit.
           s.op->line() << " .finder={";
           if (p->pid != 0)
-            s.op->line() << " .pid=" << p->pid;
+            s.op->line() << " .pid=" << p->pid << ",";
           else if (p->section == ".absolute") // proxy for ET_EXEC -> exec()'d
program
             {
               s.op->line() << " .procname=" << lex_cast_qstring(p->module) << ",";
               s.op->line() << " .callback=&stap_uprobe_process_found,";
             }
-          if (p->section != ".absolute") // ET_DYN 
+          if (p->section == "")  // .statement(addr).absolute
+            s.op->line() << " .callback=&stap_uprobe_process_found,";
+          else if (p->section != ".absolute") // ET_DYN 
             {
 	      if (p->has_library && p->sdt_semaphore_addr != 0)
 		s.op->line() << " .procname=\"" << p->path << "\", ";
----- cut here ----

The missing comma (line 4815) yields a compilation error in phase 4.

Failure to consider null section names (line 4821) apparently yields
code that never calls register_uprobe().

I don't know if these fixes are really the correct ones, but they work
for me: probing 32-bit (cc -m32) programs on my x86_64 Fedora 12 system,
running the weekly stap snapshot from March 6, 2010.

It's kind of an obscure feature, but it can come in handy when doing
exhaustive tests of uprobes on the x86 instruction set (see probe*.awk
attachments to PR #11249) or probing a program with a symbol table but
no DWARF.

-- 
           Summary: process(pid).statement(addr).absolute bugs + fix
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: jkenisto at us dot ibm dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11376

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

             reply	other threads:[~2010-03-13 22:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-13 22:07 jkenisto at us dot ibm dot com [this message]
2010-03-15 17:09 ` [Bug translator/11376] " fche at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100313220706.11376.jkenisto@us.ibm.com \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).