summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
Commit message (Collapse)AuthorAgeFilesLines
* elaborate.cxx: Point to the location of the error when rejectingDave Brolley2010-02-151-1/+2
| | | | probe points.
* Rework identification of probes allowed for unprivileged users.Dave Brolley2010-02-151-21/+16
| | | | | | | - 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.
* Hardware Breakpoints for x86 / x86_64, based on mainline kernel. [Changes : ↵Prerna Saxena2010-01-291-0/+1
| | | | Part 2]
* PR10877: Give token* to each component instead of each probe_pointCharley Wang2009-11-101-5/+6
|
* Correct the safety-net escape WRT lockingJosh Stone2009-10-211-1/+3
| | | | | | | | | | Within a probe body, the "out" label starts the normal exit path, including unlocking whatever globals are used in that probe. Since the unprivileged safety-net checks are before the locks are ever grabbed, we should bypass the unlock on the way out. * elaborate.cxx (derived_probe::emit_process_owner_assertion): Use "return" instead of "goto out".
* PR10799: warn on possibly uintended local-vs-global namespace collisionFrank Ch. Eigler2009-10-191-5/+15
| | | | | | | | | * 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.
* Consolidate print_format creationJosh Stone2009-10-131-20/+10
| | | | | | | | | | | | | | | | | | We almost had a factory in print_format::parse_print, so let's take that the rest of the way. This way we don't have so much duplication in initializing the print flags. * staptree.cxx (print_format::parse_print): Replaced with... (print_format::create): New factory to parse and create print_formats. * elaborate.cxx (add_global_var_display): Use this factory. * parse.cxx (parser::parse_symbol): Ditto. * tapset-mark.cxx (mark_var_expanding_visitor::visit_target_symbol_context): Ditto. * tapset-utrace.cxx (utrace_var_expanding_visitor::visit_target_symbol_arg): Ditto. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol_context): Ditto. (tracepoint_var_expanding_visitor::visit_target_symbol_context) Ditto.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-10-131-2/+2
|\
| * Remove the global derived_probe->semaphore mapJosh Stone2009-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | 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/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-22/+47
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cleanup: tweak "read-only <variable>" messageFrank Ch. Eigler2009-09-281-4/+4
| | | | | | * elaborate.cxx (semantic_pass_opt2): Use "never-assigned" instead of "read-only". (dead_stmtexpr_remover::visit_expr_statement): Ditto.
* Unify lex_cast* and avoid string copiesJosh Stone2009-09-021-3/+3
| | | | | | | | | | | | | | | We always use lex_cast either to string or from string, so I made that explicit, and got rid of some string copies in the process. There was also stringify(), which was redundant to lex_cast<string>. We also always used lex_cast_hex to string, so that's now hard-coded and again eliminated a string copy. For lex_cast_qstring<string>, there's no need to write the streamify the input, so a specialization now operates directly on the input. Hopefully this is a bit cleaner, and I do measure it to be a little faster on scripts with many probes.
* PR10568: Ensure that aliases pull in their tapsetJosh Stone2009-08-271-0/+11
| | | | | | | | | | | When a probe alias is resolved in a tapset, the contents of that tapset should be included in the compiled script, just as we do for global variables and functions. * elaborate.cxx (alias_expansion_builder::build): When an alias is instantiated, add its stapfile to the session files. * testsuite/systemtap.base/tapset_includes.exp: New test. * testsuite/systemtap.base/tapset/*.stp: Testing tapsets for above.
* PR10495: allow multiple probe aliases with same nameFrank Ch. Eigler2009-08-181-9/+14
| | | | | | | | * 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.
* Only add extra error on no probes found if no previous errors already shown.Mark Wielaard2009-08-101-1/+1
| | | | | * elaborate.cxx (semantic_pass): Don't add "no probes found" if session already had other errors.
* Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-08-041-21/+79
|\ | | | | | | | | | | Conflicts: cache.cxx
| * Add update_visitor::replaceJosh Stone2009-08-031-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | I noticed that most uses of update_visitor::require() were simply writing the value back to the same place, i.e. foo = require(foo). The new replace() method just encapsulates that paradigm, so we don't have the duplication between the LHS and RHS. * staptree.h (update_visitor::replace): New. * elaborate.cxx, staptree.cxx, tapset-mark.cxx, tapset-perfmon.cxx, tapset-procfs.cxx, tapset-utrace.cxx, tapsets.cxx: Update all require calls that are simply updating the value in-place.
| * PR2049: support arbitrary $target-array indexingJosh Stone2009-08-031-2/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than just numeric literals, we can now support arbitrary expressions for the index value. Note that loc2c won't allow this for noncontiguous arrays, as the access methods need to be statically computed, but for contiguous arrays and pointers-as-arrays it works just fine. * staptree.h (target_symbol::component): Add expression_array_index. * staptree.cxx (target_symbol::visit_components): New helper. (target_symbol::assert_no_components): Recognize new array type. (target_symbol::component::print): Print subexpressions. (traversing_visitor::visit_target_symbol, visit_cast_op): Visit the indexing components too. (varuse_collecting_visitor::visit_target_symbol): Ditto. (update_visitor::visit_target_symbol, visit_cast_op): Ditto. * elaborate.cxx (void_statement_reducer::visit_target_symbol): New. (void_statement_reducer::visit_cast_op): Save indexes too. * parse.cxx (parser::parse_target_symbol_components): Parse expressions. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol): Pass expression-indexes as parameters (indexN) to the dwarf function. (dwarf_cast_expanding_visitor::visit_cast_op): Ditto. (tracepoint_var_expanding_visitor::visit_target_symbol_arg): Ditto. (sdt_var_expanding_visitor::visit_target_symbol): Visit the new @cast. * dwflpp.cxx (dwflpp::translate_components): Use THIS->indexN. * translate.cxx (c_unparser::visit_target_symbol): Correct error msg. * testsuite/systemtap.base/pointer_array.stp: Use a simple index.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-101-12/+12
|\|
| * Remove the filename copy from token->locationJosh Stone2009-07-091-12/+12
| | | | | | | | | | The location already has a pointer to a stapfile with the filename, so there's no need to keep an extra copy.
* | Disallow embedded C in tapset functions ifor unprivileged users unless ↵Dave Brolley2009-06-251-9/+9
| | | | | | | | tagged by /* unprivileged */.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-111-5/+9
|\|
| * Fix condition propagation across aliasesJosh Stone2009-06-091-5/+9
| | | | | | | | | | | | | | | | | | | | When an instance of an alias has a condition, that condition gets propagated to each of the locations that the alias defines. However, the copy of the location list was not a deep copy, and so all other instances of the alias would also incorrectly receive the condition. This patch makes the location list copy a little deeper, and adds a test case which demonstrates the issue.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-05-111-1/+1
|\| | | | | | | | | | | Conflicts: tapsets.cxx
| * Allow @cast failures to get optimized awayJosh Stone2009-05-081-1/+1
| | | | | | | | | | | | We have the saved_conversion_error field, but I wasn't using it. Now @cast errors are saved in that field, so they're only seen if the optimizer doesn't remove the @cast.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-05-061-4/+12
|\|
| * PR10102: tolerate the failure related to optional probeWenji Huang2009-05-051-4/+12
| | | | | | | | | | | | | | | | | | This patch will make stap silently accept the failure related to optional probe. It puts try/catch around find_and_build which can cover most probe types. The specific treatment for dwarf_derived_probe in commit ed82b7c902d6a2e26452ec51c9cdb9665dbf9e97 is reverted.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-04-301-0/+3
|\|
| * PR10102: tolerate mismatched optional probeWenji Huang2009-04-271-0/+3
| | | | | | | | | | | | * elaborate.cxx: Early return for mismatched optional probe. * testsuite/systemtap.base/optionalprobe.exp: New test case. * testsuite/systemtap.base/optionalprobe.stp: Ditto.
* | 2009-04-22 Dave Brolley <brolley@redhat.com>Dave Brolley2009-04-221-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-04-211-0/+1
|\|
| * From Prerna Saxena: Add the kprobe.function probe familyAnanth N Mavinakayanahalli2009-04-211-0/+1
| |
* | 2009-04-20 Dave Brolley <brolley@redhat.com>Dave Brolley2009-04-201-1/+20
|/ | | | | | | | | | * 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.
* PR10070: don't warn about side-effect-free probes in -t (timing) modeFrank Ch. Eigler2009-04-141-1/+2
| | | | * elaborate.cxx (semantic_pass_opt4): Filter warning on s.timing.
* PR10026: Read marker/tracepoint args directlyJosh Stone2009-04-061-0/+3
| | | | | | | | | | 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.
* tracepoint probes: clear session derived_probe_groups pointer in ctor to ↵Frank Ch. Eigler2009-03-081-0/+1
| | | | avoid SEGV
* PR9719: uninitialized variable fixFrank Ch. Eigler2009-02-181-2/+2
|
* BZ 9719: Improve type mismatch messagesRajan Arora2009-02-181-6/+53
|
* Bump copyright years to 2009Josh Stone2009-02-181-1/+1
|
* Enable session-wide code filteringJosh Stone2009-02-181-0/+6
| | | | | | | | | | This will be used to hook to dwarf_builder to all functions and probes so it can attempt @cast expansion. * session.h (systemtap_session): Add a vector of update_visitors that will act as filters for all probes and functions. * elaborate.cxx (semantic_pass_symbols): Run probes and functions through each registered code filter.
* Add high-level support for @cast()ingJosh Stone2009-02-181-0/+31
| | | | | | | | | | | | | | | | | | 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.
* Simplify void_statement_reducerJosh Stone2009-02-101-94/+67
| | | | * elaborate.cxx (void_statement_reducer): Convert to an update_visitor.
* Simplify dead_stmtexpr_removerJosh Stone2009-02-101-54/+37
| | | | | | * staptree.h (update_visitor::require): Add a clearok parameter for optimizing traversers to signal that they're ready for NULL back. * elaborate.cxx (dead_stmtexpr_remover): Convert to an update_visitor.
* Simplify dead_assignment_removerJosh Stone2009-02-101-108/+16
| | | | | | | | By converting to an update_visitor, we now get full statement coverage in this optimizer for free. * elaborate.cxx (dead_assignment_remover): Convert into an update_visitor and remove its now-redundant traversal methods.
* match_node::find_and_build disambiguate error messages.Mark Wielaard2009-02-031-1/+2
|
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+1
|
* First attempt at printf kernel memory hex dumpElliott Baron2008-12-191-0/+1
|
* PR7051: Remove broken printf %n directive supportroot2008-12-051-4/+2
|
* PR7053: Add checking empty aggregate and default print where @count==0.Wenji Huang2008-12-021-1/+37
|