summaryrefslogtreecommitdiffstats
path: root/translate.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
* 2006-05-15 Frank Ch. Eigler <fche@elastic.org>fche2006-05-161-5/+5
| | | | | | | | | * tapsets.cxx, translator.cxx (*): Designate more emitted functions as static. * translator.cxx (visit_print_format): Correct regression regression from two weeks ago. * stapfuncs.5.in: Tweak wording. Deprecate returnval() in favour of retval().
* Print out information to make it easier to determine which probewcohen2006-05-091-2/+7
| | | | in script associated with timing information.
* 2006-05-05 David Smith <dsmith@redhat.com>dsmith2006-05-051-1/+8
| | | | | * translate.cxx (mapvar::exists): Added code for string array handling. Otherwise, string array elements always exist.
* Move closing '}' inside #ifdef.wcohen2006-05-021-1/+1
|
* "-t" option to collect information the number of times a probe runs andwcohen2006-05-021-0/+32
| | | | the average amount of time spent in the probe.
* 2006-05-01 Frank Ch. Eigler <fche@elastic.org>fche2006-05-011-3/+4
| | | | | * translate.cxx (visit_print_format): Fix regression in "printf" pseudo-result initialization.
* 2006-04-30 Frank Ch. Eigler <fche@elastic.org>fche2006-05-011-78/+60
| | | | | | | | | | | | | | | PR 2610. * translate.cxx (c_unparser::visit_arrayindex, visit_stat_op): Detect empty aggregates consistently. (visit_print_format): Ditto. Also detect errors due to argument evaluation. (translator_output::*): Add a flush before a failing assert, to produce more context when debugging. 2006-05-01 Frank Ch. Eigler <fche@elastic.org> * systemtap.maps/absentstats.*: Rewrite. * systemtap.maps/ix_clear*.exp: Update error message.
* 2006-04-23 Eugene Teo <eteo@redhat.com>eteo2006-04-231-2/+8
| | | | | | PR 2149 * translate.cxx (mapvar::set): Test _stp_map_set_xx() for array overflows.
* 2006-04-21 Eugene Teo <eteo@redhat.com>eteo2006-04-221-3/+10
| | | | | | PR 1326 * translate.cxx (c_unparser::visit_binary_expression): Handle negative left and right shift count.
* 2006-04-21 Frank Ch. Eigler <fche@elastic.org>fche2006-04-211-7/+9
| | | | | | | | | | | | | | | | | PR 953 * elaborate.h (derived_probe): Add field "name". Stop passing "probe index" to other emit_* calls. (emit_probe_context_vars): New member function. * elaborate.cxx (derived_probe ctor): Generate unique name. * translate.cxx (*): Adapt to index->name. (emit_probe): Realize that probe locals only occur at nesting=0. * tapsets.cxx (*derived_probe::emit_*): Adapt to index->name. (mark_var_expanding_copy_visitor): New class to process $argN. (mark_derived_probe ctor): Call it. (mark_derived_probe::emit_probe_context_vars): Do it. * buildrun.cxx (compile_pass): Add more optional gcc verbosity. Add CFLAGS += -freorder-blocks. * testsuite/buildok/marker.stp: New test.
* 2006-04-18 Frank Ch. Eigler <fche@elastic.org>fche2006-04-181-13/+47
| | | | | | | | | | | | | | | | | PR 2220 * translate.cxx (visit_statement): Tolerate 0 first argument. (visit_for_loop, visit_foreach_loop): Call it thusly for condition expression. (visit_embededcode, visit_block, visit_null_statement): Don't call visit_statement() at all. 2006-04-18 Frank Ch. Eigler <fche@elastic.org> * conversions.stp (string, hex_string): Use snprintf for safety. 2006-04-18 Frank Ch. Eigler <fche@elastic.org> * systemtap.samples/control_limits.stp: Adapt to new action counting.
* 2006-04-12 Martin Hunt <hunt@redhat.com>hunt2006-04-121-1/+5
| | | | | | | PR 2497 * translate.cxx (translate_pass): Don't reset STP_STRING_SIZE if it was already defined. Set it to 1024 by default.
* 2006-04-10 Martin Hunt <hunt@redhat.com>hunt2006-04-111-1/+1
| | | | | * translate.cxx (visit_print_format): Call _stp_snprintf() instead of snprintf().
* 2006-04-09 Martin Hunt <hunt@redhat.com>hunt2006-04-101-15/+1
| | | | | | | | | | | | | | | | | | 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'
* 2006-03-29 Josh Stone <joshua.i.stone@intel.com>jistone2006-03-301-0/+1
| | | | | | | | | | | * tapsets.cxx (hrtimer_derived_probe::*): creates a probe point based on the hrtimer APIs. * tapsets.cxx (hrtimer_builder::*): parses the user's time-spec into a 64-bit nanosecond value, and calls the appropriate derived_probe. * tapsets.cxx (register_standard_tapsets): add hrtimer bindings * translate.cxx (translate_pass): add linux/random.h include, used for generating 64-bit random numbers for hrtimers.
* 2006-03-13 Frank Ch. Eigler <fche@elastic.org>fche2006-03-131-4/+4
| | | | | * translate.cxx (emit_globals): Tag globals, especially the locks, as __cacheline_aligned.
* 2006-03-09 Frank Ch. Eigler <fche@elastic.org>fche2006-03-091-0/+3
| | | | | * translate.cxx (emit_locks): Emit dummy references to unlock_ ... (emit_module_init): ... and probe_point.
* 2006-02-25 Frank Ch. Eigler <fche@elastic.org>fche2006-02-251-11/+40
| | | | | | | * translate.cxx (var::init): Don't crush string module_params. (emit_global_param): New function, forked out of emit_global, to put module_param calls at the bottom of C file. * translate.h: Corresponding changes.
* 2006-02-23 Frank Ch. Eigler <fche@elastic.org>fche2006-02-231-5/+28
| | | | | | | | | | | | | | | PR 1304 * parse.cxx (lexer): Take systemtap_session argument. (lexer::scan): Support $1..$NNNN and @1...@NNNN expansion. * stap.1.in: Document this. * testsuite/semok/args.stp: New test. * translate.cxx (var::init, emit_global): Emit code to allow named module parameters to initialize global string/number scalars. * stap.1.in: Don't document this yet. PR 2334 * main.cxx (main): Clarify "-v" option repeatibility. * stap.1.in: Ditto.
* 2006-02-15 Frank Ch. Eigler <fche@elastic.org>fche2006-02-151-143/+21
| | | | | * translate.cxx (varlock*): Removed now unnecessary class. (aggregation_locks): Renamed field to aggregations_active.
* 2006-01-31 Josh Stone <joshua.i.stone@intel.com>jistone2006-01-311-1/+1
| | | | | | PR 2252 * translate.cxx (translate_pass): Fix legacy definition of read_trylock.
* 2006-01-27 Frank Ch. Eigler <fche@elastic.org>fche2006-01-281-5/+5
| | | | | | | | * main.cxx: Make "-v" (verbose) flag a counter. * stap.1.in: Document this. * session.h: Corresponding changes. * {elaborate,buildrun,tapsets,translate}.cxx: Update all uses of verbose flag to compare it to sensible level for value of message.
* 2006-01-26 Frank Ch. Eigler <fche@elastic.org>fche2006-01-261-8/+133
| | | | | | | | | | | | | | | | | | | | | 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.
* 2006-01-24 Frank Ch. Eigler <fche@elastic.org>fche2006-01-241-28/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 2060 etc. * tapsets.cxx (visit_target_symbol): Tolerate failed resolution by letting target_symbol instance pass through to optimizer and type checker. * elaborate.cxx (semantic_pass_optimize): New family of functions and associated visitor classes. (visit_for_loop): Tolerate absent init/incr clauses. (semantic_pass): Invoke unless unoptimized (-u) option given. * main.cxx, session.h: Add support for flag. * staptree.cxx (visit_for_loop): Tolerate absent init/incr clauses. (traversing_visitor::visit_arrayindex): Visit the index expressions. (functioncall_traversing_visitor): New class. (varuse_tracking_visitor): New class. * staptree.h: Corresponding changes. * parse.cxx (parse_for_loop): Represent absent init/incr expressions with null statement pointer instead of optimized-out dummy numbers. * stap.1.in: Document optimization. * testsuite/{semko,transko}/*.stp: Added "-u" or other code to many tests to check bad code without optimizer elision. * testsuite/semok/optimize.stp: New test. * elaborate.cxx (unresolved, invalid, mismatch): Standardize error message wording. * stapfuncs.5.in: Tweak print/printf docs. * tapset/logging.stp: Remove redundant "print" auxiliary function, since it's a translator built-in. * testsuite/transok/five.stp: Extend test. * translate.cxx (emit_symbol_data): Put symbol table into a separate temporary header file, to make "-p3" output easier on the eyes. * buildrun.cxx (compile_pass): Eliminate test-mode support throughout. * main.cxx, session.h, translate.cxx: Ditto. * main.cxx (main): For last-pass=2 runs, print post-optimization ASTs.
* 2006-01-18 Josh Stone <joshua.i.stone@intel.com>jistone2006-01-181-1/+1
| | | | | * translate.cxx (c_unparser::visit_foreach_loop): improved the error message when _stp_pmap_agg fails.
* 2006-01-18 Frank Ch. Eigler <fche@elastic.org>fche2006-01-181-4/+5
| | | | | * translate.cxx (c_unparser_assignment::visit_arrayindex): Eliminate dummy assignments for "<<<" code.
* 2006-01-17 Josh Stone <joshua.i.stone@intel.com>jistone2006-01-181-4/+10
| | | | | | PR 2156 * translate.cxx (c_unparser::visit_foreach_loop): Check the return value of _stp_pmap_agg() for NULL.
* 2006-01-17 Frank Ch. Eigler <fche@elastic.org>fche2006-01-171-16/+60
| | | | | | | | | | | PR 2142 * translate.cxx (EXTRACTORS_PERMISSIVE): New experimental policy parameter. (c_unparser::visit_arrayindex, visit_print_format, visit_stat_op): Tolerate absent index (= NULL runtime return) in pmap. (*): Make semantic_error messages consistently lower case. * testsuite/buildok/iterate_histogram_buckets.stp: Note some missing functionality.
* 2006-01-16 Josh Stone <joshua.i.stone@intel.com>jistone2006-01-161-10/+81
| | | | | | | | | | | | | | | | | | PR 2140 * translate.cxx (mapvar::del): Add ability to delete an indexed stat from (p)maps. (delete_statement_operand_visitor::visit_symbol): Add ability to delete entire pmaps and scalars. (delete_statement_operand_tmp_visitor): Add a special tmpvar visitor to parallel delete_statement_operand_visitor. (c_tmpcounter::visit_delete_statement): Invoke the new visitor. * testsuite/buildok/delete.stp: Also test scalar deletes. * vim/syntax/stap.vim: Recognize 'delete' operator. 2006-01-16 Josh Stone <joshua.i.stone@intel.com> * stat.c (_stp_stat_clear): add a function that just clears a Stat, so we can use delete in the translator.
* 2006-01-15 Frank Ch. Eigler <fche@elastic.org>fche2006-01-151-1/+1
| | | | | | | | PR 2148 * translate.cxx (MAXERRORS): Actually the max should be 0, so first error aborts session. * Revert last stp_exit change.
* 2006-01-13 Frank Ch. Eigler <fche@elastic.org>fche2006-01-131-1/+1
| | | | * translate.cxx (c_unparser:getmap): Correct exception throwing typo.
* 2006-01-12 Josh Stone <joshua.i.stone@intel.com>jistone2006-01-131-15/+87
| | | | | | | | | | | | | | | | | | | PR 2056 * translate.cxx (c_unparser::aggregation_locks): Keeps track of foreach's locks on pmaps to avoid extra aggregation. (c_unparser::visit_foreach_loop): Set aggregation_locks appropriately. (c_unparser::load_aggregate, mapvar::call_prefix, mapvar::get): Use a new parameter to indicate that we should read from the already-aggregated map rather than the full pmap.. (c_unparser::visit_arrayindex c_unparser::visit_print_format, c_unparser::visit_stat_op): Use aggregation_locks to avoid taking a lock and aggregating the pmap. (c_unparser::emit_map_type_instantiations): To read from a pmap's aggregated map, we need to include map-gen.c for the _stp_map_* functions. (c_unparser::obtained_locks, varlock::varlock, varlock::~varlock): Add simple static checking to detect incompatible nested locks during translation, and flag it as an error.
* 2006-01-11 Frank Ch. Eigler <fche@elastic.org>fche2006-01-111-1/+1
| | | | * translate.cxx (MAXERRORS): Oops, set back to intended default of 1.
* 2006-01-10 Frank Ch. Eigler <fche@redhat.com>fche2006-01-101-45/+68
| | | | | | | | | | | | | PR 2060. * buildrun.cxx (compile_pass): Add "V=1" to kbuild if verbose. * translate.cxx (translator_output): For output-file constructor, set an explicit output buffer. (emit_module_init, emit_module_exit): Reorganize output, to spit each individual probe registration/deregistration blurb into a separate function. * translate.h: Corresponding changes; set default buffer size to 8K. * translate.cxx, tapsets.cxx: Replace "endl" by buffer-friendly "\n" throughout code generation routines.
* 2006-01-05 Josh Stone <joshua.i.stone@intel.com>jistone2006-01-051-13/+47
| | | | | | | | | | | | | PR 2056 * translate.cxx (var::~var, var::hist, var::buckets): make these methods virtual, so we can use polymorphism. (mapvar::hist, mapvar::buckets): Override the corresponding var methods to handle pmaps correctly. (c_unparser::visit_arrayindex, c_unparser::visit_print_format): Make use of the new polymorphic behavior of var & mapvar when dealing with histogram data. * testsuite/buildok/pmap_foreach.stp: Add tests to check histogram accesses with for/foreach.
* 2006-01-04 Frank Ch. Eigler <fche@elastic.org>fche2006-01-041-3/+3
| | | | | | PR 2057. * translate.cxx (c_unparser_assignment::visit_arrayindex): Don't take write lock around pmap accumulation.
* 2006-01-03 Frank Ch. Eigler <fche@redhat.com>fche2006-01-031-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR 1144, 1379 * tapsets.cxx (emit_probe_prologue, _epilogue): New routines. Call from existing derived_probe spots. Implement soft errors in epilogue code. Implement reentrancy detection in prologue code. (dwarf_derived_probe::emit_deregistration): Add kprobes layer "nmissed" to skipped_count. * translate.cxx (varlock): Use nsleep(TRYLOCKDELAY) in lock contention loop. (emit_module_exit): Report number of soft errors and skipped probes. (emit_function, _probe): Add __restrict__ marker to context pointer. (translate_pass): Define new MAXTRYLOCK, TRYLOCKDELAY, MAXERRORS, MAXSKIPPED parameters. * tapset/logging.stp (error): Don't stp_error, just set context state. * stap.1.in, stapfuncs.5.in: Document soft errors. * elaborate.h: Corresponding changes. 2006-01-03 Frank Ch. Eigler <fche@redhat.com> * io.c (_stp_softerror): New function. 2006-01-03 Frank Ch. Eigler <fche@redhat.com> * systemtap.base/timers.exp: Extend the test run duration. Accept skipped probe warnings at shutdown.
* 2005-12-21 Josh Stone <joshua.i.stone@intel.com>jistone2005-12-211-1/+4
| | | | * translate.cxx (itervar::next): emit different code for pmaps
* 2005-12-12 Frank Ch. Eigler <fche@redhat.com>fche2005-12-121-0/+1
| | | | * translate.cxx (translate_pass): Emit #include <linux/profile.h>.
* 2005-12-12 Frank Ch. Eigler <fche@redhat.com>fche2005-12-121-2/+2
| | | | | | | | | | | | | | | | | Fix parse tree pretty-printer. * staptree.h (print_format): Add raw_components field. * parse.cxx (parse_symbol): Set it. * staptree.cxx (lex_cast_qstring): Copy it here too. (binary_expression::print): Add a space around operator, due to lexical ambiguity (expr % paren-expr) vs %( preprocessor op. (array_in:: foreach_loop:: arrayindex::print): Print base as indexable. (print_format::string_to_components): Use parse_error, not semantic. (print_format::print): Properly quote formatting string. Print histogram argument. * translate.cxx (visit_print_format): Properly quote formatting string. (varlock): Reword lock timeout error message. * testsuite/buildok/printf.stp: Add some quoting troublemakers. * testsuite/parseok/unparser.stp: New file.
* 2005-12-08 Graydon Hoare <graydon@redhat.com>graydon2005-12-091-6/+17
| | | | | | | | | * translate.cxx (delete_statement_operand_visitor::visit_arrayindex): Prohibit deleting histogram buckets. (c_tmpcounter::visit_array_in): Direct to visit_arrayindex. (c_unparser::visit_array_in): Likewise. * testsuite/buildok/histogram_operator_in.stp: New test.
* 2005-12-07 Graydon Hoare <graydon@redhat.com>graydon2005-12-081-39/+86
| | | | | | | | | | | | * staptree.cxx (traversing_visitor::visit_foreach_loop): Visit the base indexable of the foreach loop. * translate.cxx (c_tmpcounter::visit_foreach_loop): Implement histogram bucket iteration arm. (c_unparser::visit_foreach_loop): Likewise. (c_tmpcounter::visit_arrayindex): Fix typo. * testsuite/buildok/iterate_histogram_buckets.stp: New test.
* 2005-12-07 Martin Hunt <hunt@redhat.com>hunt2005-12-071-4/+14
| | | | | * translate.cxx (mapvar::fini): Use _stp_pmap_del() on pmaps. (emit_global): For pmaps, use "PMAP" instead of "MAP".
* 2005-12-06 Graydon Hoare <graydon@redhat.com>graydon2005-12-071-1/+13
| | | | | * translate.cxx (visit_print_format): Explicitly Cast int64_t (pe_long) args to (long long) in generated code, for portability.
* 2005-12-05 Frank Ch. Eigler <fche@elastic.org>fche2005-12-051-0/+1
| | | | * *.cxx: Add <cassert> #include as needed.
* 2005-12-02 Graydon Hoare <graydon@redhat.com>graydon2005-12-021-44/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * elaborate.cxx (mutated_var_collector): Forward traversal portion of calls to base class. (mutated_var_collector::visit_arrayindex): Resolve arrayindex-into-histogram expression as pe_long. (typeresolution_info::visit_print_format): Traverse into histogram if present. * parse.cxx (parse_symbol): Handle parse ambiguity surrounding print(@hist_op(...)[...]). * staptree.cxx (traversing_visitor::visit_arrayindex): Visit base member of arrayindex. * translate.cxx (c_unparser::histogram_index_check): New method. (var::hist): Fix bug. (var::buckets): New method. (stmt_expr::stmt_expr): Print with newline. (c_unparser::load_map_indices): Handle indexing-histogram case. (c_tmpcounter::visit_arrayindex): Likewise. (c_unparser::visit_arrayindex): Likewise. (c_tmpcounter_assignment::visit_arrayindex): Throw error when user attempts to write to histogram bucket. (c_unparser_assignment::visit_arrayindex): Likewise. * testsuite/buildok/print_histogram_entry.stp: New test.
* 2005-12-01 Frank Ch. Eigler <fche@elastic.org>fche2005-12-021-2/+22
| | | | | | PR 1944 improved hack. * translator.cxx (c_tmpcounter::visit_block): New routine, allows overlay of sequential statements' temporaries within context.
* 2005-12-01 Frank Ch. Eigler <fche@redhat.com>fche2005-12-011-4/+5
| | | | | | | | | | | | | PR 1944 quick hack. * translator.cxx (translate_pass): Reduce default MAXNESTING to 10. (emit_module_init): Add a paranoid check against oversize contexts. * stap.1.in: Document MAXNESTING change. 2005-12-01 Frank Ch. Eigler <fche@redhat.com> PR 1944 quick hack. * testsuite/systemtap.sample/control_limits.*: Adapt to new MAXNESTING default.
* [ChangeLog]graydon2005-11-291-97/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-11-28 Graydon Hoare <graydon@redhat.com> * translate.cxx (var::assert_hist_compatible): New method. (var::hist): New method. (c_unparser::load_aggregate): New method. (hist_op_downcaster): Remove, it was a mistake. (expression_is_hist_op): Likewise. (c_tmpcounter::visit_print_format): Implement print(@hist(...)). (c_unparser::visit_print_format): Likewise. * staptree.h (struct print_format): Add optional hist_op* member. * staptree.cxx (traversing_visitor::visit_functioncall): Visit hist_op if present in print_format. (deep_copy_visitor::visit_print_format): Likewise. * parse.cxx (parse_symbol): Special case to consume print(@hist(...)). * elaborate.cxx (typeresolution_info::visit_arrayindex): Fix type inference bug. (typeresolution_info::visit_foreach_loop): Likewise. * testsuite/buildok/print_histograms.stp: New test. [runtime/ChangeLog] 2005-11-28 Graydon Hoare <graydon@redhat.com> * stat-common.c (_stp_stat_print_histogram): Various formatting corrections and aesthetic tweaks. (__stp_stat_add): Correction to linear bucket underflow cases.
* 2005-11-28 Frank Ch. Eigler <fche@redhat.com>fche2005-11-281-1/+3
| | | | | * translate.cxx (c_tmpcounter_assignment::visit_symbol): Don't emit unused temporary into context. Saves mucho space with strings.