summaryrefslogtreecommitdiffstats
path: root/elaborate.h
Commit message (Collapse)AuthorAgeFilesLines
* PR11004: try / catch error-handling script syntaxFrank Ch. Eigler2010-03-031-0/+1
| | | | | | | | | | | | | | | * parse.h (try_block): New class. Update basic visitors. * staptree.cxx: Implement basic visitors. * parse.cxx (expect_kw): Fix to actually look for keywords. (parse_try_block): New function. (lexer ctor): Designate 'try' and 'catch' as keywords. * elaborate.cxx (dead_assignment_remover, dead_statmtexpr_remover): Optimize. (other visitors): Implement. * translate.cxx (c_unparser): Implement via super-handy __local__ labels. (emit_probe, emit_function): Make outer out: label also __local__. * testsuite/buildok/fortyone.stp, semko/fortynine.stp, systemtap.base/trycatch.exp: Test it. * NEWS, doc/langref.txt, stap.1.in: Document it.
* PR11005: @defined($tvar) predicate, part 1Frank Ch. Eigler2010-02-231-0/+1
| | | | | | | | | | | | | | | | | | * staptree.h (defined_op): New class. * all files: Extend all visitors as appropriate, mostly dummy/pass-through implementation. * parse.cxx (parse_target_symbol): New function, factored out of parse_symbol(). (parse_define_op): New function. * NEWS: Mention it. * parse.h: Corresponding changes. * tapsets.cxx (var_expanding_visitor::visit_defined_op): Implement @defined() semantics. (dwarf_var_expanding_visitor::visit_target_symbol): Adjust. * tapset-utrace.c (visit_target_symbol_arg): Avoid crashes on $argZZZ. * tapsets.cxx (sdt_var_expanding_visitor): Ditto. * semok/thirtysix.stp: New test.
* Rework identification of probes allowed for unprivileged users.Dave Brolley2010-02-151-3/+5
| | | | | | | - Bind unprivileged permission at probe registration time. - Remove check_unprivileged filter from derived_probe_builder and its children. - Add test suites for unprivilegedok and unprivilegedko.
* rhbz 560890: preserve -L/-l variable orderingNobuhiro Tachino2010-02-021-1/+2
| | | | | | Switch to list<string> from set<string> for collecting available $var lists. Use O(N**2) list-uniqueifier that preserves initial ordering.
* PR10466: print the set-intersection of variables retrieved from each branchWenji Huang2009-11-041-2/+2
| | | | | | | * elaborate.h: Remove printargs and add getargs. * tapset-mark.cxx (mark_derived_probe): Ditto. * tapsets.cxx (dwarf_derived_probe,tracepoint_derived_probe): Ditto. * main.cxx (printscript): Make intersection before printing.
* PR10799: warn on possibly uintended local-vs-global namespace collisionFrank Ch. Eigler2009-10-191-1/+1
| | | | | | | | | * elaborate.cxx (find_var): Take extra token parameter. Look for cross-file global variable resolution, signal a warning. * testsuite/systemtap.examples/io/traceio2.stp: Fix it. * testsuite/systemtap.syscall/sys.stp: Fix it. * NEWS: Document it.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-10-131-0/+7
|\
| * Remove the global derived_probe->semaphore mapJosh Stone2009-10-061-0/+7
| | | | | | | | | | | | | | | | | | | | Instead just make the semaphore address a member of derived_probe. * session.h (systemtap_session): Remove the map sdt_semaphore_addr. * elaborate.h (derived_probe): Add sdt_semaphore_addr directly. * tapsets.cxx (sdt_query::record_semaphore): Write the addr directly. (uprobe_derived_probe_group::emit_module_decls): Read it directly. * tapset-utrace.cxx (utrace_derived_probe_group::emit_probe_decl): Ditto
* | Ensure that unprivileged-authorized probe point functions are hashed differentlyDave Brolley2009-10-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than non-authorized ones for the purpose of removing duplicates. 2009-10-13 Dave Brolley <brolley@redhat.com> * elaborate.h (print_dupe_stamp_unprivileged): New static method of derived_probe. (print_dupe_stamp_unprivileged_process_owner): Likewise. * elaborate.cxx (print_dupe_stamp_unprivileged): New static method of derived_probe. (print_dupe_stamp_unprivileged_process_owner): Likewise. * tapset-been.cxx (print_dupe_stamp): New virtual method of be_derived_p robe and never_derived_probe. * tapset-utrace.cxx (print_dupe_stamp): New virtual method of utrace_der ived_probe * tapset-itrace.cxx (itrace_derived_probe::emit_unprivileged_assertion): Removed. (itrace_builder::check_unprivileged): Removed. * tapsets.cxx (print_dupe_stamp): New virtual method of uprobe_derived_p robe
* | Generate safety net assertions in probe function not authorized for ↵Dave Brolley2009-10-091-4/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unprivileged users. 2009-10-08 Dave Brolley <brolley@redhat.com> * elaborate.h (emit_unprivileged_assertion): New virtual method of deriv ed_probe. (emit_process_owner_assertion): New static method of derived_probe. (check_unprivileged): New virtual method of derived_probe_builder. (match_node::unprivileged_ok): Removed. (match_node::allow_unprivileged): Removed. (match_node::unprivileged_allowed): Removed. * elaborate.cxx (translate.h): #include it. (emit_unprivileged_assertion): New virtual method of derived_probe. (emit_process_owner_assertion): New static method of derived_probe. (check_unprivileged): New virtual method of derived_probe_builder. (match_node::unprivileged_ok): Removed. (match_node::allow_unprivileged): Removed. (match_node::unprivileged_allowed): Removed. (find_and_build): Don't check for unprivileged restrictions here. Call t he builder's check_unprivileged method. (alias_expansion_builder::check_unprivileged): New virtual method. * tapset-been.cxx (be_derived_probe::emit_unprivileged_assertion): New v irtual method. (be_builder::check_unprivileged): Likewise. (never_derived_probe::emit_unprivileged_assertion): Likewise. (never_builder::check_unprivileged): Likewise. (register_tapset_been): Don't call allow_unprivileged. * tapset-itrace.cxx (itrace_derived_probe::emit_unprivileged_assertion): New virtual method. (itrace_builder::check_unprivileged): Likewise. (register_tapset_itrace): Don't call allow_unprivileged. * tapset-utrace.cxx (utrace_derived_probe::emit_unprivileged_assertion): New virtual method. (utrace_builder::check_unprivileged): Likewise. (register_tapset_utrace): Don't call allow_unprivileged. * tapset-timer.cxx (timer_derived_probe::emit_unprivileged_assertion): N ew virtual method. (timer_builder::check_unprivileged): Likewise. (register_tapset_timers): Don't call allow_unprivileged. * tapsets.cxx (uprobe_derived_probe::emit_unprivileged_assertion): New v irtual method. (uprobe_builder::check_unprivileged): Likewise. (register_standard_tapsets): Don't call allow_unprivileged. (register_statement_variants): Remove unprivileged_ok_p parameter. Don't call allow_unprivileged. (register_function_variants): Likewise. (register_function_and_statement_variants): Likewise. (register_patterns): Don't call allow_unprivileged. * translate.cxx (emit_probe): Call v->emit_unprivileged_assertion.
* PR10495: allow multiple probe aliases with same nameFrank Ch. Eigler2009-08-181-1/+1
| | | | | | | | * elaborate.cxx (match_node::bind): Change ->end to ->ends[] vector. (find_and_build,build_no_more): Iterate over ends[]. * elaborate.h: Corresponding changes. * testsuite/semok/thirtyfour.stp: New test. * NEWS, doc/langref.tex: Note this.
* 2009-04-22 Dave Brolley <brolley@redhat.com>Dave Brolley2009-04-221-2/+4
| | | | | | | | | | | | | | | | | | | * elaborate.h (unprivileged_whitelist): Removed. (unprivileged_ok): New member of match_node. (allow_unprivileged,unprivileged_allowed): New methods of match_node. * elaborate.cxx (match_node): Initialize unprivileged_ok. Remove initialization of unprivileged_whitelist. (allow_unprivileged,unprivileged_allowed): New methods of match_node. (matchnode::find_and_build): Remove check of unprivileged_whitelist. Call unprivileged_allowed. * tapsets.cxx (dwarf_derived_probe::register_function_and_statement_variants): New parameter: unprivileged_ok. (dwarf_derived_probe::register_function_variants): Likewise. (dwarf_derived_probe::register_statement_variants): Likeiwse. (register_standard_tapsets): Call allow_unprivileged for nodes which are safe for unprivileged users.
* 2009-04-20 Dave Brolley <brolley@redhat.com>Dave Brolley2009-04-201-0/+2
| | | | | | | | | | * main.cxx (main): Turn of guru_mode if --unprivileged is specified and vice-versa. * elaborate.h (unprivileged_whitelist): New member of match_node. * elaborate.cxx (match_node::match_node): Initialize unprivileged_whitelist. (match_node::find_and_build): In --unprivileged mode, throw a semantic_error for probe components which are not in uinprivileged_whitelist.
* PR10026: Read marker/tracepoint args directlyJosh Stone2009-04-061-0/+5
| | | | | | | | | | We already stash the context variables for markers and tracepoints into the locals for the probe body, but then we were using separate functions to read those locals for each particular probe body. This patch instead teaches the unparser how to emit the local name directly for those context variables. The resulting code from the translator is much simpler now.
* Make tracepoint probe support listing mode -LWenji Huang2009-03-101-0/+2
| | | | | | | | | | | | | | This patch is to enable displaying arguments of tracepoint probe in listing mode -L. The example output is like $stap -L 'kernel.trace("block_bio*")' kernel.trace("block_bio_bounce") $q:struct request_queue* $bio:struct bio* kernel.trace("block_bio_backmerge") $q:struct request_queue* $bio:struct bio* kernel.trace("block_bio_complete") $q:struct request_queue* $bio:struct bio* kernel.trace("block_bio_queue") $q:struct request_queue* $bio:struct bio* kernel.trace("block_bio_frontmerge") $q:struct request_queue* $bio:struct bio* Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
* BZ 9719: Improve type mismatch messagesRajan Arora2009-02-181-0/+2
|
* Bump copyright years to 2009Josh Stone2009-02-181-1/+1
|
* Add high-level support for @cast()ingJosh Stone2009-02-181-0/+1
| | | | | | | | | | | | | | | | | | This handles all of the parsing, traversal, and optimization. It doesn't actually resolve the cast yet though. * staptree.h (struct cast_op, visitor::visit_cast_op): New. * staptree.cxx (cast_op::print/visit, various visitor::visit_cast_op's): Incorporate cast_op into the basic tree operations. * parse.cxx (parser::parse_symbol): Parse @cast operator with an expression operand, type string, and optional module string. * translate.cxx (c_unparser::visit_cast_op): Error out if a @cast survives to translation. * elaborate.cxx (typeresolution_info::visit_cast_op): Error out if a @cast survives to type resolution. (symbol_fetcher::visit_cast_op): treat @casts as a symbol target (void_statement_reducer::visit_cast_op): unused @casts can be discarded, but the operand should still be evaluated.
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+2
|
* trailing whitespace removal, as approved by emacsFrank Ch. Eigler2008-08-281-2/+2
| | | | (add-hook 'before-save-hook 'delete-trailing-whitespace)
* PR442528Frank Ch. Eigler2008-07-181-0/+4
|
* PR 2608 plus some refactoring in tapsets.cxxTim Moore2008-06-111-5/+8
| | | | | New dwarf_wrappers.h, dwarf_wrappers.cxx for for idiomatic access to libdwarf and refactoring somethings out of the giant classes in tapsets.cxx.
* 2008-04-14 David Smith <dsmith@redhat.com>David Smith2008-04-141-6/+0
| | | | | | | | | | | | | | | | | | | * 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-11 David Smith <dsmith@redhat.com>David Smith2008-04-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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().
* PR2949: listings mode (stap -l PROBE)Frank Ch. Eigler2008-04-101-0/+2
| | | | | | | | | | | | | | | | 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.
* 2008-02-21 Dave Brolley <brolley@redhat.com>brolley2008-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | PR5189 * staptree.h (print_format::conv_memory): New enumerator. (print_format::width_type): New enumeration. (print_format::precision_type): New enumeration. (format_component::widthtype): New member. (format_component::prectype): New member. (format_component::is_empty): Test widthtype and prectype. (format_component::clear): Clear widthtype and prectype. * staptree.cxx (print_format::components_to_string): Handle dynamic width and precision. Handle conv_memory. (print_format::string_to_components): Parse dynamic width and precision specifiers. Set widthtype and prectype. Parse %m format specifier. * elaborate.h (typeresolution_info::check_arg_type): New method. * elaborate.cxx (typeresolution_info::visit_print_format): Account for dynamic width and precision when computing the expected number of arguments. Check the types of arguments for dynamic width and precision. Use check_arg_type to check the types of all arguments. Handle print_format::conv_memory. (typeresolution_info::check_arg_type): New method. * NEWS: Describe the enhancements above.
* 2008-02-13 Dave Brolley <brolley@redhat.com>brolley2008-02-131-1/+1
| | | | | | | | | | | | | | | | | PR5609 * staptree.h (probe::collect_derivation_chain): Now takes vector<probe*>. (probe::get_alias): New virtual method. * elaborate.h (derived_probe::collect_derivation_chain): Now takes vector<probe*>. * staptree.cxx (probe::collect_derivation_chain): Now takes vector<probe*>. Don't cast 'this' to (derived_probe*). * elaborate.cxx (derived_probe::collect_derivation_chain): Now takes vector<probe*>. (alias_derived_probe::get_alias): New virtual method. (alias_derived_probe::alias): New member. (alias_expansion_builder::build): Call checkForRecursiveExpansion and emit a diagnostic if recursion is detected. Pass alias to constructor of alias_derived_probe. (alias_expansion_builder::checkForRecursiveExpansion): New method. * coveragedb.cxx: Pass vector<probe*> on all calls to collect_derivation_chain.
* update copyright years for recent checkinsfche2008-01-281-1/+1
|
* PR 4936: probe pont conditions part 2; reorg in prep for full rewritingfche2008-01-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-01-17 Frank Ch. Eigler <fche@elastic.org> PR 4935. Reorganize probe condition implementation. * elaborate.cxx (add_condition): New function. (derived_probe): Remove condition member. (derived_probe ctors): Assert non-null incoming probe/location ptrs. (insert_condition_statement): Remove; turn into ... (semantic_pass_conditions): New pass-2 subpass. (semantic_pass_symbols, visit_symbol, visit_functioncall, find_var): Detect some condition-related error cases. (match_key): Change type to exp_type from tok_type. Update callers. (alias_expansion_builder): Propagate probe conditions. * staptree.cxx (probe): Remove condition field and related functions. * tapsets.cxx (dwarf_derived_probe ctor): Compute replacement wildcard-expanded probe_point preserving more of the original location. (mark_derived_probe ctor): Make similar to others - take location rather than condition parameters. * translate.cxx (emit_common_header): Tweak ordering of tmpcounter traversal and hashkey expression generation. * elaborate.h: Corresponding changes. 2008-01-17 Frank Ch. Eigler <fche@elastic.org> PR 4935. * semko/forty.stp, fortyone.stp, fortytwo.stp: New tests. * semok/twentynine.stp: Weaken test since condition expressions have become more tightly constrained.
* 2007-11-20 Masami Hiramatsu <mhiramat@redhat.com>hiramatu2007-11-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | PR 4935. * parse.cxx (parser::parse_probe_point): Parse "if" condition following probe point. * staptree.h (probe_point): Add "condition" field. (probe): Add "condition" field and "add_condition" method. (deep_copy_visitor): Add "deep_copy" method for the expression. * staptree.cxx (probe_point::probe_point): Initalize it. (probe::add_condition): Implement it. (probe::print): Output "condition" field. (probe::str): Ditto. (deep_copy_visitor::deep_copy): Implement it. * elaborate.h (derived_probe): Add "insert_condition_statement" method. * elaborate.cxx (derived_probe::derived_probe): Initialize "condition" field, and insert a condition check routine on the top of body. (derived_probe::insert_condition_statement): Implement it. (alias_expansion_builder::build): Pass the condition from the alias referer to new alias. * tapsets.cxx (be_derived_probe): Remove unused constructor. (dwarf_derived_probe::dwarf_derived_probe): Insert a condition check routine on the top of body. (mark_derived_probe::mark_derived_probe): Ditto. (mark_builder::build): Pass the base location to mark_derived_probe.
* 2007-06-26 William Cohen <wcohen@redhat.com>wcohen2007-06-261-0/+1
| | | | | | | | | | | | | | | | | | | | 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/+2
| | | | | | | | | | | | 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-05-21 David Smith <dsmith@redhat.com>dsmith2007-05-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 4446. * elaborate.h (derived_probe::initialize_probe_context_vars): New virtual function that will allow added context vars to be initialized. * translate.cxx (c_unparser::emit_common_header): Added 'mark_va_list'. (c_unparser::emit_probe): Calls new function initialize_probe_context_vars. (translate_pass): Includes linux/marker.h if CONFIG_MARKERS is defined. * tapsets.cxx (struct dwarf_query): Split into base_query (which contains most of the original code) and a much smaller dwarf_query class. (struct base_query): New class. (dwarf_query::handle_query_module): New function. (query_module): Moved code into dwarf_query::handle_query_module(). (mark_derived_probe): Adjusted for new kernel markers. (mark_derived_probe_group): Ditto. (mark_var_expanding_copy_visitor): Ditto. (mark_var_expanding_copy_visitor::visit_target_symbol): Generates code for new kernel markers. (struct mark_query): New class. (mark_query::handle_query_module): New function. (mark_derived_probe::mark_derived_probe): Adjusted for new kernel markers. (mark_derived_probe::join_group): Ditto. (mark_derived_probe::emit_probe_context_vars): Ditto. (mark_derived_probe::parse_probe_sig): New function. (mark_derived_probe::initialize_probe_context_vars): New function. (mark_derived_probe::emit_module_decls): Adjust for new kernel markers. (mark_derived_probe::emit_module_init): Ditto. (mark_derived_probe::emit_module_exit): Ditto. (struct mark_builder): Ditto. (mark_builder::build): Ditto.
* 2007-03-30 Frank Ch. Eigler <fche@redhat.com>fche2007-03-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR 1570 * NEWS: Document probe handler language change re. inline functions. * stapprobes.5.in: Likewise. * tapsets.cxx: Many changes to simplify caches and implement new handling of inline functions, removed of stubs for future probes. * elaborate.cxx (derived_probe printsig_nested): New function. * elaborate.h: Declare it. * main.cxx (usage): Clarify "-r" meaning. (main): Tweak related "-p 4" message. 2007-03-30 Frank Ch. Eigler <fche@elastic.org> PR 1570. * memory.stp, scheduler.stp, signal.stp, LKET/signal.stp: Adapt to .inline -> .function change. 2007-03-30 Frank Ch. Eigler <fche@elastic.org> PR 1570 * */*.stp: Adapt to .inline -> .function change. * lib/stap_run.exp, stap_run2.exp, stap_run_binary.exp: Shorten pass/fail dejagnu log lines. * systemtap.syscall/sys.stp, test.tcl: Make slightly more compatible and failure more verbose.
* 2007-03-28 David Smith <dsmith@redhat.com>dsmith2007-03-281-0/+3
| | | | | | | | | | | | | | | | | | | | PR 2341 (partial fix) * elaborate.h (struct derived_probe): Added needs_global_locks() member function. Unless overridden, will return true indicating that this probe needs locks around global variable references. * tapsets.cxx (struct be_derived_probe): Added override of default needs_global_locks() returning false. begin/end probes don't need locks around global variables, since they aren't run concurrently with any other probes. * translate.cxx (c_unparser::emit_common_header): Updated probe_contents logic to match the logic in emit_probe. (c_unparser::emit_probe): Added whether the probe needs global variable locks to the probe string (that helps eliminate duplicate probes). The generated C changes based on whether or not global variable locks are needed, but the pass 2 output doesn't differ between a probe that needs global variable locks and one that doesn't. If the probe doesn't need global variable locks, doesn't output them.
* 2007-02-25 Frank Ch. Eigler <fche@redhat.com>fche2007-02-251-1/+3
| | | | | | | | * elaborate.h (match_node, derived_probe_builder): Add build_no_more member function. * elaborate.cxx (semantic_pass_symbols): Call it. * tapsets.cxx (dwarf_builder): Implement it by releasing dwflpp instance after pass 2, freeing mucho memory.
* 2007-02-19 Frank Ch. Eigler <fche@elastic.org>fche2007-02-191-1/+1
| | | | | | | | | PR 4078 and more, including patch from Eugeniy Meshcheryakov <eugen@debian.org>: * Makefile.am (AM_CXXFLAGS, AM_CFLAGS): Add -Wextra -Wall -Werror consistently. * Makefile.in: Regenerated. (*): Many minor warning fixes.
* 2006-10-31 Frank Ch. Eigler <fche@redhat.com>fche2006-11-011-83/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Systemtap perfmon support to access the processors perfmon hardware.wcohen2006-09-121-0/+4
|
* 2006-09-08 David Smith <dsmith@redhat.com>dsmith2006-09-081-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elaborate.h (struct derived_probe): Replace emit_registrations() function with emit_registrations_start() and emit_registrations_end(). (struct derived_probe_group): Added emit_module_init(). (struct derived_probe_group_container): Added emit_module_init(), emit_module_init_call(), and emit_module_exit(). * elaborate.cxx (struct alias_derived_probe): Updated emit_regitrations calls. * translate.cxx (emit_module_init): Instead of actually emitting per-probe-point registrations/unregistrations, let the session's derived_probe_group_container do it. * tapsets.cxx (emit_probe_timing): New function that handles probe timing code. (be_derived_probe::emit_registrations_start): Renamed from emit_registrations. (be_derived_probe_group::emit_module_init): New function that outputs probes create and destroy functions. (dwarf_derived_probe::emit_registrations): Removed, but most code moved to emit_registrations_start(). (dwarf_derived_probe::emit_registrations_start): Handles details of multiple dwarf probe registrations. (dwarf_derived_probe::emit_registrations_end): Handles cleanup details of multiple dwarf probe registrations. (dwarf_derived_probe_group::emit_module_init): New function that outputs probes create and destroy functions. (timer_derived_probe::emit_registrations_start): Renamed from emit_registrations. Added mutiple probe handling. (timer_derived_probe::emit_registrations_end): Handles cleanup details of multiple probe registrations. (timer_derived_probe_group::emit_module_init): New function that outputs probes create and destroy functions. (profile_derived_probe::emit_registrations_start): Renamed from emit_registrations. Added mutiple probe handling. (profile_derived_probe::emit_registrations_end): Handles cleanup details of multiple probe registrations. (profile_derived_probe_group::emit_module_init): New function that outputs probes create and destroy functions. (mark_derived_probe::emit_registrations_start): Renamed from emit_registrations. Added mutiple probe handling. (mark_derived_probe::emit_registrations_end): Handles cleanup details of multiple probe registrations. (mark_derived_probe_group::emit_module_init): New function that outputs probes create and destroy functions. (hrtimer_derived_probe::emit_registrations_start): Renamed from emit_registrations. Added mutiple probe handling. (hrtimer_derived_probe::emit_registrations_end): Dummy function. (hrtimer_derived_probe_group::emit_module_init): New function that outputs probes create and destroy functions. (derived_probe_group_container::emit_module_init): Added function to call all probe group's emit_module_int functions. (derived_probe_group_container::emit_module_init_call): Added function to handle probe group initialization cleanup. (derived_probe_group_container::emit_module_exit): Added function to handle probe group cleanup.
* 2006-08-28 David Smith <dsmith@redhat.com>dsmith2006-08-281-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2006-06-02 Frank Ch. Eigler <fche@elastic.org>fche2006-06-021-1/+1
| | | | | | | | | | | PR 2645 cont'd. * elaborate.cxx (find_and_build): Support optional wildcards too. (derive_probes): Change last argument to indicate optionalness of parent probe point (alias reference). (alias_expansion_builder): Shrink epilogue-mode alias body copying. Pass along alias reference optionality. * elaborate.h: Corresponding changes. * testsuite/semko/thirtyfive.stp, semok/twentytwo.stp: New tests.
* 2006-05-24 Frank Ch. Eigler <fche@elastic.org>fche2006-05-251-0/+4
| | | | | | | | | Pass 4 speedup. * tapsets.cxx (derived_probe::emit_common_header): New function, to emit code formerly inlined by emit_probe_prologue/epilogue. * translate.cxx (emit_common_header): Call it. * elaborate.h: Corresponding changes.
* 2006-05-24 David Smith <dsmith@redhat.com>dsmith2006-05-241-0/+1
| | | | | | | | | | | | | | * elaborate.cxx (isglob): New function. (match_key::globmatch): New function. (match_node::find_and_build): Uses isglob() and match_key::globmatch() to provide support for wildcards such as "kernel.syscall.*read*" (Bugzilla #1928). * elaborate.h (match_key::globmatch): Added function declaration. * parse.cxx (parser::parse_probe_point): Collects one or more tokens into a single probe-point functor string. * testsuite/parseko/twentytwo.stp: New file. * testsuite/parseok/sixteen.stp: New file.
* 2006-05-18 Frank Ch. Eigler <fche@elastic.org>fche2006-05-181-6/+1
| | | | | | | | | | | | | | | | | | | | | | | Organize "-t" output by script/parse level probes rather than derived-probes. * elaborate.cxx (derived_probe ctor): Remove name field setting. (alias_derived_probe): New class. (alias_expandion_builder::build): Create an instance of the above instead of parse-tree-level plain probe. * elaborate.h: Corresponding changes. (derived_probe::basest): Define. * staptree.cxx (probe ctor): Set new name field. * staptree.h (probe): Corresponding changes. (probe::basest): New field. * tapsets.cxx (emit_probe_prologue, emit_probe_entries): Switch to basest() probe name for Stat instance. (dwarf_derived_probe ctor): Stash away base probe. * translate.cxx (unparser::emit_probe): Remove index operand, just use probe name to generate symbols. (emit_module_init): Reorganize -t output in unregister functions. (translate_pass): Remove unparser::current_probenum field and all uses. * translate.h: Corresponding changes.
* 2006-04-25 Frank Ch. Eigler <fche@elastic.org>fche2006-04-251-1/+2
| | | | | | | * elaborate.cxx (typeresolution_info::unresolved,invalid, mismatch): Print current function/probe name in error message. (semantic_pass_types): Pass sufficient information. * elaborate.h: Corresponding changes.
* 2006-04-21 Frank Ch. Eigler <fche@elastic.org>fche2006-04-211-8/+16
| | | | | | | | | | | | | | | | | PR 953 * elaborate.h (derived_probe): Add field "name". Stop passing "probe index" to other emit_* calls. (emit_probe_context_vars): New member function. * elaborate.cxx (derived_probe ctor): Generate unique name. * translate.cxx (*): Adapt to index->name. (emit_probe): Realize that probe locals only occur at nesting=0. * tapsets.cxx (*derived_probe::emit_*): Adapt to index->name. (mark_var_expanding_copy_visitor): New class to process $argN. (mark_derived_probe ctor): Call it. (mark_derived_probe::emit_probe_context_vars): Do it. * buildrun.cxx (compile_pass): Add more optional gcc verbosity. Add CFLAGS += -freorder-blocks. * testsuite/buildok/marker.stp: New test.
* 2006-01-03 Frank Ch. Eigler <fche@redhat.com>fche2006-01-031-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR 1144, 1379 * tapsets.cxx (emit_probe_prologue, _epilogue): New routines. Call from existing derived_probe spots. Implement soft errors in epilogue code. Implement reentrancy detection in prologue code. (dwarf_derived_probe::emit_deregistration): Add kprobes layer "nmissed" to skipped_count. * translate.cxx (varlock): Use nsleep(TRYLOCKDELAY) in lock contention loop. (emit_module_exit): Report number of soft errors and skipped probes. (emit_function, _probe): Add __restrict__ marker to context pointer. (translate_pass): Define new MAXTRYLOCK, TRYLOCKDELAY, MAXERRORS, MAXSKIPPED parameters. * tapset/logging.stp (error): Don't stp_error, just set context state. * stap.1.in, stapfuncs.5.in: Document soft errors. * elaborate.h: Corresponding changes. 2006-01-03 Frank Ch. Eigler <fche@redhat.com> * io.c (_stp_softerror): New function. 2006-01-03 Frank Ch. Eigler <fche@redhat.com> * systemtap.base/timers.exp: Extend the test run duration. Accept skipped probe warnings at shutdown.
* 2005-11-23 Graydon Hoare <graydon@redhat.com>graydon2005-11-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-13 Graydon Hoare <graydon@redhat.com>graydon2005-11-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * staptree.h (struct indexable): New struct. (classify_indexable): New function. (classify_const_indexable): New function. (struct symbol): Implement indexable. (struct arrayindex): Take indexable as base. (struct foreach_loop): Take indexable as base. (struct print_format): New struct. (enum stat_component_type): New enum. (struct stat_op): New struct. (enum historgram_type): New enum. (struct hist_op): New struct. (struct visitor) (struct traversing_visitor) (struct throwing_visitor) (struct deep_copy_visitor): Add new visitor methods. (require): Specialize for indexable*. * staptree.cxx (print_format::*) (stat_op::*) (hist_op::*) (indexable::*) (traversing_visitor::*) (throwing_visitor::*) (deep_copy_visitor::*) (classify_indexable) (classify_const_indexable): Implement (deep_copy_visitor::*): Update to use indexables. * parse.h (parser::parse_indexable): New method. (parser::parse_hist_op_or_bare_name): New method. * parse.cxx (lexer::scan): Accept @ in identifiers. (parser::parse_array_in) (parser::parse_foreach_loop): Call parse_indexable. (parser::parse_hist_op_or_bare_name): Implement. (parser::parse_indexable): Implement. (parser::parse_symbol): Accept printf, stat_ops, hist_ops. * elaborate.h (struct typeresolution_info): Add methods for visiting print_format, stat_op, hist_op. * elaborate.cxx (symbol_fetcher): New class. (get_symbol_within_expression): New function. (get_symbol_within_indexable): New function. (mutated_var_collector): Replace mutated_map_collector. (no_var_mutation_during_iteration_check): Replace no_map_mutation_during_iteration_check. (semantic_pass_vars): Replace semantic_pass_maps. (semantic_pass): Update call accordingly. (symresolution_info::*) Add new visitors, teach about indexables (typeresolution_info::*) Likewise. * translate.cxx (c_unparser::getiter): Take symbol, not foreach_loop. (c_unparser::*) Add new visitors, teach about indexables. (c_tmpcounter::*) (delete_statement_operand_visitor::visit_arrayindex) (c_tmpcounter_assignment::*) (c_unparser_assignment::*): Likewise. (hist_op_downcaster): New struct. (expression_is_hist_op): New function. * testsuite/buildok/printf.stp: New test for print_format.