summaryrefslogtreecommitdiffstats
path: root/session.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'origin/dwarfless'Jim Keniston2008-05-121-0/+6
|\ | | | | | | PR 4311 - Function boundary tracing without debuginfo: Phases 1 and 2
| * PR 4311 - Function boundary tracing without debuginfo: Phase IJim Keniston2008-04-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | * 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.
* | 2008-04-15 David Smith <dsmith@redhat.com>David Smith2008-04-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 David Smith <dsmith@redhat.com> PR 5961 (partial) * task_finder.c (stap_start_task_finder): When an interesting thread is found that is already running, make sure to set up thread death notification.
* | PR2949: listings mode (stap -l PROBE)Frank Ch. Eigler2008-04-101-0/+1
|/ | | | | | | | | | | | | | | | 2008-04-10 Frank Ch. Eigler <fche@elastic.org> PR 2949. * session.h (listing_mode): New field. * main.cxx (main): Test it. Enjoy 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 2949 * systemtap.base/cmd_parse.exp: Add "-l" listing test.
* PR5045: clean up after interruptsfche2008-02-281-0/+3
| | | | | | | | | | | 2008-02-28 Frank Ch. Eigler <fche@elastic.org> PR5045 * session.h (pending_interrupts): New global. * main.cxx (handle_interrupts): New fn to handle SIGINT* etc. * elaborate.cxx, translate.cxx, tapsets.cxx, main.cxx (*): Insert pending_interrupts escape hatches inside potentially timetaking loops. * buildrun.cxx: Don't deal with signals.
* PR 5709kenistoj2007-10-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * main.cxx: Add pass 4.5: make uprobes.ko in runtime/uprobes * buildrun.cxx: Add uprobes_enabled() and make_uprobes(). Factor run_make_cmd() out of compile_pass(). * buildrun.h: Add uprobes_enabled and make_uprobes decls. * tapsets.cxx: Do correct #include for modprobed uprobes.ko; set need_uprobes in pass 2. * session.h: Add need_uprobes * runtime/staprun/common.c: Add -u option -> need_uprobes * runtime/staprun/staprun_funcs.c: Generalize insert_module() to support inserting uprobes.ko. * runtime/staprun/staprun.c: Add enable_uprobes(). insert_module call becomes insert_stap_module(). * runtime/staprun/staprun.h: Reflect insert_module() and need_uprobes changes * runtime/uprobes/*.[c,h]: uprobes is built as a module, rather than included into the source of the stap-generated module. * runtime/uprobes/Makefile: Added
* PR1119: unused variable elision warningsfche2007-10-061-1/+2
| | | | | | | | | | | | | | | | | | 2007-10-05 Frank Ch. Eigler <fche@elastic.org> PR 1119 * elaborate.cxx (semantic_pass_opt[12]): Warn on elided variables/functions in user script. * session.h (suppress_warnings): New field. Change "timing" to plain old bool. * main.cxx (main): Configure warnings on by default. * stap.1.in: Document this. PR 1119. * systemtap.base/warnings.*: New test. * futexes.stp, sig_by_proc.stp, small_demos/rwtiming.stp: Fix elision warnings.
* 2007-09-12 Martin Hunt <hunt@redhat.com>hunt2007-09-121-3/+0
| | | | | | | | | | | | | | PR 5019 * elaborate.cxx (visit_hist_op): Remove log histogram param. * translate.cxx (assert_hist_compatible): Ditto. * staptree.cxx (hist_op::print): Ditto. * session.h (statistic_decl): Ditto. * parse.cxx (expect_number): Allow negative numbers. Also validate that input is really numeric. This is used by histograms to get the parameters. (parse_hist_op_or_bare_name): Remove code to get parameter for log histograms.
* 2007-09-10 Martin Hunt <hunt@redhat.com>hunt2007-09-101-0/+2
| | | | | * tapsets.cxx, session.h, elaborate.cxx: Start of procfs interaction support. PR 1154.
* 2007-06-26 William Cohen <wcohen@redhat.com>wcohen2007-06-261-0/+5
| | | | | | | | | | | | | | | | | | | | PR 4529 * coveragedb.cxx: New. * coveragedb.h: New. * Makefile.am: Add coveragedb.cxx and sqlite3 to build. * Makefile.in: Regenerated. * configure.ac: Add test for sqlite3 * configure: Regenerated. * systemtap.spec.in: Add dependencies for sqlite3/sqlite3-devel. * elaborate.h, elaborate.cxx (derived_probe::collect_derivation_chain): New. (alias_expansion_builder::build): Correct token location. (semantic_pass_opt[12): Track used and unused variables/functions. * session.h (tapset_compile_coverage, unused_globals, unused_probes, unused_functions): New fields. * staptree.h (unused_locals, probe_point::str): New member. * staptree.cxx: Ditto. * main.cxx: Add "-q" tapset coverage option and SYSTEMTAP_COVERAGE env.
* 2007-05-25 Frank Ch. Eigler <fche@redhat.com>fche2007-05-261-0/+3
| | | | | | | | | | | | PR 4255 teaser. * elaborate.cxx (has_null_param): New function. * elaborate.h: Declare it. * session.h: Include uprobe_derived_probes group. * tapsets.cxx (uprobe_*): New classes. (all_session_groups): List uprobes in list. (register_standard_tapset): Interpret process(#).statement(#).absolute and process(#).statement(#).absolute.return probe points.
* 2007-03-20 Frank Ch. Eigler <fche@elastic.org>fche2007-03-211-5/+6
| | | | | | | | | | | | | | | | | | | | | | PR 4224. * tapsets.cxx (add_probe_point): Make kernel implicitly relocated relative to the _stext symbol. (dwarf_derived_probe ctor, emit_module_decls): Cooperate. (lookup_symbol_address): New function. (dwarf_builder::build): Call it thrice. (in_kprobes_function): Simplify. * session.h (systemtap_session): Rename cached symbol addresses. * translate.cxx, elaborate.cxx: Corresponding tweaks. 2007-03-20 Frank Ch. Eigler <fche@elastic.org> PR 4224. * sym.c (_stp_module_relocate): Support kernel relocations. 2007-03-20 Frank Ch. Eigler <fche@elastic.org> * symbols.c (_stp_do_symbols): Add cautionary blurb for important setup of _stp_modules[0]->text.
* 2007-02-09 Frank Ch. Eigler <fche@elastic.org>fche2007-02-091-1/+2
| | | | | | | | | | | | | | | | PR 3965 * configure.ac: Add --enable-prologue option. * configure, config.in: Regenerated. * session.h (prologue_searching): New field. * main.cxx (main): Parse new "-P" option. Initialize based on autoconf flag. * stap.1.in, NEWS: Document it. * hash.cxx (find_hash): Include it in computation. * tapsets.cxx (query_func_info, query_cu): Respect it. 2007-02-09 Frank Ch. Eigler <fche@elastic.org> * systemtap.base/prologue.*: New test case.
* 2006-12-19 Frank Ch. Eigler <fche@redhat.com>fche2006-12-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 3522. * tapsets.cxx (dwflpp::emit_address): Call _stp_module_relocate only once per session. Error message cleanup: duplicate elimination etc. * session.h (saved_errors): Store a set of 'em. (num_errors): Return set size. Remove old numeric field. Update all callers. * elaborate.cxx (systemtap_session::print_errors): Print each encountered message just once. * staptree (semantic_error): Make msg2 writeable. Add a chain field. * tapsets.cxx (*var_expanding*:visit_target_symbol): Set saved semantic_error's chain field. * elaborate.cxx (register_library_aliases, visit_foreach_loop, visit_functioncall, derive_probes): Plop "while: ..." error message prefix/suffix right into the semantic_error message string. * parse.cxx (lexer::scan): Identify erroneous token better in error message for unresolvable $N/@M command line args. * util.h (lex_cast_hex): Use std::hex, not std::ios::hex. 2006-12-19 Frank Ch. Eigler <fche@redhat.com> PR 3522. * buildok/twentyfive.stp: New test for static $var access.
* New dynamic module and symbol handling code.hunt2006-11-021-0/+1
|
* 2006-10-31 Frank Ch. Eigler <fche@redhat.com>fche2006-11-011-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Probe registration rework. Offline dwarf processing for better cross-instrumentation. * elaborate.h (derived_probe): Remove registration-related code generation API. Add new function sole_location(). (derived_probe_group): Reworked this and associated classes. * session.h (systemntap_session): Create individual per-category derived_probe_groups. * elaborate.cxx (derived_probe_group): Reworked. (alias_derived_probe): Switch to new derived_probe API. (semantic_pass_symbols): Ditto. * translate.cxx (mapvar init): Check for array initialization error. (emit_module_init): Handle such failures, at least in theory. (emit_module_exit): Switch to new derived_probe_group API. Call cpu_relax() during shutdown busywait. (emit_common_header): Elide context variables for elided handler fns. (c_unparser::emit_probe): Implement new, improved duplicate elimination technique for probe handlers. Leave two older ones behind as compile options for education. * tapsets.cxx (*): Reworked all probe registration code, moving it from derived_probes into derived_probe_groups. Shrunk output code. Temporarily disabled probe timing and perfmon/mark probes. (dwflpp): Use offline reporting, so that module matching and relocation is performed at run time. (dwarf_query): Remove flavour logic, now supplanted by other duplicate elimination code. (dwarf_derived_probe): Reworked construction, centralized module/section/offset computations. * tapsets.h (all_session_groups): New little helper. * main.cxx (main): For pass-2 message, print number of embeds too. * systemtap.spec.in: Add a "BuildRequires: dejagnu" for make check. * configure.ac: Bump version to 0.5.11. * configure: Regenerated.
* 2006-10-23 David Smith <dsmith@redhat.com>dsmith2006-10-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * main.cxx (printscript): New function containing code moved from main(). (main): Added code to create cache directory, call function to generate hash, and see if we can use cached source/module. If pass 4 is actually run to produce a new module, we call add_to_cache() to cache the result. * session.h (struct systemtap_session): Added hash/cache session data. * cache.cxx: New file handling adding/getting files from the cache. * cache.h: New header file for cache.cxx. * hash.cxx: New file containing C++ wrapper for routines in mdfour.c and the find_hash function which computes the hash file name for an input script. * hash.h: New header file for hash.cxx. * mdfour.c: New file containing MD4 hash code. * mdfour.h: New header file for mdfour.c. * util.cxx: New file containing several utility functions used by the caching code. * util.h: New header file for util.cxx. * Makefile.am: Added new C/C++ files. * Makefile.in: Regenerated.
* 2006-10-11 David Smith <dsmith@redhat.com>dsmith2006-10-111-0/+9
| | | | | | | | | | | | | | * tapsets.cxx (in_kprobes_function): New function that looks up the values of '__kprobes_text_start' and '__kprobes_text_end' in the kernel to be able to automatically exclude functions marked as '__kprobes' (BZ# 2639). (blacklisted_p): Calls in_kprobes_function(). (query_kernel_module): Utility function that finds the kernel module. * session.h (struct systemtap_session): Added kprobes_text variables - kprobes_text_initialized, kprobes_text_start, and kprobes_text_end. * elaborate.cxx (systemtap_session::systemtap_session): kprobes_text variables get initialized.
* 2006-09-27 Josh Stone <joshua.i.stone@intel.com>jistone2006-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * session.h (struct systemtap_session): Add kernel_base_release to store the kernel version without the -NNN suffix. * main.cxx (main): Generate and use kernel_base_release. * parse.cxx (eval_pp_conditional): Use kernel_base_release. * tapsets.cxx (profile_derived_probe::profile_derived_probe): Use kernel_base_release. * tapsets.cxx (timer_builder::build): Support a wide variety of timer varients -- jiffies, s/sec, ms/msec, us/usec, ns/nsec, and hz. Use hrtimers automatically on kernels that have it. (timer_builder::register_patterns): Bind all of the new timer varients in one easy place. (register_standard_tapsets): Call timer_builder::register_patterns. (struct hrtimer_builder): Removed since timer_builder is generic. * stapprobes.5.in: Document new timer.* functionality. * tapsets.cxx (hrtimer_derived_probe_group::emit_probes): Add a shared global for the actual hrtimer resolution, _stp_hrtimer_res. (hrtimer_derived_probe_group::emit_module): Init _stp_hrtimer_res. (hrtimer_derived_probe::emit_interval): Limit intervals at a minimum to the hrtimer's actual resolution. (hrtimer_derived_probe::emit_probe_entries): Forward timers based on previous expiration instead of restarting relative. testsuite/ * buildok/fourteen.stp: Test new timer functionality.
* Systemtap perfmon support to access the processors perfmon hardware.wcohen2006-09-121-0/+1
|
* 2006-08-28 David Smith <dsmith@redhat.com>dsmith2006-08-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * translate.cxx: Added inclusion of session.h. (translate_pass): Instead of asking each probe to emit itself, we ask the session's probes member variable to emit all the probes. * tapsets.cxx: Added inclusion of session.h. Added a register_probe member function to all derived_probe based classes. Added a derived_probe_group derived class for all probe types: (be_derived_probe_group): New class. (never_derived_probe_group): New class. (dwarf_derived_probe_group): New class. (timer_derived_probe_group): New class. (profile_derived_probe_group): New class. (mark_derived_probe_group): New class. (hrtimer_derived_probe_group): New class (derived_probe_group_container): New class. * elaborate.h: Removed inclusion of session.h since session.h now includes elaborate.h. (derived_probe): Added register_probe member function. (derived_probe_group): Added class definition. This is the base class of all of the derived probe groups - dwarf, timer, etc. (derived_probe_group_container): Added class definition. An instance of this class will be stored in the session and contain all the other probe groups. * elaborate.cxx (derived_probe_group::register_probe): Added derived_probe_group::register_probe stubs. (alias_derived_probe::register_probe): Added register_probe member function. (semantic_pass_symbols): After deriving a probe, the probes now register themselves with the session. * session.h: Includes elaborate.h to get derived_probe_group_container definition. systemtap_session class 'probes' member variable switched from a vector of derived probes to a derived_probe_group_container. * buildrun.cxx: Added inclusion of session.h since it was removed from elaborate.h. * main.cxx: Added inclusion of session.h since it was removed from elaborate.h. * parse.h: Added forward struct declarations. * staptree.h: Removed inclusion of session.h.
* -M option to control to do merge or not for bulk modeguanglei2006-05-091-0/+1
|
* "-t" option to collect information the number of times a probe runs andwcohen2006-05-021-0/+1
| | | | the average amount of time spent in the probe.
* 2006-01-27 Frank Ch. Eigler <fche@elastic.org>fche2006-01-281-1/+1
| | | | | | | | * main.cxx: Make "-v" (verbose) flag a counter. * stap.1.in: Document this. * session.h: Corresponding changes. * {elaborate,buildrun,tapsets,translate}.cxx: Update all uses of verbose flag to compare it to sensible level for value of message.
* 2006-01-24 Frank Ch. Eigler <fche@elastic.org>fche2006-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 2060 etc. * tapsets.cxx (visit_target_symbol): Tolerate failed resolution by letting target_symbol instance pass through to optimizer and type checker. * elaborate.cxx (semantic_pass_optimize): New family of functions and associated visitor classes. (visit_for_loop): Tolerate absent init/incr clauses. (semantic_pass): Invoke unless unoptimized (-u) option given. * main.cxx, session.h: Add support for flag. * staptree.cxx (visit_for_loop): Tolerate absent init/incr clauses. (traversing_visitor::visit_arrayindex): Visit the index expressions. (functioncall_traversing_visitor): New class. (varuse_tracking_visitor): New class. * staptree.h: Corresponding changes. * parse.cxx (parse_for_loop): Represent absent init/incr expressions with null statement pointer instead of optimized-out dummy numbers. * stap.1.in: Document optimization. * testsuite/{semko,transko}/*.stp: Added "-u" or other code to many tests to check bad code without optimizer elision. * testsuite/semok/optimize.stp: New test. * elaborate.cxx (unresolved, invalid, mismatch): Standardize error message wording. * stapfuncs.5.in: Tweak print/printf docs. * tapset/logging.stp: Remove redundant "print" auxiliary function, since it's a translator built-in. * testsuite/transok/five.stp: Extend test. * translate.cxx (emit_symbol_data): Put symbol table into a separate temporary header file, to make "-p3" output easier on the eyes. * buildrun.cxx (compile_pass): Eliminate test-mode support throughout. * main.cxx, session.h, translate.cxx: Ditto. * main.cxx (main): For last-pass=2 runs, print post-optimization ASTs.
* 2005-11-24 Frank Ch. Eigler <fche@redhat.com>fche2005-11-241-0/+1
| | | | | | | | | PR 1903 * parse.cxx (eval_pp_conditional): Support %( arch == "i686" %) form. * stap.1.in: Document it. * testsuite/parseok/fourteen.stp: Test it. * session.h (architecture): New field. * main.cxx (main): Initialize it.
* 2005-11-23 Graydon Hoare <graydon@redhat.com>graydon2005-11-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elaborate.h (get_symbol_within_expression): Make visible. * elaborate.cxx (get_symbol_within_expression): Make non-static. (stat_decl_collector): New struct. (semantic_pass_stats): New semantic pass. (semantic_pass): Call it. (semantic_pass_symbols): Remove collection of statistic_decls from files. (visit_stat_op): Only fail if inferred type is not pe_long. * parse.cxx (parser::parse): Don't pass per-file statistic_decl into parse_global. (parser::parse_global): Don't parse global statistic_decls, they're obsolete. * parse.hh (parser::parse_global): Adjust signature to match. * session.h (statistic_decl::operator==): New method. * staptree.h (print_format::is_empty): New method. (stapfile::stat_decls): Remove field. * staptree.cxx (string_to_components): Fix bugs in format-string parser. * translate.cxx (var): Make private fields protected. (var::init): Support HIST_NONE stats. (aggvar): New struct. (mapvar::is_parallel): New method. (mapvar::call_prefix): Use it. (mapvar::calculate_aggregate): New method. (mapvar::fetch_existing_aggregate): New method. (mapvar::get): Support pe_stats. (mapvar::init): Use is_parallel(), and support HIST_NONE. (itervar::itervar): Only fault on pe_unknown. (itervar::start): Use mapvar::is_parallel and mapvar::fetch_existing_aggregate. (emit_map_type_instantiations): Include alloc.c before pmap-gen.c. Include pmap-gen.c for pe_stats maps. (c_unparser::gensym_aggregate): New method. (c_unparser::visit_foreach_loop): Handle mapvar::is_parallel case. (arrayindex_downcaster): New struct. (expression_is_arrayindex): New function. (c_tmpcounter::visit_stat_op): New method. (c_unparser::visit_stat_op): Implement. (c_unparser::visit_hist_op): Add commentary, still not implemented. * testsuite/buildok/stat_{insert,extract}.stp: New tests. * testsuite/semok/ten.stp: Correct for changes to global declarations. * testsuite/semko/*.stp: Likewise.
* 2005-11-01 Frank Ch. Eigler <fche@elastic.org>fche2005-11-011-0/+104
PR 1425. * configure.ac: Look for rpm-devel headers and libs. * configure: Regenerated. * session.h: New file to contain systemtap_session decl. * staptree.h: Likewise evict statistics_decl. * elaborate.h: Corresponding changes. * main.cxx (usage): Elaborate. Re-enable "-r RELEASE" option. * parse.cxx (parser): Add systemtap_session& field. Update users. (scan_pp, eval_pp_conditional): New routines for preprocessing. (peek, next): Call it. (lexer::scan): Lex the preprocessor operators. (parser::parse): Include an extra level of exception catching for parse errors that occur during recovery. * parse.h: Corresponding changes. (parse_error): Allow explicit token parameter. * stap.1.in: Document preprocessing. * testsuite/parseok/fourteen.stp: New test.