pomp2_user_region_info.h File Reference

This file contains function declarations and structs which handle informations on user defined regions. POMP2_USER_Region_info is used to store these informations. It can be filled with a ctcString by ctcString2UserRegionInfo(). More...

`#include "opari2_region_info.h"`
`#include <stdbool.h>`

Go to the source code of this file.

## Data Structures

struct | POMP2_USER_Region_info
| This struct stores all information on a user defined region, like the name or corresponding source lines. The function ctcString2UserRegionInfo() can be used to fill this struct with data from a ctcString. More...

## Macros

#define | CTC_USER_REGION_TOKENS CTC_USER_Region_name

## Enumerations

enum | POMP2_USER_Region_type

## Functions

void | ctcString2UserRegionInfo (const char ctcString[], POMP2_USER_Region_info *regionInfo)
void | freePOMP2UserRegionInfoMembers (POMP2_USER_Region_info *regionInfo)
const char * | pomp2UserRegionType2String (POMP2_USER_Region_type regionType)

## Detailed Description

This file contains function declarations and structs which handle informations on user defined regions. POMP2_USER_Region_info is used to store these informations. It can be filled with a ctcString by ctcString2UserRegionInfo().

Date
  Started Tue Apr 1 2014

## Macro Definition Documentation

#define CTC_USER_REGION_TOKENS CTC_USER_Region_name

CTC Tokens

## Enumeration Type Documentation

enum POMP2_USER_Region_type

POMP2_USER_Region_type

## Function Documentation

void ctcString2UserRegionInfo | ( | const char | ctcString[],
|  | POMP2_USER_Region_info * | regionInfo
| ) |  |

ctcString2UserRegionInfo() fills the POMP2_USER_Region_info object with data read from the ctcString. If the ctcString does not comply with the specification, the program aborts with exit code 1.

Rationale: ctcString2UserRegionInfo() is used during initialization of the measurement system. If an error occurs, it is better to abort than to struggle with undefined behaviour or guessing the meaning of the broken string.

Note
  Can be called from multiple threads concurrently, assuming malloc is thread-safe.
  ctcString2UserRegionInfo() will assign memory to the members of regionInfo. You are supposed to to release this memory by calling freePOMP2UserRegionInfoMembers().

Parameters

  ctcString

  A string in the format "length*key=value*[key=value]*". The length field is parsed but not used by this implementation. Possible values for key are listed in ctcTokenMap. The string must at least contain values for the keys `regionType`, `sscl` and `escl`. Possible values for the key `regionType` are listed in regionTypesMap. The format for `sscl` resp. `escl` values is `"filename:lineNo1:lineNo2"`.

  regionInfo | must be a valid object

Postcondition
  At least the required attributes (see POMP2_USER_Region_info) are set.
  If `regionType=userRegion` then POMP2_USER_Region_info::mUserRegionName has a value != 0.

void freePOMP2UserRegionInfoMembers | ( | POMP2_USER_Region_info * | regionInfo | ) |

Free the memory of the regionInfo members.

Parameters

  regionInfo | The regioninfo to be freed.

const char* pomp2UserRegionType2String | ( | POMP2_USER_Region_type | regionType | ) |

converts regionType into a string

Parameters

  regionType | The regionType to be converted.

Returns
  string representation of the region type