summaryrefslogtreecommitdiffstats
path: root/tapset-perfmon.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Simplify the perf entry handlersJosh Stone2010-03-181-9/+6
| | | | | | * 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.
* Create one perf structure to rule them allJosh Stone2010-03-181-19/+9
| | | | | | | | | | * 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.
* PR909: store kernel exported symbols in session objectFrank Ch. Eigler2010-03-181-0/+2
| | | | | | | * 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.
* PR909: reject perf.* probes laterFrank Ch. Eigler2010-03-181-6/+5
| | | | | * tapset-perfmon.cxx (perf_builder::build): Check for CONFIG_PERF_EVENTS here. (register_tapset_perf): ... instead of here.
* PR909: switch to tapset-based attr/type resolutionFrank Ch. Eigler2010-03-181-76/+25
| | | | | | * tapset/perf.stp: New file. * tapset-perfmon.cxx (perf_derived_probe): Drop event_name field throughout. Listen to type(N).config(M) instead.
* Preserve perf initialization errorsJosh Stone2010-03-171-2/+3
| | | | | | | * 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.
* Assign the perf probe_point on registration failureJosh Stone2010-03-171-0/+1
|
* PR909: Emit proper decls for perf probesJosh Stone2010-03-171-24/+61
| | | | | | | | | | 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.
* Translate perf events names into kernel namesJosh Stone2010-03-171-4/+63
| | | | | | * 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.
* Rename perf probe pointsJosh Stone2010-03-171-22/+36
| | | | | | | | | | | | 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.
* Move the perf CONFIG checkJosh Stone2010-03-171-0/+5
| | | | | | | 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.
* Start of perf tapset parsingWill Cohen2010-03-171-1/+149
|
* Remove the old performance monitoring code.Will Cohen2010-03-171-416/+0
|
* Squash elision warnings on synthetic functionsJosh Stone2010-02-261-0/+1
| | | | | | | | | | | | | | * 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.
* 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.
* Remove unnecessary static membersJosh Stone2009-08-261-8/+2
| | | | | | | | | 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.
* Add update_visitor::replaceJosh Stone2009-08-031-1/+1
| | | | | | | | | | | | 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.
* Unify no-component assertions on target variablesJosh Stone2009-07-311-18/+1
| | | | | | | | | | | | | | | | | 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.
* Make a real type for target_symbol->componentsJosh Stone2009-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* PR5930: Address-op for $target and @cast membersJosh Stone2009-07-151-0/+3
| | | | | | | | | | | | | | | | 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
* Separate the permon tapsetJosh Stone2009-05-071-0/+463