The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Devel::ContinuousProfiler - Ultra cheap profiling for use in production

VERSION

version 0.12

SYNOPSIS

    use Devel::ContinuousProfiler;
    ...
    # Automatic, periodic printing of profiling stats:

DESCRIPTION

This module automatically takes periodic snapshots of the callstack and prints reports of the hottest code. The CPU cost of doing the profiling work is automatically scaled to about 1/1024th the total.

The report format:

  =<pid>= <process name> profiling stats.
  =<pid>= <count> <frame>,<frame>,<frame>,...
  =<pid>= <count> <frame>,<frame>,<frame>,...
  =<pid>= <count> <frame>,<frame>,...
  ...

An example of some output gleaned from a very short script:

  =10203= eg/sample.pl profiling stats.
  =10203= 11
  =10203=  6 X::a,X::b
  =10203=  4 X::a
  =10203=  4 X::a,X::b,X::c
  =10203=  2 X::a,X::b,X::c,X::d

PUBLIC API

The PROFILER environment variable and the frame_format and output_handle functions. Ultimately, replace the take_snapshot function if you want to get different reports.

Consult the source and this API is still under active development.

CAVEATS

  • This module's public API is under active development and experimentation.

  • CPAN testers is showing segfaults. Not sure what's going on there yet.

INTERNAL API

I'm only mentioning these

count_down
is_inside_logger
log_size
take_snapshot
report
report_strings