Home

Awesome

sspfd

sspfd if a super-simple profiler, able to measure timings with granularity of a single CPU cycle. sspfd gathers the timings and when the application decides to print the data, it does some statistical analysis on the results (i.e., std deviation, abs deviation, clustering of values) and prints the results.
For example, you can use sspfd to measure the latency of acquiring a lock, or of performing an atomic operation on some data.

Installation:

Compile the library using make in the base folder.

Test the installation using sspfd_test (see the available options with ./sspfd_test -h).

Use the interface in sspfd.h and link your application with the libsspfd.a library.

Interface:

SSPFD_DO_TIMINGS should be set to 1 if you want to take measurements, else you can set it to any other value to remove sspfd's functionality (and overhead).

For an example of how to use sspfd, refer to sspfd_test.c.

Interface of sspfd:

Interpreting the results:

The comments prefixed with "#######" explain the results.

<pre> ####### warning for indicating that the correction for sspfd was not stable * warning: avg sspfd correction is 64.6 with std deviation: 47.4%. Recalculating. ####### correction = the cost of a getticks (to get a timestamp) + the cost of storing ####### the timestamps and calculating the interval between two timestamps -- sspfd correction: 64 (std deviation: 1.6%) ####### results ---- statistics: ####### global avg, abs & std dev, num of measurements [00] avg : 1.7 abs dev : 0.8 std dev : 30.4 num : 100000 ####### min & max values [00] min : 0.0 (element: 2) max : 9614.0 (element: 92787) ####### clustering of values around the global avg ####### 0-10% contains values that are in the range [(0.9*avg)..(1.1*avg)] [00] 0-10% : 0 ( 0.0% | avg: -nan | abs dev: -nan | std dev: -nan = -nan%) [00] 10-25% : 38214 ( 38.2% | avg: 2.0 | abs dev: 0.0 | std dev: 0.0 = 0.0%) [00] 25-50% : 43422 ( 43.4% | avg: 1.0 | abs dev: 0.0 | std dev: 0.0 = 0.0%) [00] 50-75% : 0 ( 0.0% | avg: -nan | abs dev: -nan | std dev: -nan = -nan%) [00] 75-100% : 18364 ( 18.4% | avg: 2.6 | abs dev: 1.7 | std dev: 71.0 = 2741.5%) </pre>