hunt [Tue, 30 Jan 2007 19:18:06 +0000 (19:18 +0000)]
2007-01-30 Martin Hunt <hunt@redhat.com>
* io.c (_stp_vlog): Use dynamic percpu allocations
instead of very wasteful static allocations.
* print.c (_stp_print_init): Do percpu allocations
for io.c.
(_stp_print_cleanup): Free percpu allocations.
* string.c (_stp_sprintf): Overflow check needed
to be >= instead of >.
hunt [Tue, 30 Jan 2007 17:13:46 +0000 (17:13 +0000)]
2007-01-30 Martin Hunt <hunt@redhat.com>
* alloc.c (_stp_alloc_percpu): Don't implement
our own; just call __alloc_percpu with appropriate args
for the OS version.
(_stp_free_percpu): Delete.
* map.c (_stp_map_init): When calling kmalloc_node, first
call cpu_to_node() to get the proper node number.
* stat.c (_stp_stat_del): Call free_percpu()
instead of _stp_free_percpu().
hunt [Mon, 29 Jan 2007 20:42:16 +0000 (20:42 +0000)]
2007-01-29 Martin Hunt <hunt@redhat.com>
* alloc.c (_stp_kmalloc): New function. Call kmalloc
with the coirrect flags and track usage.
(_stp_kzalloc): Ditto.
* map.c: Use new alloc calls.
* print.c: Ditto.
* stat.c: Ditto.
* time.c: Ditto.
jistone [Tue, 23 Jan 2007 02:57:01 +0000 (02:57 +0000)]
2007-01-22 Josh Stone <joshua.i.stone@intel.com>
runtime/
* loc2c-runtime.h (kread, kwrite): Tweaks to work better with
reading and writing pointer values.
testsuite/
* systemtap.base/deref.stp: Rewrite test, and now also check the ability
to read/write pointers.
jistone [Sat, 20 Jan 2007 03:03:42 +0000 (03:03 +0000)]
2007-01-19 Josh Stone <joshua.i.stone@intel.com>
PR 3079
runtime/
* loc2c-runtime.h (kread, kwrite): New macros to safely read/write
values from kernel pointers. This includes a workaround for 64-bit
numbers on i386 platforms.
testsuite/
* systemtap.base/deref.stp: Use the new kread macro that should work
fine with 64-bit numbers on i386 platforms. Also expand the test to
include writes with kwrite.
* systemtap.base/deref.exp: Remove the setup_kfail.
dsmith [Fri, 12 Jan 2007 16:33:16 +0000 (16:33 +0000)]
2007-01-12 David Smith <dsmith@redhat.com>
* tapsets.cxx
(dwarf_var_expanding_copy_visitor::visit_target_symbol): Since
array behavior has changed (setting to 0 no longer deletes the
array element), we delete the internal counter array element when
providing target variable access in return probes.
hunt [Wed, 10 Jan 2007 15:07:25 +0000 (15:07 +0000)]
2007-01-10 Martin Hunt <hunt@redhat.com>
PR 3708
* map.c (str_copy): Check for NULL pointers.
(_new_map_set_int64): Don't check val for 0.
(_new_map_set_str): Don't check val for NULL.
fche [Tue, 2 Jan 2007 04:33:41 +0000 (04:33 +0000)]
2007-01-01 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Bump version to 0.5.12 for release.
* configure: Regenerated.
* NEWS, AUTHORS: Populate & repopulate.
* examples/*: Added several .stp/.txt files from the wiki.
fche [Sat, 30 Dec 2006 04:25:51 +0000 (04:25 +0000)]
2006-12-29 Frank Ch. Eigler <fche@elastic.org>
* tapsets.cxx (*group:emit_module_init): flush stdout less for timing
mode. Also, Set probe_point variable ...
* translate.cxx (emit_module_init): ... so on registration failure, a
usable error message can be generated.
fche [Sat, 30 Dec 2006 03:54:51 +0000 (03:54 +0000)]
2006-12-29 Frank Ch. Eigler <fche@redhat.com>
PR 3523.
* tapsets.cxx (common_probe_entryfn_prologue,epilogue): Restore
support for -t (benchmarking) mode.
* translate.cxx (emit_common_header,emit_module_init):Ditto.
(emit_module_exit,emit_probe): Ditto, with most meat here.
2006-12-29 Frank Ch. Eigler <fche@redhat.com>
PR 3523.
* buildok/fourteen.stp, fourteen-plus.stp: Tweak & add a test.
* systemtap.base/bench.stp: Work around randomized-ordered probes.
* systemtap.base/bench.exp: Tighten output requirements.
jistone [Fri, 22 Dec 2006 22:18:02 +0000 (22:18 +0000)]
2006-12-22 Josh Stone <joshua.i.stone@intel.com>
* stap.1.in: Document how to specify the size of global arrays.
testsuite/
* buildok/array_size.stp, parseko/array01.stp, parseko/array02.stp,
parseko/array03.stp, parseko/array04.stp, transko/array01.stp,
systemtap.base/array_size.exp, systemtap.base/array_size.stp:
Tests for specifying the size of global arrays.
jistone [Fri, 22 Dec 2006 02:34:05 +0000 (02:34 +0000)]
2006-12-21 Josh Stone <joshua.i.stone@intel.com>
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.
dsmith [Wed, 20 Dec 2006 15:56:14 +0000 (15:56 +0000)]
2006-12-20 David Smith <dsmith@redhat.com>
PR 3519.
* Makefile.am: Added 'examples' directory to the 'EXTRA_DIST'
variable so that the examples directory will be added to the
distribution directory. Added variables 'SAMPLE_DEST_DIR' and
'SAMPLE_SRC' and target 'dist-add-samples' to copy some of the
testsuite sample scripts to the examples directory when creating a
distribution directory.
* Makefile.in: Regenerated.
* systemtap.spec.in: Added 'examples' directory to the %doc list
so that the examples directory will be installed on a user's
system.
fche [Tue, 19 Dec 2006 22:00:15 +0000 (22:00 +0000)]
2006-12-19 Frank Ch. Eigler <fche@redhat.com>
PR 3522.
* tapsets.cxx (dwflpp::emit_address): Call
_stp_module_relocate only once per session.
Error message cleanup: duplicate elimination etc.
* session.h (saved_errors): Store a set of 'em.
(num_errors): Return set size. Remove old numeric field.
Update all callers.
* elaborate.cxx (systemtap_session::print_errors):
Print each encountered message just once.
* staptree (semantic_error): Make msg2 writeable.
Add a chain field.
* tapsets.cxx (*var_expanding*:visit_target_symbol): Set saved
semantic_error's chain field.
* elaborate.cxx (register_library_aliases, visit_foreach_loop,
visit_functioncall, derive_probes): Plop "while: ..." error
message prefix/suffix right into the semantic_error message string.
* parse.cxx (lexer::scan): Identify erroneous token better
in error message for unresolvable $N/@M command line args.
* util.h (lex_cast_hex): Use std::hex, not std::ios::hex.
2006-12-19 Frank Ch. Eigler <fche@redhat.com>
PR 3522.
* buildok/twentyfive.stp: New test for static $var access.
jistone [Tue, 19 Dec 2006 00:24:32 +0000 (00:24 +0000)]
2006-12-18 Josh Stone <joshua.i.stone@intel.com>
* systemtap.base/deref.exp, systemtap.base/deref.exp: Add a test for
successfully dereferencing pointers of various sizes. This is known to
fail on x86 for 64-bit values -- PR 3079.
dsmith [Mon, 18 Dec 2006 19:32:01 +0000 (19:32 +0000)]
2006-12-18 David Smith <dsmith@redhat.com>
* lket/b2a/Makefile.in: Regenerated. This needed to be done since
lket/b2a/README was removed but lket/b2a/Makefile.in still had a
reference to it which was causing "make distdir" to fail.
dsmith [Thu, 14 Dec 2006 16:11:41 +0000 (16:11 +0000)]
2006-12-14 David Smith <dsmith@redhat.com>
* tapsets.cxx (struct dwarf_var_expanding_copy_visitor): Added
'return_ts_map' member variable.
(dwarf_var_expanding_copy_visitor::visit_target_symbol):
Optimization. If we've already seen this target variable in this
return probe, return the last replacement (instead of creating a
new replacement).
dsmith [Wed, 13 Dec 2006 20:56:19 +0000 (20:56 +0000)]
2006-12-13 David Smith <dsmith@redhat.com>
* tapsets.cxx (struct dwarf_var_expanding_copy_visitor): Added
'add_probe' member variable. Initialized it in ctor.
(dwarf_var_expanding_copy_visitor::visit_target_symbol):
Optimization. Instead of generating one entry probe per target
variable accessed in a return probe, now just generates one entry
probe for all target variables accessed in a particular return
probe. It does this by creating a new probe in the new
'add_probe' member variable.
(dwarf_derived_probe::dwarf_derived_probe): If add_probe isn't
NULL, make sure it gets derived later.
jistone [Sat, 9 Dec 2006 02:03:58 +0000 (02:03 +0000)]
2006-12-08 Josh Stone <joshua.i.stone@intel.com>
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.
jistone [Fri, 8 Dec 2006 02:17:09 +0000 (02:17 +0000)]
2006-12-07 Josh Stone <joshua.i.stone@intel.com>
PR 3624.
* tapsets.cxx (struct be_derived_probe): Add a new priority parameter
for begin/end probes, and a comparison function for sorting.
(be_builder::build): Parse the priority & pass it to be_derived_probe.
(be_derived_probe_group::emit_module_init, emit_module_exit): Sort the
probe list by priority before emitting any code.
(register_standard_tapsets): Add new begin/end variants.
* parse.cxx (parser::parse_literal): Allow negative numeric literals,
by checking for a '-' unary operator right before a number.
testsuite/
* systemtap.base/be_order.exp, systemtap.base/be_order.stp,
semok/beginend.stp: New tests for begin/end priorities.
* lib/stap_run.exp: Anchor OUTPUT_CHECK_STRING to the end of output.
* systemtap.base/maxactive.exp: Fix to compare output to the end.
* systemtap.base/probefunc.exp: Ditto.
* systemtap.samples/ioblocktest.exp: Ditto.
* systemtap.samples/ioblocktest.stp: Ditto.
* systemtap.samples/tcptest.exp: Ditto.
jistone [Thu, 7 Dec 2006 03:01:42 +0000 (03:01 +0000)]
2006-12-06 Josh Stone <joshua.i.stone@intel.com>
PR 3623.
* tapsets.cxx (timer_derived_probe_group::emit_module_decls): Restart
the timers if we are in STARTING or RUNNING state.
(hrtimer_derived_probe_group::emit_module_decls): Ditto.
(be_derived_probe_group::emit_module_init): indicate error to the rest
of the initialization if any begin probes fail.
* translate.cxx (c_unparser::emit_module_init): Set the global error
state on an initialization error so timers know to shut down.
runtime/
* time.c (stp_timer_reregister): Add a global to control whether the
gettimeofday timer should restart itself, for clean shutdown.
(__stp_time_timer_callback): Check the global.
(_stp_kill_time, _stp_init_time): Set the global.
(_stp_gettimeofday_ns): Switch to preempt_enable_no_resched.
* time.c (__stp_time_cpufreq_callback): Use the cpu# from the notifier.
(_stp_init_time): No need to disable preemption around cpufreq init.