| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls):
Just pass an index from the individual entry handlers, and let
handle_perf_probe figure out the pp and ph.
|
|
|
|
|
|
|
|
|
|
| |
* perf.h (stap_perf_probe): Define one structure for all our needs.
* perf.c (_stp_perf_init): Use the new struct, return errors directly.
(_stp_perf_exit): Use the new struct.
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls): Use
the stap_perf_probe definition from perf.h now.
(perf_derived_probe_group::emit_module_init): Adapt.
(perf_derived_probe_group::emit_module_exit): Adapt.
|
|
|
|
|
|
|
| |
* session.h (kernel_exports): New field.
* main.cxx (parse_kernel_exports): Fill it.
* tapset-perfmon.cxx (perf_builder::build): Check it for our pal
perf_event_create_kernel_counter.
|
|
|
|
|
| |
* tapset-perfmon.cxx (perf_builder::build): Check for CONFIG_PERF_EVENTS here.
(register_tapset_perf): ... instead of here.
|
|
|
|
|
|
| |
* tapset/perf.stp: New file.
* tapset-perfmon.cxx (perf_derived_probe): Drop event_name field throughout.
Listen to type(N).config(M) instead.
|
|
|
|
|
|
|
| |
* runtime/perf.c (_stp_perf_init): Pass through ERR_PTRs, and create our
own -ENOMEM for allocation failures.
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_init): Check
IS_ERR for registration status.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
While I still have some TODOs, it's now in a usable state for others to
start testing...
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls):
Implement the code to hook up real stap handlers.
(perf_derived_probe_group::emit_module_init): Register for real.
(perf_derived_probe_group::emit_module_exit): Unregister.
|
|
|
|
|
|
| |
* tapset-perfmon.cxx (perf_builder::translate_event): New. The event
mapping is hard-copied from the current state of perf.
(perf_builder::build): Call it.
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are now the available points:
perf.event("NAME")
perf.event("NAME").sample(NUM)
* tapset-perfmon.cxx (perf_derived_probe::perf_derived_probe): Add
fields for the event name, type, and config. Rewrite the probe_point
to match the derived components
(perf_builder::build): Parse the new fields.
(register_tapset_perf): Adapt the match_nodes.
|
|
|
|
|
|
|
| |
IMO, it's better to contain the CONFIG check inside the perf code.
* tapsets.cxx (register_standard_tapsets): Always call perf register.
* tapset-perfmon.cxx (register_tapset_perf): Do the CONFIG check here.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 static class member is only used by a single method, it's more
concise to use a static local variable instead.
* staptree.cxx (probe::probe): Make last_probeidx a static local.
* tapset-perfmon.cxx (perfmon_derived_probe::perfmon_derived_probe):
Make probes_allocated a static local.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|