4. Type of Handlers

Each feature is responsible for providing its own set of handlers. Types of handler are:

4.1. ext_init Handler

"ext_init" handles initialization of an extended feature. It takes "args" parameter which is passed in through the "oprofiled --ext-feature=< extended-feature-name>:[args]". This handler is executed in the function opd_options() in the file daemon/oprofiled.c .


The ext_init handler is required for all features.

4.2. ext_print_stats Handler

"ext_print_stats" handles the extended feature statistics report. It adds a new section in the OProfile daemon statistics report, which is normally outputed to the file /var/lib/oprofile/samples/oprofiled.log. This handler is executed in the function opd_print_stats() in the file daemon/opd_stats.c.

4.3. ext_sfile Handler

"ext_sfile" contains a set of handlers related to operations on the extended sample files (sample files for events related to extended feature). These operations include create_sfile(), sfile_dup(), close_sfile(), sync_sfile(), and get_file() as defined in daemon/opd_sfile.c. An additional field, odb_t * ext_file, is added to the struct sfile for storing extended sample files information.