]> sourceware.org Git - systemtap.git/commitdiff
Merge commit 'origin/dwarfless' into pr6429-comp-unwindsyms
authorFrank Ch. Eigler <fche@elastic.org>
Wed, 7 May 2008 23:26:10 +0000 (19:26 -0400)
committerFrank Ch. Eigler <fche@elastic.org>
Wed, 7 May 2008 23:26:10 +0000 (19:26 -0400)
* commit 'origin/dwarfless':
  The beginnings of a no-dwarf version of syscalls.stp.  Selected
  Added CPU REGISTERS and NUMBERED FUNCTION ARGUMENTS sections to
  Replaced [u_]arg() with [u]int_arg(), [u]long_arg(), {s|u}32_arg(),
  Added support for register(), u_register(), arg(), and u_arg() functions.
  * testsuite/{semok,semko}/nodwf*.stp
  PR 4311 - Function boundary tracing without debuginfo: Phase I

1  2 
ChangeLog
main.cxx
session.h
stap.1.in
tapsets.cxx
translate.cxx

diff --cc ChangeLog
index 57b1debc393aca097f23e84d29476a0953451ff9,dbaf527b8cc91ea2bb2825ea0c24779fc8b31c5f..ee84b636b6a6dbe22ffaa60e082b3b6f1a678663
+++ b/ChangeLog
+ 2008-05-06  Jim Keniston  <jkenisto@us.ibm.com>
+       PR 4311 - Function boundary tracing without debuginfo: Phase II
+       * stapfuncs.5.in: Added sections on CPU REGISTERS and
+       NUMBERED FUNCTION ARGUMENTS.
+ 2008-05-05  Jim Keniston  <jkenisto@us.ibm.com>
+       PR 4311 - Function boundary tracing without debuginfo: Phase II
+       * runtime/regs.c: Added register name:value lookup facility.
+       Added support for register and arg lookup for i386 and x86_64.
+       * tapset/{i686,x86_64}/registers.stp: New: support for register
+       and arg lookup.
+       * tapsets.cxx, translate.cxx: Added regparm field to struct
+       context.
+       * tapset/nd_syscall.stp: syscall.stp migrating toward numbered
+       args rather than named args.
+ 2008-04-18  Jim Keniston  <jkenisto@us.ibm.com>
+       PR 4311 - Function boundary tracing without debuginfo: Phase I
+       * tapsets.cxx: Major rework of dwflpp, dwarf_query, and related
+       code to make do with elf info if dwarf info is absent, or
+       (in the case of vmlinux) make do with a System.map-style
+       symbol table if even the elf file is absent.
+       * main.cxx: Use getopt_long instead of getopt.  Added --kelf,
+       --kmap, --ignore-vmlinux, and --ignore-dwarf.
+       * hash.cxx, session.h, stap.1.in: Added --kelf, --kmap,
+       --ignore-vmlinux, and --ignore-dwarf.
+       * testsuite/{semok,semko}/nodwf*.stp
 +2008-05-05  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 444886.  From <crquan@gmail.com>:
 +      * tapsets.cxx, translate.cxx: Add .../build/... to default debuginfo
 +      path, to ease search for hand-built kernels.
 +
 +2008-05-01  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 6474
 +      * configure.ac (--enable-pie): Add default option.
 +      * Makefile.am (stap* binaries): Use -fpie/-z relro/-z now as
 +      applicable.
 +      * configure, aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated.
 +
 +2008-04-30  Masami Hiramatsu  <mhiramat@redhat.com>
 +
 +      PR 6008
 +      * main.cxx (main): Increase the limitation of buffer size to 4095MB.
 +      * staprun.8.in: Ditto.
 +
 +2008-04-29  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 6466
 +      * elaborate.cxx
 +      (dead_stmtexpr_remover): Expand scope to kill far more
 +      side-effect-free statemnets, including if/for/foreach.
 +      (semantic_pass_opt4): Warn on elided function/probe bodies.
 +      (typeresolution_info::visit_target_symbol): Dump parse tree of
 +      resolution-challenged functions/probes.
 +      (*): Adapt to probe->body being a statement*
 +      rather than a block*.
 +      * tapsets.cxx (*): Ditto.
 +      * staptree.cxx (block::block ctor): New cons constructor.
 +      * staptree.h: Corresponding changes.
 +
 +2008-04-29  David Smith  <dsmith@redhat.com>
 +
 +      * tapsets.cxx (utrace_derived_probe_group::emit_probe_decl): Added
 +      death event handlers to ensure that for every utrace_attach there
 +      is a corresponding utrace_detach.
 +      (utrace_derived_probe_group::emit_module_decls): Ditto.
 +
 +2008-04-28  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      * translate.cxx (translate_pass): Don't #define TEST_MODE.
 +
 +2008-04-26  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      * tapsets.cxx (common_probe_entryfn_prologue): Undo
 +      clear of overload-related context vars; add explanation why.
 +
 +2008-04-25  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      * systemtap.spec.in: Simplify configuration defaults.
 +
 +2008-04-29  David Smith  <dsmith@redhat.com>:ChangeLog
 +
 +2008-04-25  David Smith  <dsmith@redhat.com>
 +
 +      PR 6455.
 +      * tapsets.cxx (mark_builder::build): Handles markers with no
 +      format string.
 +
 +2008-04-24  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 6454.
 +      * main.cxx (printscript): Avoid string truncation heuristics, and
 +      also avoid plain probe::printsig.  Hold nose and dig down into
 +      raw location lists instead.
 +
 +2008-04-24  Will Cohen  <wcohen@redhat.com>
 +
 +      * aclocal.m4: Regenerated.
 +      * Makefile.am (example/*): Moved to testsuite/systemtap.examples.
 +      * Makefile.in: Regenerated.
 +
 +2008-04-23  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      From: Srinivasa DS <srinivasa@in.ibm.com>
 +      * tapsets.cxx (blacklisted_p): Blacklist more init/exit sections.
 +
 +2008-04-23  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      * tapsets.cxx (common_probe_entryfn_prologue): Clear
 +      overload-related context vars.
 +
 +2008-04-22  hunt  <hunt@redhat.com>
 +
 +      * staprun.8.in: Add documentation for -d option.
 +
 +2008-04-22  David Smith  <dsmith@redhat.com>
 +
 +      * tapsets.cxx (utrace_derived_probe_group::emit_module_decls):
 +      Removed debug statements.
 +
 +2008-04-18  David Smith  <dsmith@redhat.com>
 +
 +      * tapsets.cxx (struct utrace_builder): Added exec probes.
 +      (utrace_derived_probe_group::emit_probe_decl): Ditto.
 +      (utrace_derived_probe_group::emit_module_decls): Ditto.
 +      (register_standard_tapsets): Ditto.
 +      * stapprobes.5.in: Added information about exec probes.
 +      * NEWS: Added information about utrace probes.
 +
 +      * stapprobes.5.in: Added information about utrace probes.
 +
 +2008-04-17  Josh Stone  <joshua.i.stone@intel.com>
 +
 +      * tapsets.cxx (build_blacklist): Fix regexps for atomics.
 +      * vim/syntax/stap.vim: Recognize the 'limit' keyword and script arguments,
 +      allow '$' in variable names, and highlight $target variables.
 +
 +2008-04-17  David Smith  <dsmith@redhat.com>
 +
 +      * tapsets.cxx (utrace_builder::build): Make sure that the PATH of
 +      'process("PATH")' probes is an absolute path.
 +      (utrace_derived_probe_group::emit_module_decls): Made calls to
 +      utrace probe handler functions conditional on which types of
 +      utrace probes are going to be output.
 +
 +2008-04-16  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      * tapsets.cxx (task_finder_derived_probe): Add dummy constructor
 +      for old (RHEL4) gcc compatibility.
 +
 +2008-04-16  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 6417: From Srinivasa DS <srinivasa@in.ibm.com>:
 +      * tapsets.cxx (build_blacklist): Extend.
 +
 +2008-04-15  David Smith  <dsmith@redhat.com>
 +
 +      * session.h (struct systemtap_session): Added utrace_derived_probe
 +      group and task_finder_derived_probe_group members.
 +      * elaborate.cxx (systemtap_session::systemtap_session): Added
 +      initialization of utrace_derived_probes and
 +      task_finder_derived_probes.
 +      * tapsets.cxx (struct task_finder_derived_probe_group): New
 +      derived_probe_group to handle task_finder framework.
 +      (struct utrace_derived_probe_group): New derived_probe_group to
 +      handle utrace probes.
 +
 +2008-04-15  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 6405 cont'd.
 +      * Makefile.am (AM_CFLAGS): Remove -Wshadow, as it triggers for
 +      new stapio (modname global vs. dwfl headers).
 +
 +2008-04-15  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 6405
 +      * buildrun.cxx (compile_pass): Add STAPCONF_MODULE_NSECTIONS.
 +
 +2008-04-14  David Smith  <dsmith@redhat.com>
 +
 +      * elaborate.h (struct derived_probe_group): Removed
 +      emit_module_header virtual function.
 +      * translate.cxx (c_unparser::emit_common_header): Removed calls to
 +      emit_module_header function.
 +      * tapsets.cxx (be_derived_probe>): Removed emit_module_header function.
 +      (struct timer_derived_probe_group): Ditto.
 +      (struct profile_derived_probe_group): Ditto.
 +      (struct procfs_derived_probe_group): Ditto.
 +      (struct hrtimer_derived_probe_group): Ditto.
 +      (struct perfmon_derived_probe_group): Ditto.
 +      (dwarf_derived_probe_group::emit_module_decls): Moved kernel check
 +      back from deleted emit_module_header function.
 +      (uprobe_derived_probe_group::emit_module_decls): Ditto.
 +      (mark_derived_probe_group::join_group): Moved marker
 +      kernel check (to a new embedded code section) from deleted
 +      emit_module_header function.
 +
 +2008-04-14  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      * Makefile.am (stapio_*): Become able to link/compile against
 +      bundled elfutils.
 +      * Makefile.in: Regenerated.
 +
 +2008-04-09  Martin Hunt  <hunt@dragon>
 +
 +      * buildrun.cxx (run_pass): Remove unused "-d" option
 +      passed to staprun.
 +
 +      * translate.cxx (emit_symbol_data): When available,
 +      grab symbols from debuginfo instead of /proc/kallsyms.
 +
 +2008-04-11  David Smith  <dsmith@redhat.com>
 +
 +      * elaborate.h (struct derived_probe_group): Added
 +      emit_module_header virtual function.
 +      * translate.cxx (c_unparser::emit_common_header): Calls each probe
 +      group's emit_module_header function.
 +      (translate_pass): Moved inclusion of linux/marker.h to
 +      mark_derived_probe_group::emit_module_header().
 +      * tapsets.cxx (struct be_derived_probe_group): Added empty
 +      emit_module_header function.
 +      (struct timer_derived_probe_group): Ditto.
 +      (struct profile_derived_probe_group): Ditto.
 +      (struct procfs_derived_probe_group): Ditto.
 +      (struct hrtimer_derived_probe_group): Ditto.
 +      (struct perfmon_derived_probe_group): Ditto.
 +      (dwarf_derived_probe_group::emit_module_header): Moved kprobes
 +      kernel check from emit_module_decls() to here.
 +      (uprobe_derived_probe_group::emit_module_header): Moved uprobe
 +      kernel check from emit_module_decls() to here.
 +      (uprobe_derived_probe_group::emit_module_decls): Moved uprobe
 +      kernel check to emit_module_header().
 +      (mark_derived_probe_group::emit_module_header): Moved marker
 +      kernel check from emit_module_decls and translate_pass() to here.
 +      (uprobe_derived_probe_group::emit_module_decls): Moved marker
 +      kernel check to emit_module_header().
 +
 +2008-04-10  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 2949.
 +      * session.h (listing_mode): New field.
 +      * main.cxx (main): Test it.  Enjoy it.
 +      (printscript): Do it.
 +      (usage): Document it.
 +      * stap.1.in, stapex.5.in: Ditto.
 +      * elaborate.cxx (print_error): Disable error messages in listing mode.
 +
 +2008-04-10  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 6393 cont'd.
 +      * Makefile.am: Also copy RadeonHD.am fragment to force
 +      git_version.h regeneration at every make, and also special
 +      tagging for "make dist".  Thanks <ndim>.
 +
 +2008-04-10  Frank Ch. Eigler  <fche@elastic.org>
 +
 +      PR 6393.
 +      * git_version.sh: New file, copied from radeonhd.
 +      * configure.ac: No longer generate $builddir/SNAPSHOT.
 +      * Makefile.am: Generate $builddir/git_version.h.
 +      (EXTRA_DIST): Add git_version.h and git_version.sh.
 +      * main.cxx (version): Print generated GIT_MESSAGE therefrom.
 +      * Makefile.in, configure: Regenerated.
 +
 +2008-04-09  David Smith  <dsmith@redhat.com>
 +
 +      * .gitignore: Added more files to ignore.
  
  2008-04-04  Masami Hiramatsu <mhiramat@redhat.com>
  
diff --cc main.cxx
index 0b7ad5f659c5f55f258246f0843b6c98b6ecc552,f547d13dce39c30f1c25f811260ca5f11bcc29af..7a086a66193dc6ca9a46cf2fbf37f9969b8cb67b
+++ b/main.cxx
@@@ -104,21 -102,17 +105,28 @@@ usage (systemtap_session& s, int exitco
      << "   -c CMD     start the probes, run CMD, and exit when it finishes"
      << endl
      << "   -x PID     sets target() to PID" << endl
 +    << "   -d OBJECT  add unwind/symbol data for OBJECT file";
 +  if (s.unwindsym_modules.size() == 0)
 +    clog << endl;
 +  else
 +    clog << ", in addition to" << endl;
 +  {
 +    vector<string> syms (s.unwindsym_modules.begin(), s.unwindsym_modules.end());
 +    for (unsigned i=0; i<syms.size(); i++)
 +      clog << "              " << syms[i] << endl;
 +  }
 +  clog
      << "   -t         collect probe timing information" << endl
  #ifdef HAVE_LIBSQLITE3
-     << "   -q         generate information on tapset coverage"
+     << "   -q         generate information on tapset coverage" << endl
  #endif /* HAVE_LIBSQLITE3 */
+     << "   --kelf     make do with symbol table from vmlinux" << endl
+     << "   --kmap[=FILE]" << endl
+     << "              make do with symbol table from nm listing" << endl
+     << "   --ignore-vmlinux" << endl
+     << "              for testing, pretend vmlinux can't be found" << endl
+     << "   --ignore-dwarf" << endl
+     << "              for testing, pretend vmlinux and modules lack debug info"
      << endl
      ;
    // -d: dump safety-related external references
@@@ -356,8 -305,21 +367,21 @@@ main (int argc, char * const argv []
  
    while (true)
      {
+       int long_opt;
+ #define LONG_OPT_KELF 1
+ #define LONG_OPT_KMAP 2
+ #define LONG_OPT_IGNORE_VMLINUX 3
+ #define LONG_OPT_IGNORE_DWARF 4
        // NB: also see find_hash(), usage(), switch stmt below, stap.1 man page
-       int grc = getopt (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uqwl:d:");
+       static struct option long_options[] = {
+         { "kelf", 0, &long_opt, LONG_OPT_KELF },
+         { "kmap", 2, &long_opt, LONG_OPT_KMAP },
+         { "ignore-vmlinux", 0, &long_opt, LONG_OPT_IGNORE_VMLINUX },
+         { "ignore-dwarf", 0, &long_opt, LONG_OPT_IGNORE_DWARF },
+         { NULL, 0, NULL, 0 }
+       };
 -      int grc = getopt_long (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uqw",
++      int grc = getopt_long (argc, argv, "hVMvtp:I:e:o:R:r:m:kgPc:x:D:bs:uqwl:d:",
+                                                           long_options, NULL);
        if (grc < 0)
          break;
        switch (grc)
            usage (s, 0);
            break;
  
 +        case 'l':
 +          s.listing_mode = true;
 +          s.last_pass = 2;
 +          if (have_script)
 +            {
 +            cerr << "Only one script can be given on the command line."
 +                 << endl;
 +            usage (s, 1);
 +            }
 +          cmdline_script = string("probe ") + string(optarg) + " {}";
 +          have_script = true;
++
+         case 0:
+           switch (long_opt)
+             {
+             case LONG_OPT_KELF:
+             s.consult_symtab = true;
+             break;
+             case LONG_OPT_KMAP:
+             // Leave s.consult_symtab unset for now, to ease error checking.
+               if (!s.kernel_symtab_path.empty())
+               {
+                 cerr << "You can't specify multiple --kmap options." << endl;
+                 usage(s, 1);
+               }
+               if (optarg)
+                 s.kernel_symtab_path = optarg;
+               else
+ #define PATH_TBD string("__TBD__")
+                 s.kernel_symtab_path = PATH_TBD;
+             break;
+           case LONG_OPT_IGNORE_VMLINUX:
+             s.ignore_vmlinux = true;
+             break;
+           case LONG_OPT_IGNORE_DWARF:
+             s.ignore_dwarf = true;
+             break;
+             default:
+               cerr << "Internal error parsing command arguments." << endl;
+               usage(s, 1);
+             }
            break;
  
          default:
diff --cc session.h
Simple merge
diff --cc stap.1.in
index db64748ff257c3d3ec65ea621c3e6451022d1f10,1b9fe46625b8d4fb90a1cb4d2ff13acd8be608a7..aa32fa52c9092ed69bd3015e74a0b84d0946b261
+++ b/stap.1.in
@@@ -163,10 -154,40 +163,44 @@@ Start the probes, run CMD, and exit whe
  Sets target() to PID. This allows scripts to be written that filter on 
  a specific process.
  .TP
 +.BI \-l " PROBE"
 +Instead of running a probe script, just list all available probe
 +points matching the given pattern.  The pattern may include wildcards
 +and aliases.
+ .B \-\-kelf
+ For names and addresses of functions to probe,
+ consult the symbol tables in the kernel and modules.
+ This can be useful if your kernel and/or modules were compiled
+ without debugging information, or the function you want to probe
+ is in an assembly-language file built without debugging information.
+ See the
+ .B "MAKING DO WITH SYMBOL TABLES"
+ section for more information.
+ .TP
+ .BI \-\-kmap [=FILE]
+ For names and addresses of kernel functions to probe,
+ consult the symbol table in the indicated text file.
+ The default is /boot/System.map-VERSION.
+ The contents of this file should be in the form of the default output from
+ .IR nm (1).
+ Only symbols of type T or t are used.
+ If you specify /proc/kallsyms or some other file in that format,
+ where lines for module symbols contain a fourth column,
+ reading of the symbol table stops with the first module symbol
+ (which should be right after the last kernel symbol).
+ As with
+ .BR \-\-kelf ,
+ the symbol table in each module's .ko file will also be consulted.
+ See the
+ .B "MAKING DO WITH SYMBOL TABLES"
+ section for more information.
+ .TP
+ .B \-\-ignore\-vmlinux
+ For testing, act as though neither the uncompressed kernel (vmlinux)
+ nor the kernel debugging information can be found.
+ .TP
+ .B \-\-ignore\-dwarf
+ For testing, act as though vmlinux and modules lack debugging information.
  
  .SH ARGUMENTS
  
diff --cc tapsets.cxx
index 484bc58c37491ab10ddd86ec2821df87e64c5f8c,47bb20e2411c7fcbb5fa792515d7f581fd1cbd46..d6867e359e17f471fe9cfd1f6f625dc766aac869
@@@ -2771,8 -3031,47 +3056,46 @@@ dwarf_query::add_probe_point(const stri
      }
  }
  
+ enum dbinfo_reqt
+ dwarf_query::assess_dbinfo_reqt()
+ {
+   if (has_absolute)
+     {
+       // kernel.statement(NUM).absolute
+       return dbr_none;
+     }
+   if (has_inline)
+     {
+       // kernel.function("f").inline or module("m").function("f").inline
+       return dbr_need_dwarf;
+     }
+   if (has_function_str && spec_type == function_alone)
+     {
+       // kernel.function("f") or module("m").function("f")
+       return dbr_need_symtab;
+     }
+   if (has_statement_num)
+     {
+       // kernel.statement(NUM) or module("m").statement(NUM)
+       // Technically, all we need is the module offset (or _stext, for
+       // the kernel).  But for that we need either the ELF file or (for
+       // _stext) the symbol table.  In either case, the symbol table
+       // is available, and that allows us to map the NUM (address)
+       // to a function, which is goodness.
+       return dbr_need_symtab;
+     }
+   if (has_function_num)
+     {
+       // kernel.function(NUM) or module("m").function(NUM)
+       // Need the symbol table so we can back up from NUM to the
+       // start of the function.
+       return dbr_need_symtab;
+     }
+   // Symbol table tells us nothing about source files or line numbers.
+   return dbr_need_dwarf;
+ }
  
  
 -
  // The critical determining factor when interpreting a pattern
  // string is, perhaps surprisingly: "presence of a lineno". The
  // presence of a lineno changes the search strategy completely.
@@@ -3810,10 -4141,10 +4165,10 @@@ dwarf_derived_probe::dwarf_derived_prob
                            q.base_loc->tok);
  
    // Make a target-variable-expanded copy of the probe body
-   if (scope_die)
+   if (!null_die(scope_die))
      {
        dwarf_var_expanding_copy_visitor v (q, scope_die, dwfl_addr);
 -      require <block*> (&v, &(this->body), this->body);
 +      require <statement*> (&v, &(this->body), this->body);
  
        // If during target-variable-expanding the probe, we added a new block
        // of code, add it to the start of the probe.
diff --cc translate.cxx
Simple merge
This page took 0.06242 seconds and 5 git commands to generate.