| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* runtime/procfs-probes.c: Removed old kernel 2.6.16 code. Simplified
_spp_lock macros.
(_stp_proc_open_file): If file is busy, use a wait queue to wait on it
being available.
(_stp_proc_release_file): Decrease open count.
* tapset-procfs.cxx (emit_module_init): Updated procfs probe
initialization/shutdown routine names.
(emit_module_exit): Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* staptree.h (functiondecl): Add a synthetic flag.
* elaborate.cxx (semantic_pass_opt1): Don't warn about synthetic funcs.
* tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol): Mark
the new function as synthetic.
(dwarf_cast_expanding_visitor::visit_cast_op): Ditto.
(tracepoint_var_expanding_visitor::visit_target_symbol_arg): Ditto.
* tapset-perfmon.cxx
(perfmon_var_expanding_visitor::visit_target_symbol): Ditto.
* tapset-procfs.cxx (procfs_var_expanding_visitor::visit_target_symbol):
Ditto.
* testsuite/semok/thirtyeight.stp: New check with -W and @defined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tapset-procfs.cxx (procfs_derived_probe::procfs_derived_probe): Added
'maxsize_val' initialization.
(procfs_derived_probe::join_group): Updated '_stp_procfs_data'
definition and added STP_PROCFS_BUFSIZE.
(procfs_derived_probe_group::emit_module_decls): Emits structure to
contain procfs file buffers. Initializes '.bufsize' structure member.
(procfs_var_expanding_visitor::visit_target_symbol): Uses 'bufsize' for
maximum buffer size instead of using MAXSTRINGLEN.
(procfs_builder::build): Looks for '.maxsize(NNN)' parameter.
(register_tapset_procfs): Added '.maxsize(NNN)' parameter binding.
* runtime/procfs-probes.c (stap_procfs_probe): Converted 'buffer' to a
pointer and added 'bufsize' member.
* testsuite/semko/procfs13.stp: New testcase.
* testsuite/semko/procfs14.stp: Ditto.
* testsuite/semko/procfs15.stp: Ditto.
* testsuite/systemtap.base/procfs_maxsize.exp: Ditto.
* testsuite/systemtap.base/procfs.exp: Minor fix.
* stapprobes.3stap.in: Added '.maxsize(NNN)' documentation.
* stap.1.in: Added STP_PROCFS_BUFSIZE documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unresolvable $variables
* staptree.cxx (target_symbol::chain): New function.
* staptree.h: Declare it.
* (*): Use it instead of hand-chaining to target_symbol->saved_conversion_error.
* tapset-mark.cxx (*::visit_target_symbol): Chain resolution error object,
do not throw.
* tapset-procfs.cxx (*::visit_target_symbol): Ditto.
* tapset-utrace.cxx (*::visit_target_symbol): Ditto.
* tapsets.cxx (*::visit_target_symbol): Ditto.
(*::visit_defined_op): Explain & enforce the above.
* testsuite/semok/thirtysix.stp: Expand.
* testsuite/systemtap.base/sdt_misc.exp: Bonus fix: make work with blddir != srcdir.
|
|
|
|
|
| |
* tapset-procfs.cxx (procfs_var_expanding_visitor::visit_target_symbol):
Removed unneeded rvalue operator check.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tapsets.h (var_expanding_visitor): Add 'valid_ops' and 'op' member
variables.
* tapsets.cxx (var_expanding_visitor::var_expanding_visitor): Set
'valid_ops' to '='. By default, var_expanding_visitor classes only
handle the '=' operator.
(var_expanding_visitor::visit_assignment): Remember what operator we're
handling. When an operator is found that isn't in the 'valid_ops' set,
error.
* tapset-procfs.cxx
(procfs_var_expanding_visitor::procfs_var_expanding_visitor): Add '.='
to the 'valid_ops' set.
(procfs_var_expanding_visitor::visit_target_symbol): Handle the '.='
operator when the target variable is an lvalue.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* runtime/procfs.c: Allow STP_MAX_PROCFS_FILES define to be overridden.
(_stp_create_procfs): Calls proc_create() instead of create_proc_entry()
to avoid a race condition.
* runtime/procfs-probes.c: New file containing procfs probe support
routines.
* tapset-procfs.cxx (procfs_derived_probe::join_group): Update struct
_stp_procfs_data definition.
(procfs_derived_probe::emit_module_decls): Include procfs-probes.c,
which is where the definition of struct stap_procfs_probe exists.
Update generated routines to read/write procfs data.
(procfs_derived_probe_group::emit_module_init): Pass file_operations
argument to _stp_create_procfs(). Initialize mutex.
(procfs_var_expanding_visitor::visit_target_symbol): Update generated
code.
|
|
|
|
|
|
| |
* tapset-procfs.cxx (procfs_var_expanding_visitor::visit_target_symbol):
Correctly null terminate strings in procfs write probes.
* testsuite/systemtap.base/procfs_write.exp: New test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are several tapsets that can't deal with component dereferences on
their target variables, and they all check-and-throw in the same way.
This refactors the checks into a target_symbol member.
* staptree.cxx (target_symbol::assert_no_components): New.
* tapsets.cxx (tracepoint_var_expanding_visitor::visit_target_symbol_arg,
tracepoint_var_expanding_visitor::visit_target_symbol_context): Use
the new assertion function to check for no components.
* tapset-mark.cxx (mark_var_expanding_visitor::visit_target_symbol_arg,
mark_var_expanding_visitor::visit_target_symbol_context): Ditto.
* tapset-perfmon.cxx (perfmon_var_expanding_visitor::visit_target_symbol): Ditto.
* tapset-procfs.cxx (procfs_var_expanding_visitor::visit_target_symbol): Ditto.
* tapset-utrace.cxx (utrace_var_expanding_visitor::visit_target_symbol_arg,
utrace_var_expanding_visitor::visit_target_symbol_context): Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now the dereferences on target_symbol and cast_op are tracked with a
struct instead of just a generic pair. The first immediate benefit is
that we can track the token for more exact error reporting.
* staptree.h (target_symbol): Add a new component type.
* staptree.cxx (target_symbol::component::print): New.
(operator<<(ostream&, target_symbol::component&): New.
(target_symbol::print): Adapt component printing.
(cast_op::print): Ditto.
* parse.cxx (parser::parse_target_symbol_components): Adapt to the new
component construction.
* dwflpp.cxx (dwflpp::find_struct_member): take the component as a
parameter for a better token in error messages
(dwflpp::translate_components): Adapt to the new component type.
* tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol): Don't
overwrite the token in target_symbol saved errors.
(tracepoint_var_expanding_visitor::visit_target_symbol_arg): Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows the '&' operator to get the address of @cast and $target
variable expressions.
* staptree.h (target_symbol): add addressof field
* staptree.cxx (target_symbol::print): print '&' for addressof
(cast_op::print): ditto
* parse.cxx (parser::parse_value): allow '&' prefix on $target/@cast
* dwflpp.cxx (dwflpp::translate_final_fetch_or_store): allow taking the
computed address without actually doing a final fetch.
* tapset* (*::visit_target_symbol): throw errors for $vars w/o addresses
* testsuite/systemtap.base/cast.stp: add &@cast test
* testsuite/semok/target_addr.stp: test '&' on different member types
* testsuite/semko/target_addr?.stp: test failure on bitfields/registers
|
|
|
|
|
|
|
|
|
|
|
| |
* tapset-procfs.cxx (procfs_derived_probe::join_group): Outputs structure
definition.
(procfs_derived_probe_group::emit_module_decls): The generated
'_stp_procfs_read' and '_stp_procfs_write' functions no longer put a
string_t on the stack.
(procfs_var_expanding_visitor::visit_target_symbol): The generated
'_procfs_value_set' and '_procfs_value_get' functions copy directly
into or out of the os buffer.
|
| |
|
|
|