fche [Wed, 8 Feb 2006 00:47:51 +0000 (00:47 +0000)]
2006-02-07 Frank Ch. Eigler <fche@elastic.org>
* src/testsuite/buildok/syscalls.stp: Build with "-u" to build-test
all auxiliary functions.
* tapsets.cxx (dwarf_query::add_probe_point): Add some "-vv" output.
fche [Sat, 28 Jan 2006 02:42:08 +0000 (02:42 +0000)]
2006-01-27 Frank Ch. Eigler <fche@elastic.org>
* 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.
fche [Thu, 26 Jan 2006 22:55:20 +0000 (22:55 +0000)]
2006-01-26 Frank Ch. Eigler <fche@elastic.org>
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.
fche [Tue, 24 Jan 2006 17:58:02 +0000 (17:58 +0000)]
2006-01-24 Frank Ch. Eigler <fche@elastic.org>
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.
jistone [Mon, 16 Jan 2006 23:40:50 +0000 (23:40 +0000)]
2006-01-16 Josh Stone <joshua.i.stone@intel.com>
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.
jistone [Fri, 13 Jan 2006 03:55:16 +0000 (03:55 +0000)]
2006-01-12 Josh Stone <joshua.i.stone@intel.com>
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.
fche [Tue, 10 Jan 2006 22:32:15 +0000 (22:32 +0000)]
2006-01-10 Frank Ch. Eigler <fche@redhat.com>
PR 1972.
* tapsets.cxx (var_expanding_copy_visitor::visit_target_symbol):
Produce error message for $var access within .return probes.
* testsuite/semko/thirtyfour.stp: New test.
fche [Tue, 10 Jan 2006 18:52:33 +0000 (18:52 +0000)]
2006-01-10 Frank Ch. Eigler <fche@redhat.com>
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.
jistone [Thu, 5 Jan 2006 21:59:21 +0000 (21:59 +0000)]
2006-01-05 Josh Stone <joshua.i.stone@intel.com>
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.
kevinrs [Fri, 23 Dec 2005 21:09:32 +0000 (21:09 +0000)]
2005-12-23 Kevin Stafford <krstaffo@us.ibm.com>
SCRIPTS:
run.sh - This is the driver for automated testing.
To run: ./run.sh stpdirectory c_binaries_directory
Result: log/timestamp.log discerpancy report
ctostp.sh - This script generates corresponding stp probe script
files for every C file found in the input directory.
To Run: ctostp.sh input output where input is the
directory containing the C files to convert. Output
is the directory to store the corresponding stp
files.
build.sh - This script expedites the process of compiling all
of the c files. When the "compile" flag is given
it creates a directory called bin, which stores the
compiled C programs. ./build.sh clean removes the
binaries, and ./build.sh run attempts to execute all
of the programs in cfiles/bin.
kevinrs [Fri, 23 Dec 2005 20:38:22 +0000 (20:38 +0000)]
2005-12-23 Kevin Stafford <krstaffo@us.ibm.com>
* tapset/2.6.9-20.ELsmp/syscalls.stp: added kernel
version tapset
* tapset/2.6.9-20.ELsmp/i686/syscalls.stp: added kernel
version arch specific tapset
* tapset/doc/dicrepancies.txt: log of kernel version
discrepancies.
kevinrs [Fri, 23 Dec 2005 20:37:59 +0000 (20:37 +0000)]
2005-12-23 Kevin Stafford <krstaffo@us.ibm.com>
* tapset/2.6.9-20.ELsmp/syscalls.stp: added kernel
version tapset
* tapset/2.6.9-20.ELsmp/i686/syscalls.stp: added kernel
version arch specific tapset
* tapset/doc/dicrepancies.txt: log of kernel version
discrepancies.
askeshav [Fri, 16 Dec 2005 00:27:52 +0000 (00:27 +0000)]
Anil S Keshavamurthy - Blacklist'ing notifier_call_chain() function, as this
function is on kprobes critical path, having probes on this will damage the
system.
hunt [Wed, 14 Dec 2005 21:10:14 +0000 (21:10 +0000)]
2005-12-14 Martin Hunt <hunt@redhat.com>
* tapset/system_calls.stp (epoll.ctl): Temporarily remove
references to $op and $event because gcc 4.0.2 can't
find them.
(epoll.wait): Ditto for $maxevents.
hunt [Wed, 14 Dec 2005 21:06:57 +0000 (21:06 +0000)]
2005-12-14 Martin Hunt <hunt@redhat.com>
* pmap-gen.c (_stp_pmap_new_*): Initialize lock.
(_stp_pmap_set_*): Lock map while in use.
(_stp_pmap_add_*): Lock map while in use.
(_stp_pmap_get_cpu): Ditto.
(_stp_pmap_get): Lock each per-cpu map.
* map-gen.c: Define and use NULLRET for a NULL return value.
* map.c (_stp_pmap_clear): New function.
(_stp_pmap_agg): Lock each per-cpu map as
it gets aggregated.
jistone [Mon, 12 Dec 2005 23:42:21 +0000 (23:42 +0000)]
2005-12-12 Josh Stone <joshua.i.stone@intel.com>
* tapsets.cxx (profile_derived_probe::*,profile_builder::build): Do kernel
version checks at translation time, using the same internal mechanisms as
the preprocessor - a la %( kernel_v < "2.6.10" %? ... %: ... %)
jistone [Mon, 12 Dec 2005 22:19:12 +0000 (22:19 +0000)]
2005-12-12 Josh Stone <joshua.i.stone@intel.com>
* tapset/context.stp (execname,pid,tid,ppid,pexecname,gid,egid,uid,euid):
Removed in_interrupt checks and other pointer checks. We now operate on
the assumption that "current" and its related data are always valid.
fche [Mon, 12 Dec 2005 17:39:53 +0000 (17:39 +0000)]
2005-12-12 Frank Ch. Eigler <fche@redhat.com>
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.
roland [Mon, 12 Dec 2005 05:52:08 +0000 (05:52 +0000)]
2005-12-11 Roland McGrath <roland@redhat.com>
PR 1916
* configure.ac: Grok --with-elfutils.
* Makefile.am [BUILD_ELFUTILS] (install-elfutils, stamp-elfutils):
New targets.
[BUILD_ELFUTILS] (stap_LDFLAGS, stap_LDFLAGS): Add flags
to point at local elfutils build.
[BUILD_ELFUTILS] (BUILT_SOURCES): Add stamp-elfutils.
[BUILD_ELFUTILS] (stap_DEPENDENCIES): New variable.
[BUILD_ELFUTILS] (lib-elfutils/libdw.so): New target.
[BUILD_ELFUTILS] (install-exec-local): Depend on install-elfutils.
(loc2c_test_LDADD): Set this to $(stap_LDADD).
(loc2c_test_CPPFLAGS, loc2c_test_LDFLAGS): New variables.
* Makefile.in: Regenerated.
* compile: New file from automakeland.
* systemtap.spec.in (elfutils_version): Require 0.118 or later.
[bundled_elfutils]: Remove old hacks for building elfutils, and rely
on configure --with-elfutils instead.
roland [Mon, 12 Dec 2005 05:52:00 +0000 (05:52 +0000)]
2005-12-11 Roland McGrath <roland@redhat.com>
PR 1916
* configure.ac: Grok --with-elfutils.
* Makefile.am [BUILD_ELFUTILS] (install-elfutils, stamp-elfutils):
New targets.
[BUILD_ELFUTILS] (stap_LDFLAGS, stap_LDFLAGS): Add flags
to point at local elfutils build.
[BUILD_ELFUTILS] (BUILT_SOURCES): Add stamp-elfutils.
[BUILD_ELFUTILS] (stap_DEPENDENCIES): New variable.
[BUILD_ELFUTILS] (lib-elfutils/libdw.so): New target.
[BUILD_ELFUTILS] (install-exec-local): Depend on install-elfutils.
(loc2c_test_LDADD): Set this to $(stap_LDADD).
(loc2c_test_CPPFLAGS, loc2c_test_LDFLAGS): New variables.
* Makefile.in: Regenerated.
* compile: New file from automakeland.
* systemtap.spec.in (elfutils_version): Require 0.118 or later.
[bundled_elfutils]: Remove old hacks for building elfutils, and rely
on configure --with-elfutils instead.
* Makefile.am (pkglibexecdir): New variable.
(AM_CPPFLAGS): Use it.
(pkglibexec_PROGRAMS): Set this instead of noinst_PROGRAMS with stpd.
(pkglibexec_SCRIPTS, CLEANFILES): New variables.
(install-exec-local): Target removed.
* runtest.sh: Set LD_LIBRARY_PATH when lib-elfutils is in use.
roland [Mon, 12 Dec 2005 05:51:54 +0000 (05:51 +0000)]
2005-12-11 Roland McGrath <roland@redhat.com>
* configure.ac: Bump version to 0.5.1 for test builds.
* systemtap.spec.in: Remove ExclusiveArch.
* configure: Regenerated.
PR 1916
* configure.ac: Grok --with-elfutils.
* Makefile.am [BUILD_ELFUTILS] (install-elfutils, stamp-elfutils):
New targets.
[BUILD_ELFUTILS] (stap_LDFLAGS, stap_LDFLAGS): Add flags
to point at local elfutils build.
[BUILD_ELFUTILS] (BUILT_SOURCES): Add stamp-elfutils.
[BUILD_ELFUTILS] (stap_DEPENDENCIES): New variable.
[BUILD_ELFUTILS] (lib-elfutils/libdw.so): New target.
[BUILD_ELFUTILS] (install-exec-local): Depend on install-elfutils.
(loc2c_test_LDADD): Set this to $(stap_LDADD).
(loc2c_test_CPPFLAGS, loc2c_test_LDFLAGS): New variables.
* Makefile.in: Regenerated.
* compile: New file from automakeland.
* systemtap.spec.in (elfutils_version): Require 0.118 or later.
[bundled_elfutils]: Remove old hacks for building elfutils, and rely
on configure --with-elfutils instead.