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/17190] 'stap -l' output not useful as stap input


https://sourceware.org/bugzilla/show_bug.cgi?id=17190

Jonathan Lebon <jlebon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jlebon at redhat dot com

--- Comment #1 from Jonathan Lebon <jlebon at redhat dot com> ---
Hey David,

(In reply to David Smith from comment #0)
> So, why didn't 'stap -l' tell me the function was at 1414 in the first place?

This is because stap -l uses the declaration line of the function, rather than
the first valid probe-able lineno of the function. See also the comment block
in dwflpp::collect_lines_for_single_lineno():

  /* Here, we handle ABSOLUTE and RELATIVE lineno types. Relative line numbers
   * are a bit special. The issue is that functions (esp. inlined ones) may not
   * even have a LR corresponding to the first valid line of code. So, applying
   * an offset to the 'first' LR found in the DIE can be quite imprecise.
   *     Instead, we use decl_line, which although does not necessarily have a
   * LR associated with it (it can sometimes still happen esp. if the code is
   * written in OTB-style), it serves as an anchor on which we can apply the
   * offset to yield a lineno that will not change with compiler optimization.
   *     It also has the added benefit of being consistent with the lineno
   * printed by e.g. stap -l kernel.function("vfs_read"), so users can be
   * confident from what lineno we adjust.
   */

This means that e.g. in your example:

  kernel.function("zap_huge_pmd@mm/huge_memory.c:1412").call

The function was declared at lineno 1412, but the first valid lineno you can
probe is at 1414.

I'm thinking we could modify the current behaviour so that if the decl line is
given, simply silently adjust to the first valid lineno in the function. We can
also then squash the WARNING about using .statement() instead of .function().

-- 
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]