summaryrefslogtreecommitdiffstats
path: root/runtime/stat-common.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix regression in statistic operationsAnton Vorontsov2009-12-091-6/+12
| | | | | | | | | | | In commit 98c783852039061db8c1611742660aaded0eab77 ("Use proper types for do_div") I imprudently changed some variables to an unsigned type while in some places the code actually relies on a sign. So, let's be a bit smarter now and use temporary variables. Reported-by: Wenji Huang <wenji.huang@oracle.com> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
* Use proper types for do_divAnton Vorontsov2009-12-011-4/+4
| | | | | | | | | | | | | | | do_div accepts unsigned 64-bit integer type for dividend, signed types would cause do_div's typecheck fail: stat-common.c: In function 'needed_space': stat-common.c:50: error: comparison of distinct pointer types lacks a cast ...same errors in time.c and tapset-timers.cxx's generated code... A fix for time.c is special, on ppc32 cycles_t is 32-bit, so technically we don't need do_div, but since the whole _stp_gettimeofday_ns() operates on 64-bit types we'd better be safe and use uint64_t for the math. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
* fix 32-bit compatibility for @hist_log printingWenji Huang2009-10-191-1/+1
| | | | | * stat-common.c (_stp_stat_print_histogram_buf): Fix HIST_PRINTF parameter passing.
* Refactor some of the histogram printingJosh Stone2009-10-131-56/+29
| | | | | | | * runtime/stat-common.c (reprint_buf): Removed. (_stp_stat_print_histogram_buf): Use a local HIST_PRINTF macro to abstract the buffer management. Also convert reprint_buf calls to either %* formats or simple for-loops.
* PR10257: Add support for sprint[ln](@hist_*).Przemyslaw Pawelczyk2009-10-131-32/+42
| | | | | | | | * parse.cxx (parser::parse_symbol): Add sprint[ln] to @hist_* hack. * runtime/stat-common.c: Replace reprint with new reprint_buf, add more generic _stp_stat_print_histogram_buf and call it from the older one. Also correct some formatting issues. * translate.cxx (c_unparser::visit_print_format): Add sprint case.
* SW5106 Remove old map and histogram formatting codeStan Cox2008-05-291-34/+1
|
* stat-common.c: Allow histogram bucket elision to be turned offmmason2007-10-251-29/+35
| | | | | with -DHIST_ELISION=<negative #>. Also cleaned up looping code to prevent unnecessary interation over non-existent buckets.
* PR 5057: histogram zero elisionfche2007-09-221-0/+36
| | | | | | | | | | | | | | | 2007-09-22 Frank Ch. Eigler <fche@elastic.org> PR 5057. * stat-common.c (_stp_stat_print_histogram): Elide consecutive zero rows beyond 2*STAT_ELISION+1. (STAT_ELISION): New parameter, default 2. 2007-09-22 Frank Ch. Eigler <fche@elastic.org> PR 5057. * systemtap.maps/linear_nearlyempty.*: New test for histogram printing elision.
* 2007-09-21 Martin Hunt <hunt@redhat.com>hunt2007-09-211-25/+63
| | | | | | | | PR 5024 * stat-common.c (_stp_stat_print_histogram): Change overflow and underflow handling for linear histograms. (__stp_stat_add): For linear histograms, use under and over buckets.
* 2007-09-12 Martin Hunt <hunt@redhat.com>hunt2007-09-121-77/+122
| | | | | | | | | | | | | | | | | | | | | | | * map-stat.c (_stp_map_new_hstat_log): Set buckets to HIST_LOG_BUCKETS. (_stp_pmap_new_hstat_log): Ditto. (_stp_map_new_hstat_linear): Call _stp_stat_calc_buckets(). (_stp_pmap_new_hstat_linear): Ditto. * stat.h (STP_MAX_BUCKETS): Define.. (HIST_LOG_BUCKETS): Define. * stat.c (_stp_stat_init): Call _stp_stat_calc_buckets(). * stat-common.c (_stp_stat_calc_buckets): New function. Common bucket calculation and error reporting code. (_stp_bucket_to_val): New function. (_stp_val_to_bucket): Renamed and now handles negative numbers. (_stp_stat_print_histogram): Handle negative values in log histograms. (__stp_stat_add): Cleanup.. * map-gen.c (_stp_map_new): Remove buckets param for HIST_LOG. * pmap-gen.c (_stp_pmap_new): Ditto.
* 2007-07-06 Martin Hunt <hunt@redhat.com>hunt2007-07-061-4/+3
| | | | | | | | * stat-common.c (__stp_stat_add): Fix calculations for linear histogram buckets. * stat.c (_stp_stat_init): Check for interval too small.
* 2007-01-31 Martin Hunt <hunt@redhat.com>hunt2007-01-311-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * string.c (_stp_string_init): Deleted. (_stp_sprintf): Deleted. (_stp_vsprintf): Deleted. (_stp_string_cat_cstr): Deleted. (_stp_string_cat_string): Deleted. (_stp_string_cat_char): Deleted. (_stp_string_ptr): Deleted. (_stp_string_cat): Deleted. (_stp_snprintf): Moved from vsprintf.c. (_stp_vscnprintf): Moved from vsprintf.c. * string.h (STP_STRING_SIZE): Deleted. (STP_NUM_STRINGS): Deleted. Remove all references to type "String". * vsprintf.c (_stp_vscnprintf): Moved to string.c. (_stp_snprintf): Moved to string.c * sym.c (_stp_symbol_sprint): Replaced with _stp_symbol_print, which writes to the print buffer. (_stp_symbol_sprint_basic): Replaced with _stp_symbol_snprint. * runtime.h: Include io.c. * stat-common.c: Use new _stp_print* functions. * stat.c: Ditto. * regs.c: Renamed to regs-ia64.c. * current.c: Renamed regs.c. * regs-ia64.c: New file (renamed from regs.c). * stack.c (_stp_stack_sprint): Renamed _stp_stack_print and now just prints to the print buffer. Calls __stp_stack_print instead of __stp_stack_sprint. (_stp_stack_snprint): New function. Calls _stp_stack_print and then copies the print buffer into a string. (_stp_stack_printj): Deleted. (_stp_ustack_sprint): Deleted. * stack-*.c: Rewritten to print instead of writing to strings. Uses new _stp_print* functions. * print.c (_stp_printf): Create new function instead of macro. (_stp_print): Ditto. (_stp_print_char): New function. * map.c: Use _stp_print() and _stp_print_char() instead of _stp_print_cstr(). * io.c (_stp_vlog): Use _stp_print() instead of _stp_string_cat_cstr(). * copy.c (_stp_string_from_user): Deleted.
* 2006-04-10 Martin Hunt <hunt@redhat.com>hunt2006-04-111-2/+3
| | | | | * stat-common.c (_stp_stat_print_histogram): Write a newline at the end of the histogram.
* [ChangeLog]graydon2005-11-291-24/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-08 Martin Hunt <hunt@redhat.com>hunt2005-11-081-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * map.c (_stp_map_init): New function. Extracted from _stp_map_new() so it can be used in _stp_pmap_new(). (_stp_map_new): Call _stp_map_init(). (_stp_pmap_new): New function. (_stp_pmap_new_hstat_linear): New function. (_stp_pmap_new_hstat_log): New function. (_stp_pmap_del): New function. (_stp_pmap_printn_cpu): New function. (_stp_pmap_printn): New function. (_stp_new_agg): New function. (_stp_add_agg): New function. (_stp_pmap_agg): New function. (_new_map_clear_node): New function. * map.h (struct map_root): Add Hist struct. Add copy and cmp function pointers for pmaps. * stat.h: Remove Stat struct. Replace with Hist struct that is limited to only histogram params. * map-stat.c: Fix up references to histogram params in map_root. * stat-common.c: Ditto. * stat.c: Ditto. * pmap-gen.c: New file. Implements per-cpu maps. * map-gen.c: Minor bug fixes. Use new VAL_IS_ZERO() macro. * alloc.c (vmalloc_node): For NUMA, provide a vmalloc that does node-local allocations. (_stp_alloc_cpu): A version of _stp_alloc() that does node-local allocations. (_stp_valloc): A version of _stp_valloc() that does node-local allocations. (__stp_valloc_percpu): New function. Like alloc_percpu() except uses _stp_valloc(). (_stp_vfree_percpu): New function. Like free_percpu().
* 2005-10-31 Martin Hunt <hunt@redhat.com>hunt2005-10-311-4/+11
| | | | * ALL: Cleanup copyrights.
* 2005-09-09 Martin Hunt <hunt@redhat.com>hunt2005-09-091-4/+2
| | | | | | | | * stat-common.c (_stp_stat_print_valtype): Use _stp_div64(). * arith.c (_stp_div64): Check error before writing to it. Remove check against 32-bit LONG_MIN and -1. That only applies to 64-bit. (_stp_mod64): Ditto.
* 2005-07-01 Martin Hunt <hunt@redhat.com>hunt2005-07-011-2/+1
| | | | | | | | | * probes.c: Convert all _stp_log() calls to either stp_warn() or dbug(). * print.c: Comment out dbug()s. * stat-common.c: Comment out dbug()s.
* 2005-06-18 Martin Hunt <hunt@redhat.com>hunt2005-06-181-0/+229
* counter.c: New file. Counter aggregations. * stat.c: New file. Stat aggregations. * stat.h: Header file for stats. * map-int.c: New file. Support for int64 values. * map-stat.c: New file. Support for stat values. * map-str.c: New file. Support for string values. * map-values.c: Now just includes the necessary map-*.c files. * stat-common.c: New file. Stats stuff common to Stats and maps containing stats. * Doxyfile: Bumped version to 0.6. * README: Renamed README.doc and reorganized.