This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/13315] @cast() should also accept an object file to extract typedie info
- From: "jistone at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Tue, 18 Oct 2011 18:43:54 +0000
- Subject: [Bug translator/13315] @cast() should also accept an object file to extract typedie info
- Auto-submitted: auto-generated
- References: <bug-13315-6586@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13315
Josh Stone <jistone at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jistone at redhat dot com
--- Comment #1 from Josh Stone <jistone at redhat dot com> 2011-10-18 18:43:54 UTC ---
I see two things going on here. First, @cast isn't treating the relative path
correctly, because of this check:
> bool
> is_user_module(const std::string &m)
> {
> return m[0] == '/' && m.rfind(".ko", m.length() - 1) != m.length() - 3;
> }
That's checking only for a leading slash, so a relative path is treated as a
kernel module. We'll have to check other callers, but I think it would work to
make it like this instead:
> return (m.find('/') != string::npos) && !endswith(m, ".ko");
The second thing I notice, even with a fully-specified path, is that we appear
to only work with user modules that are ET_EXEC or ET_DYN. With the ET_REL
foo.o, I get:
> $ stap -p2 -e 'probe begin { println(@cast(0,"foo","/home/jistone/bugs/pr13315/foo.o")->bar) }'
> WARNING: cannot find module /home/jistone/bugs/pr13315/foo.o debuginfo: Callbacks missing for ET_REL file
> WARNING: cannot find module /home/jistone/bugs/pr13315/foo.o debuginfo: Callbacks missing for ET_REL file
> WARNING: cannot find module /home/jistone/bugs/pr13315/foo.o debuginfo: Callbacks missing for ET_REL file
> WARNING: cannot find module /home/jistone/bugs/pr13315/foo.o debuginfo: Callbacks missing for ET_REL file
> semantic error: type definition 'foo' not found: identifier '@cast' at <input>:1:23
> source: probe begin { println(@cast(0,"foo","/home/jistone/bugs/pr13315/foo.o")->bar) }
> ^
> Pass 2: analysis failed. Try again with another '--vp 01' option.
And a side note, since I overheard that rrakus was first trying to get @cast
working in a probe process.mark. We've always filled in the @cast module
automatically for .function probes, and I happened to notice recently that we
weren't doing this for .mark, so I fixed that in commit 40a0c64e. This commit
is too recent to be in a release yet though. It also still requires debuginfo
for that binary, which isn't necessarily present for SDT use.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.