This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/13315] @cast() should also accept an object file to extract typedie info


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]