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/11096] Getting global module vars in functions


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

agentzh <agentzh at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from agentzh <agentzh at gmail dot com> ---
A modified version of my patch has just been committed:

commit bd1fcbad9165da8a96bcffbb1d1d3ca9f7ce3242
Author: Yichun Zhang (agentzh) <agentzh@gmail.com>
Date:   Fri Jun 14 17:44:00 2013 -0700

    PR11096: Add support for the "module" argument to @var

    The notation @var("varname@cuname", "module") is now supported and @var
    can thus effectively be used almost everywhere like the context of stap
    functions, probe timer.profile, and probe kernel.trace().

    Just like @cast, multiple module names can be specified by separating
    them with ":", for example, "module1:module2:module3". And they will be
    attempted in turn until a match is found.

    Refactored the code by introducing atvar_op as suggested by Josh Stone
    to make the implementation cleaner. The fields "target_name" and
    "cu_name" have been moved from target_symbol to its subclass atvar_op.

    @var now searches all the CUs that matches the "cuname" specified for the
    variable. And when "cuname" is missing, @var just searches all the CUs.

    Accessing global variables in PIE and DSO via @var with either "cuname"
    or "module" now mostly works for the default (kernel) runtime (but note
    PR15688).

    Thanks Josh Stone for reviewing this patch and providing a lot of
    invaluable suggestions.

    * parse.cxx: Add support for the optional "module" parameter to the
      parser.
    * staptree.h: Remove the "target_name" field from target_symbol and make
      sym_name() virtual. Define atvar_op which inherits target_symbol. Add
      method visit_atvar_op to the visitor classes.
    * staptree.cxx: Define visit_atvar_op for the visitor classes. Define
      methods of atvar_op.
    * tapsets.cxx: Define visit_atvar_op for dwarf_var_expanding_visitor,
      sdt_uprobe_var_expanding_visitor, and
      tracepoint_var_expanding_visitor. Define dwarf_atvar_expanding_visitor
      to run in series with dwarf_cast_expanding_visitor in
      dwarf_derived_probe. Add dwarf_atvar_query to handle the DWARF queres
      of dwarf_atvar_expanding_visitor. Postpone the processing of @var with
      either cu name or module name or both to dwarf_atvar_expanding_visitor
      in order to eliminate code duplication.
    * elaborate.h: Declare visit_atvar_op for typeresolution_info.
      void_statement_reducer.
    * elaborate.cxx: Define visit_atvar_op for symbol_fetcher,
      typeresolution_info, and void_statement_reducer.
    * translate.cxx: Define visit_atvar_op for c_unparser.
    * testsuite/systemtap.base/: Add many more test cases for @var.

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