The following arguments are explicitly passed, or are implicit in the info structure.
EventCode -- event code returned by the function on success
replace -- 1 to replace an existing event, or 0 to prevent accidental replacement
info -- structure containing the event information. Relevant fields in this structure are discussed below.
event_code -- although the value of this event code is not used, the PAPI_PRESET_MASK bit must be set to indicate
that the following event description is for a preset event.
symbol -- name of the preset event. If the event name is found in the table and
replace is non-zero, the event definition will be replaced. If the names do not match a new entry will be created.
derived -- a string value indicating whether and how native event terms are combined to form a preset event.
Possible values include:
NOT_DERIVED: Do nothing; only one native event,
DERIVED_ADD: Add all native events,
DERIVED_CMPD: Event lives in first counter but takes 2 or more native codes,
DERIVED_SUB: Subtract all events from the first event specified,
DERIVED_POSTFIX: Process events based on specified postfix string,
postfix -- a string value containing postfix operations used only for DERIVED_POSTFIX events.
short_descr -- short description of the event
long_descr -- detailed description of the event
event_note -- special information or notes about the event
name -- an array of up to 8 names of native events that make up this preset event.
/*Add a note to a custom definition of PAPI_TOT_INS */
PAPI_event_name_to_code("PAPI_TOT_INS",&EventCode)
if (PAPI_get_event_info(EventCode, &info) != PAPI_OK)
handle_error(1);
strcpy(info.symbol, "MY_TOT_INS");
strcpy(info.note, "This note describes my version of total instructions.");
if (PAPI_set_event_info(&info, EventCode, 0) != PAPI_OK)
handle_error(1);