]> sourceware.org Git - systemtap.git/commit
Introduce runtime optimizations for statistical computations per PR10234.
authorMartin Cermak <mcermak@redhat.com>
Wed, 5 Oct 2016 06:59:42 +0000 (08:59 +0200)
committerMartin Cermak <mcermak@redhat.com>
Wed, 5 Oct 2016 07:31:26 +0000 (09:31 +0200)
commit26382d613f4d266f74ddb3d3f3f36aceab171e14
tree30ea0f26e0c1fc12baff531a967e3934adb6317e
parent7f892dd153858f4bc705d2fcf6b7ee1bb5946967
Introduce runtime optimizations for statistical computations per PR10234.

This update improves the performance of systemtap runtime statistical
computations by optimizing out unneeded parts of the __stp_stat_add()
function.  It is based on parametrizing and inlining it.  The stap
translator now generates _stp_stat_add(), or _stp_pmap_add_*() calls
that have additional "optimization" parameters respective to stats
in use for given global.  GCC uses this for optimizing the inlined
__stp_stat_add() calls.

The optimization effect significantly depends on compiler version,
platform architecture, and the stat operators being used for given
global.  At the moment, the available stat operators are @count,
@sum, @min, @max, @avg, and @variance. The most computionally
expensive is @variance.  The effect of optimizing @variance is
significant.  Other stat operators are computionally chap and so
the effect of their optimizations is relatively low.

Using gcc-6.2.1-1.fc26.x86_64, the @count, @sum, @min, and @max
optimizations brings approximately 8% run time shrinkage. The
@variance optimization shrinkage is up to 70% using this compiler.
For other architectures, namely for power, the optimization is less
effective.

runtime/map-gen.c: Pass the additional optimization parameters through
the map API generator macros.
runtime/map.c: Modify _new_map_set_stat() to accept optimization
        additional parameters.
runtime/map.h: Ditto.
runtime/pmap-gen.c: Pass the additional optimization parameters to
__stp_map_set*() and to _stp_pmap_add*().
runtime/stat-common.c: Add optimization params to __stp_stat_add().
runtime/stat.c: Add optimization params to _stp_stat_add().
tapsets.cxx: Generate parametrized calls to the runtime.
translate.cxx: Ditto.
testsuite/systemtap.base/optim_stats*: New testcase.
runtime/map-gen.c
runtime/map.c
runtime/map.h
runtime/pmap-gen.c
runtime/stat-common.c
runtime/stat.c
tapsets.cxx
testsuite/systemtap.base/optim_stats.exp [new file with mode: 0644]
testsuite/systemtap.base/optim_stats1.stp [new file with mode: 0644]
testsuite/systemtap.base/optim_stats2.stp [new file with mode: 0644]
translate.cxx
This page took 0.605126 seconds and 5 git commands to generate.