Skip to content
  • Chase Douglas's avatar
    tracing: Show sample std dev in function profiling · e330b3bc
    Chase Douglas authored
    
    
    When combined with function graph tracing the ftrace function profiler
    also prints the average run time of functions. While this gives us some
    good information, it doesn't tell us anything about the variance of the
    run times of the function. This change prints out the s^2 sample
    standard deviation alongside the average.
    
    This change adds one entry to the profile record structure. This
    increases the memory footprint of the function profiler by 1/3 on a
    32-bit system, and by 1/5 on a 64-bit system when function graphing is
    enabled, though the memory is only allocated when the profiler is turned
    on. During the profiling, one extra line of code adds the squared
    calltime to the new record entry, so this should not adversly affect
    performance.
    
    Note that the square of the sample standard deviation is printed because
    there is no sqrt implementation for unsigned long long in the kernel.
    
    Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
    LKML-Reference: <1272304925-2436-1-git-send-email-chase.douglas@canonical.com>
    
    [ fixed comment about ns^2 -> us^2 conversion ]
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    e330b3bc