7.0 (revision 7784de1c)
Data Structures | Macros
SCOREP_MetricPlugins.h File Reference

Description of the metric plugin header. For information on how to use metric plugins, please refer to 'Metric Plugins'. More...

#include <stdbool.h>
#include <scorep/SCOREP_MetricTypes.h>

Go to the source code of this file.

Data Structures

struct  SCOREP_Metric_Plugin_Info
 
struct  SCOREP_Metric_Plugin_MetricProperties
 Properties describing a metric. Provided by the get_event_info function. More...
 

Macros

#define SCOREP_METRIC_PLUGIN_ENTRY(_name)
 
#define SCOREP_METRIC_PLUGIN_VERSION   1
 

Detailed Description

Description of the metric plugin header. For information on how to use metric plugins, please refer to 'Metric Plugins'.

Macro Definition Documentation

#define SCOREP_METRIC_PLUGIN_ENTRY (   _name)
Value:
EXTERN SCOREP_Metric_Plugin_Info \
SCOREP_MetricPlugin_ ## _name ## _get_info( void )

Macro used for implementation of the 'get_info' function

Examples:
hello_world.c.
#define SCOREP_METRIC_PLUGIN_VERSION   1

The developer of a metric plugin should provide a README file which explains how to compile, install and use the plugin. In particular, the supported metrics should be described in the README file.

Each metric plugin has to include SCOREP_MetricPlugins.h and implement a 'get_info' function. Therefore, use the SCOREP_METRIC_PLUGIN_ENTRY macro and provide the name of the plugin library as the argument. For example, the metric plugin libexample_plugin.so should use SCOREP_METRIC_PLUGIN_ENTRY( example_plugin ).

It is encouraged to use the "_plugin" suffix on the name to avoid conflicts with existing libraries, e.g., libsensors_plugin.so using the existing libsensors.so.

Mandatory functions

See each function for details.

initialize

Check requirements and initialize the plugin.

get_event_info

A user specifies a SCOREP_METRIC_EXAMPLE_PLUGIN=token1,token2,... This function provides information about the metric(s) corresponding to this token. The total list of metrics returned for all tokens will then be recorded by the plugin.

add_counter

The function is called for and sets each of the metrics to be recorded by the plugin. It provides a unique ID for each metric.

finalize

Clean up the resources used by the metric plugin.

Mandatory variables

run_per

Defines how many threads should record the metrics of a plugin.

sync

Defines synchronicity type of a metric plugin. A metric plugin can

plugin_version

Should be set to SCOREP_METRIC_PLUGIN_VERSION

Depending on the plugin's synchronicity type there are some optional functions and variables.

Optional functions

get_current_value

Used by strictly synchronous metric plugins only. Returns value of requested metric.

get_optional_value

Used by synchronous metric plugins, but not by strictly synchronous ones. This function requests current value of a metric, but it is valid that no value is returned (read: no update for this metric available).

get_all_values

Used by asynchronous metric plugins. This function is used to request values of a asynchronous metric. The metric will return an arbitrary number of timestamp-value-pairs.

set_clock_function

Used by asynchronous metric plugins. This function passes a function to the plugin, which can be used by the plugin to get a Score-P valid timestamp.

Optional variables

delta_t

Defines interval between two calls to update metric value. Ignored for strictly synchronous plugins.Current version of Score-P metric plugin interface

Examples:
hello_world.c.