| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* staptree.h (update_visitor): A new visitor to make it easier to
rewrite parts of a probe or function without making a full copy.
* staptree.cxx (update_visitor::*): Each child is recursed with a
require() call, and then the parent returns itself with provide().
* staptree.h (deep_copy_visitor): Inherit from update_visitor to get
the recursive descent while updating nodes.
* staptree.cxx (deep_copy_visitor::*): Use the implicit copy
constructors to copy all fields, then defer to update_visitor for the
recursion. Referents are still cleared from the copies of symbols and
function calls.
|
|
|
|
|
|
|
| |
* staptree.h (require, provide): Simplify stack operations with less
pointer magic, and move to be deep_copy_visitor members.
* staptree.h (deep_copy_visitor::deep_copy): Templatize
* staptree.cxx, tapsets.cxx: Refactor require/provide callers
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
PR5897
* staptree.cxx (probe::printsig): If this probe was derived from an alias,
call the printsig method of the alias.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-03-03 Frank Ch. Eigler <fche@elastic.org>
PR5516
* elaborate.cxx (symbol_fetcher, dead_assignment_remover):
Support unresolved $target lvalues. Propagate pretty error
messages.
* staptree.cxx (varuse_collecting_visitor target_symbol): Ditto.
* staptree.h: Corresponding decl.
* loc2c.c: c_translate_pointer_store: New function.
* loc2c.h: Corresponding decl.
* tapsets.cxx (dwflpp::translate_final_fetch_or_store): Call it
for $target pointer assignments.
2008-03-03 Frank Ch. Eigler <fche@elastic.org>
PR5516
* buildok/twentynine.stp: New test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR5189
* staptree.h (print_format::conv_memory): New enumerator.
(print_format::width_type): New enumeration.
(print_format::precision_type): New enumeration.
(format_component::widthtype): New member.
(format_component::prectype): New member.
(format_component::is_empty): Test widthtype and prectype.
(format_component::clear): Clear widthtype and prectype.
* staptree.cxx (print_format::components_to_string): Handle dynamic width and precision.
Handle conv_memory.
(print_format::string_to_components): Parse dynamic width and precision specifiers.
Set widthtype and prectype. Parse %m format specifier.
* elaborate.h (typeresolution_info::check_arg_type): New method.
* elaborate.cxx (typeresolution_info::visit_print_format): Account for dynamic width
and precision when computing the expected number of arguments. Check the types of
arguments for dynamic width and precision. Use check_arg_type to check the types of
all arguments. Handle print_format::conv_memory.
(typeresolution_info::check_arg_type): New method.
* NEWS: Describe the enhancements above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR5609
* staptree.h (probe::collect_derivation_chain): Now takes vector<probe*>.
(probe::get_alias): New virtual method.
* elaborate.h (derived_probe::collect_derivation_chain): Now takes vector<probe*>.
* staptree.cxx (probe::collect_derivation_chain): Now takes vector<probe*>. Don't
cast 'this' to (derived_probe*).
* elaborate.cxx (derived_probe::collect_derivation_chain): Now takes vector<probe*>.
(alias_derived_probe::get_alias): New virtual method.
(alias_derived_probe::alias): New member.
(alias_expansion_builder::build): Call checkForRecursiveExpansion and emit a
diagnostic if recursion is detected. Pass alias to constructor of
alias_derived_probe.
(alias_expansion_builder::checkForRecursiveExpansion): New method.
* coveragedb.cxx: Pass vector<probe*> on all calls to collect_derivation_chain.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
2008-01-25 Frank Ch. Eigler <fche@elastic.org>
PR 5672.
* staptree.cxx (probe_point copy ctor): New function.
* staptree.h: Declare it.
* tapsets.cxx (dwarf_derived_probe ctor): Call it to shallow-copy
incoming base probe location before recomputing/overwriting it.
|
|
|
|
|
|
|
|
| |
PR 5017.
* staptree.cxx (<cstring>): #include it.
(required <indexable *>): Remove 'static' from instantiation and
move instantiation to here from...
* staptree.h: ...here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-01-17 Frank Ch. Eigler <fche@elastic.org>
PR 4935.
Reorganize probe condition implementation.
* elaborate.cxx (add_condition): New function.
(derived_probe): Remove condition member.
(derived_probe ctors): Assert non-null incoming probe/location ptrs.
(insert_condition_statement): Remove; turn into ...
(semantic_pass_conditions): New pass-2 subpass.
(semantic_pass_symbols, visit_symbol, visit_functioncall, find_var):
Detect some condition-related error cases.
(match_key): Change type to exp_type from tok_type. Update callers.
(alias_expansion_builder): Propagate probe conditions.
* staptree.cxx (probe): Remove condition field and related functions.
* tapsets.cxx (dwarf_derived_probe ctor): Compute replacement
wildcard-expanded probe_point preserving more of the original
location.
(mark_derived_probe ctor): Make similar to others - take location
rather than condition parameters.
* translate.cxx (emit_common_header): Tweak ordering of tmpcounter
traversal and hashkey expression generation.
* elaborate.h: Corresponding changes.
2008-01-17 Frank Ch. Eigler <fche@elastic.org>
PR 4935.
* semko/forty.stp, fortyone.stp, fortytwo.stp: New tests.
* semok/twentynine.stp: Weaken test since condition expressions have
become more tightly constrained.
|
|
|
|
|
|
|
| |
2007-12-11 Frank Ch. Eigler <fche@elastic.org>
* staptree.cxx, staptree.h: More GCC 4.3 build fixes from
Eugeniy Meshcheryakov <eugen@debian.org>.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 4935.
* parse.cxx (parser::parse_probe_point): Parse "if" condition
following probe point.
* staptree.h (probe_point): Add "condition" field.
(probe): Add "condition" field and "add_condition" method.
(deep_copy_visitor): Add "deep_copy" method for the expression.
* staptree.cxx (probe_point::probe_point): Initalize it.
(probe::add_condition): Implement it.
(probe::print): Output "condition" field.
(probe::str): Ditto.
(deep_copy_visitor::deep_copy): Implement it.
* elaborate.h (derived_probe): Add "insert_condition_statement"
method.
* elaborate.cxx (derived_probe::derived_probe): Initialize "condition"
field, and insert a condition check routine on the top of body.
(derived_probe::insert_condition_statement): Implement it.
(alias_expansion_builder::build): Pass the condition from the alias
referer to new alias.
* tapsets.cxx (be_derived_probe): Remove unused constructor.
(dwarf_derived_probe::dwarf_derived_probe): Insert a condition check
routine on the top of body.
(mark_derived_probe::mark_derived_probe): Ditto.
(mark_builder::build): Pass the base location to mark_derived_probe.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2007-11-19 Frank Ch. Eigler <fche@elastic.org>
PR 3887.
* staptree.h (probe_point): Add "sufficient" field.
* staptree.cxx: Initialize it, print it.
* parse.cxx (parse_probe_point): Parse it.
* elaborate.cxx (derive_probes): Implement it.
* stapprobes.5.in: Document it.
* NEWS: Gloat about it.
* parseok/five.stp, semok/twentyseven.stp: Test "!" probe point flag.
* iostat-scsi.stp: Adopt "!" probe point flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* translate.cxx (visit_print_format): Strings without a format or
formatted with "%s" or "%s\n" should be printed with calls to _stp_print().
Call _stp_print_char() if printing a char.
* staptree.cxx (parse_print): Check for "print_char".
* staptree.h (struct print_format): Add print_char.
(parse_print): Update prototype.
* parse.cxx (parse_symbol): Set print_char bool in print_format.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 5078
* tapsets.cxx (be_derived_probe): Rework to add error probe support.
Emit probe description array in C for traversal by generated code.
* register_standard_tapsets: Add error probes.
* stapprobes.5.in: Document.
* translate.cxx (emit_module_init): Handle errors that may occur
during begin probes.
(emit_module_exit): Use schedule() rather than cpu_relax() during
shutdown synchronization wait loop.
* staptree.cxx (probe::printsig): Put multiple probe points on same
line.
2007-10-02 Frank Ch. Eigler <fche@redhat.com>
PR 5078
* semok/twentysix.stp, systemtap.base/beginenderror.*: New tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 5019
* elaborate.cxx (visit_hist_op): Remove log histogram param.
* translate.cxx (assert_hist_compatible): Ditto.
* staptree.cxx (hist_op::print): Ditto.
* session.h (statistic_decl): Ditto.
* parse.cxx (expect_number): Allow negative numbers.
Also validate that input is really numeric. This is used
by histograms to get the parameters.
(parse_hist_op_or_bare_name): Remove code to get parameter
for log histograms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 4591
* parse.cxx (parser::parse_symbol): Tweak 'print' matching to allow
all the new variants with printd and println.
* staptree.h (struct print_format): Add fields for the new print
variants, and parse_print() to help matching.
* staptree.cxx (print_format::parse_print): New static method to
match the print variants and determine their properties.
(print_format::print): Handle the new print types.
(deep_copy_visitor::visit_print_format): Copy the new fields.
* translate.cxx (c_unparser::visit_print_format): Insert delims and
newlines where appropriate for new print functions.
* stap1.in: Document the new print functions.
testsuite/
* lib/stap_run.exp: Make sure to match the entire output, in case
there are multiple pass/fail messages.
* buildok/printf.stp: Add lines for new print variants.
* parseko/printd01.stp: Make sure that bad printd calls are handled.
* parseko/printd02.stp: Ditto.
* parseko/printd03.stp: Ditto.
* parseko/printd04.stp: Ditto.
* systemtap.base/print.stp: Try a bunch of different print calls.
* systemtap.base/print.exp: Driver for above.
|
|
|
|
| |
* staptree.cxx (probe_point::print): Remove stray output.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 4529
* coveragedb.cxx: New.
* coveragedb.h: New.
* Makefile.am: Add coveragedb.cxx and sqlite3 to build.
* Makefile.in: Regenerated.
* configure.ac: Add test for sqlite3
* configure: Regenerated.
* systemtap.spec.in: Add dependencies for sqlite3/sqlite3-devel.
* elaborate.h, elaborate.cxx
(derived_probe::collect_derivation_chain): New.
(alias_expansion_builder::build): Correct token location.
(semantic_pass_opt[12): Track used and unused variables/functions.
* session.h (tapset_compile_coverage, unused_globals,
unused_probes, unused_functions): New fields.
* staptree.h (unused_locals, probe_point::str): New member.
* staptree.cxx: Ditto.
* main.cxx: Add "-q" tapset coverage option and SYSTEMTAP_COVERAGE env.
|
|
|
|
|
|
| |
PR 4609
From Eugeniy Meshcheryakov <eugen@debian.org>
* staptree.cxx: Add #include <algorithm> for gcc 4.3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 4567.
* staptree.cxx (varuse_collecting_visitor): Add side-effect
result query functions.
* elaborate.cxx (dead_stmtexpr_remover::visit_expr_statement):
Switch to it.
(dead_assignment_remover::visit_assignment): Skip elision of
lvalues with side-effects in index exprs.
* staptree.h: Corresponding changes.
2007-05-30 Frank Ch. Eigler <fche@redhat.com>
PR 4567.
* systemtap.base/optim.stp, optim.exp: New test.
|
|
|
|
|
|
|
|
|
| |
PR 4078 and more, including patch from
Eugeniy Meshcheryakov <eugen@debian.org>:
* Makefile.am (AM_CXXFLAGS, AM_CFLAGS): Add -Wextra -Wall -Werror
consistently.
* Makefile.in: Regenerated.
(*): Many minor warning fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 3671
* parse.cxx (parser::parse_global): Allow a maxsize on global arrays.
* staptree.h (struct vardecl): Add the maxsize field.
* staptree.cxx (vardecl::vardecl): Init. maxsize.
(vardecl::set_arity): Don't allow arity 0 when there's a maxsize.
(vardecl::compatible_arity): Ditto.
(vardecl::print): Include maxsize in output.
(target_symbol::print): Ditto.
* translate.cxx (struct mapvar, mapvar::mapvar): Add maxsize.
(mapvar::init): Init maps with the given maxsize if specified, else
keep using MAXMAPENTRIES.
(mapvar::set): Make the error message give the maxsize.
(mapvar::add): Ditto, and check for overflow on pmap add.
(c_unparser::getmap): Pass the maxsize from the vardecl to mapvar.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 3681.
* staptree.h (struct vardecl): Add a literal 'init' member for the
initialization value of globals.
* staptree.cxx (vardecl::vardecl): Initialize 'init' to NULL.
(vardecl::print): Print global init value during pass-1 output.
* main.cxx (printscript): Print global init values during verbose
pass-2 output.
* parse.cxx (parser::parse_global): Set the initialization literal of
global vardecls.
* translate.cxx (var::init): Don't unconditionally override the value
of numeric globals when the module_param isn't used.
(c_unparser::emit_global_param): Write numeric module_params directly
into the global variable, as an int64_t instead of long.
(c_unparser::emit_global): Add initialization to global declarations.
Don't create a temp module_param long for numeric globals anymore.
runtime/
* runtime.h (param_set_int64_t, param_get_int64_t,
param_check_int64_t): New functions to allow taking module parameters
directly as int64_t values.
testsuite/
* systemtap.base/global_init.exp, systemtap.base/global_init.stp: New
test for checking the timeliness of global initialization.
|
|
|
|
|
|
|
| |
* staptree.cxx (print_format::components_to_string): Quote ".
(c_unparser::visit_print_format): Don't use lex_cast_qstring
as it overdoes \ quoting. Resemble ::visit_literal_string
instead.
|
|
|
|
|
|
| |
* util.h (lex_cast_qstring): Move def'n here. Also quote \.
(stringify, lex_cast, lex_cast_hex): Move defn here.
* buildrun.cxx, elaborate.cxx, main.cxx, staptree.cxx: Adapt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added "limit EXP" support to foreach statements.
* translate.cxx (c_tmpcounter::visit_foreach_loop): Handles
"limit" member variable.
(c_unparser::visit_foreach_loop): Ditto.
* staptree.cxx (foreach_loop::print): Prints "limit EXP"
addition.
(traversing_visitor::visit_foreach_loop): Handles "limit" member
variable.
(deep_copy_visitor::visit_foreach_loop): Ditto.
* staptree.h (struct foreach_loop): Added "limit" member
variable.
* stap.1.in: Added documentation for the "limit EXP" addition to
foreach statement.
* parse.cxx (lexer::scan): Added "limit" keyword for foreach
statements.
(parser::parse_foreach_loop): Parses "limit" keyword for foreach
statements.
* elaborate.cxx (symresolution_info::visit_foreach_loop): Handles
"limit" member variable.
(typeresolution_info::visit_foreach_loop): Ditto.
|
|
|
|
|
| |
a new way of allowing user add arbitrary trace data. And also provide
a way of letting user write the trace data format.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 2645.
* stapprobes.5.in: Document "?" probe point suffix.
* parse.cxx (parse_probe_point): Recognize "?" optional suffix.
* elaborate.cxx (derive_probes): Observe probe_point->optional.
* staptree.h, staptree.cxx: Corresponding changes.
* tapsets.cxx (never_derived_probe, never_builder): New classes.
(register_standard_tapsets): Support "never" probe point.
* testsuite/buildok/six.stp, parseok/five.stp: Modifed tests.
* translate.cxx (emit_module_init): Format "-t" (benchmarking)
cycle-time reports similarly to "-v" (verbose) times.
|
|
|
|
|
|
|
|
| |
also changed.
lket_trace_extra() and lket_backtrace() are introduced for these two purpose.
I also modified lket.5.in for the backtrace changes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Organize "-t" output by script/parse level probes rather than
derived-probes.
* elaborate.cxx (derived_probe ctor): Remove name field setting.
(alias_derived_probe): New class.
(alias_expandion_builder::build): Create an instance of the above
instead of parse-tree-level plain probe.
* elaborate.h: Corresponding changes.
(derived_probe::basest): Define.
* staptree.cxx (probe ctor): Set new name field.
* staptree.h (probe): Corresponding changes.
(probe::basest): New field.
* tapsets.cxx (emit_probe_prologue, emit_probe_entries):
Switch to basest() probe name for Stat instance.
(dwarf_derived_probe ctor): Stash away base probe.
* translate.cxx (unparser::emit_probe): Remove index
operand, just use probe name to generate symbols.
(emit_module_init): Reorganize -t output in unregister functions.
(translate_pass): Remove unparser::current_probenum field and all
uses.
* translate.h: Corresponding changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 2427.
* staptree.cxx (varuse_collecting_visitor::visit_embeddedcode):
Support /* pure */ declaration. Stop using __tvar_ naming hack.
(v_c_u::visit_print_format): Mark sprint and sprintf as
side-effect-free.
(deep_copy_visitor::visit_print_format): Propagate raw_components.
* stap.1.in: Document declaration.
* elaborate.cxx (semantic_pass_opt2): Verbose message tweak.
(dead_stmtexpr_remover): Extend for more aggressive optimization.
* tapsets.cxx (dwarf,mark_var_expanding_copy_visotor): Add
/* pure */ declaration to rvalue expansions.
* tapset/*.stp: Added /* pure */ declarations to many functions.
* testsuite/parseok/unparsers.stp: Propagate guru mode flag.
* testsuite/buildok/twentyfour.stp: New test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add binary printf support.
* elaborate.cxx (visit_print_format): Don't include
conv_literal or conv_size in components vector.
Add conv_binary to switch statement.
* translate.cxx (visit_print_format): Eliminate
special cast to (long long) for pe_long because new
vsnprintf uses int64_t.
* staptree.h (struct print_format): Add conv_binary and conv_size.
* staptree.cxx (components_to_string): Add conv_binary case.
Add conv_size case.
(string_to_components): Add cases for 'b' and 'n'
|
|
|
|
|
|
|
| |
PR 2425
* staptree.cxx (varuse_collecting_visitor::visit_embeddedcode):
Realize that $var-setter functions have side-effects.
* testsuite/transok/tval-opt.stp: New test.
|
|
|
|
|
|
|
|
|
| |
PR 1989. Adds support for %p in printf
* staptree.h (struct print_format): Add conv_unsigned_ptr.
* staptree.cxx (components_to_string): Output 'p'
for conv_unsigned_ptr.
* elaborate.cxx (visit_print_format): Add case for
conv_unsigned_ptr.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stapfuncs.5.in: Document new queue_stats tapset.
* elaborate.cxx (*): Put "while:" clarification messages before a
thrown semantic error.
* staptree.cxx (print_format::string_to_components): Correct
parse of "%%" formatting element.
* queue_stats.stp: New tapset.
* systemtap.samples/queue_demo.*: New test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 2060: lock elevation, mop-up
* staptree.cxx (functioncall_traversing_visitor): Store a
current_function pointer during traversal.
(visit_embeddedcode): Use it to handle $target-synthesized functions.
(varuse_collecting_visitor::visit_assignment): Correct l-lr typo.
(visit_foreach_loop): Note added write on sorted foreach.
(visit_delete_statement): Note as read+write.
* staptree.h: Corresponding changes.
* elaborate.cxx (dead_assignment_remover::visit_expr_statement):
Correct stmt token after possible expression rewriting.
* tapsets.cxx (visit_target_symbol): Create naming convention
to recognize $target-synthesized functions.
* translate.cxx (emit_locks, emit_unlocks): New functions to
emit lock/unlock sequences at the outermost level of a probe.
(emit_probe): Call them.
(varlock_*): #if-0 out the lock code generation. Later, these
classes should be removed.
(translate_pass): Emit read_trylock() kludge macro for old kernels.
|