| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
probe points.
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
| |
Part 2]
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* elaborate.cxx (semantic_pass_opt2): Use "never-assigned" instead
of "read-only".
(dead_stmtexpr_remover::visit_expr_statement): Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* elaborate.cxx (semantic_pass): Don't add "no probes found" if session
already had other errors.
|
|\
| |
| |
| |
| |
| | |
Conflicts:
cache.cxx
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\| |
|
| |
| |
| |
| |
| | |
The location already has a pointer to a stapfile with the filename, so
there's no need to keep an extra copy.
|
| |
| |
| |
| | |
tagged by /* unprivileged */.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
tapsets.cxx
|
| |
| |
| |
| |
| |
| | |
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.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\| |
|
| |
| |
| |
| |
| |
| | |
* elaborate.cxx: Early return for mismatched optional probe.
* testsuite/systemtap.base/optionalprobe.exp: New test case.
* testsuite/systemtap.base/optionalprobe.stp: Ditto.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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.
|
|\| |
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* elaborate.cxx (semantic_pass_opt4): Filter warning on s.timing.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
avoid SEGV
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* elaborate.cxx (void_statement_reducer): Convert to an update_visitor.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|