Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pfm_get_event_next(3) [centos man page]

LIBPFM(3)						     Linux Programmer's Manual							 LIBPFM(3)

NAME
pfm_get_event_next - iterate over events SYNOPSIS
#include <perfmon/pfmlib.h> int pfm_get_event_next(int idx); DESCRIPTION
Events are uniquely identified with opaque integer identifiers. There is no guaranteed order within identifiers. Thus, to list all the events, it is necessary to use iterators. Events are grouped in tables within the libary. A table usually corresponds to a PMU model or family. The library contains support for mul- tiple PMU models, thus it has multiple tables. Based on the host hardware and software environments, tables get activated when the library is initialized via pfm_initialize(). Events from activated tables are called active events. Events from non-activated tables are called supported events. Event identifiers are usually retrieved via pfm_find_event() or when encoding events. To iterate over a list of events for a given PMU model, all that is needed is an initial identifier for the PMU. The first event identifier is usually obainted via pfm_get_pmu_info(). The pfm_get_event_next() function returns the identifier of next supported event after the one passed in idx. This iterator stops when the last event for the PMU is passed as argument, in which case the function returns -1. void list_pmu_events(pfm_pmu_t pmu) { struct pfm_event_info info; struct pfm_pmu_info pinfo; int i, ret; memset(&info, 0, sizeof(info)); memset(&pinfo, 0, sizeof(pinfo)); info.size = sizeof(info); pinfo.size = sizeof(pinfo); ret = pfm_get_pmu_info(pmu, &pinfo); if (ret != PFM_SUCCESS) errx(1, "cannot get pmu info"); for (i = pinfo.first_event; i != -1; i = pfm_get_event_next(i)) { ret = pfm_get_event_info(i, &info); if (ret != PFM_SUCCESS) errx(1, "cannot get event info"); printf("%s Event: %s::%s ", pinfo.present ? "Active" : "Supported", pinfo.name, info.name); } } RETURN
The function returns the identifier of the next supported event. It returns -1 when the argument is already the last event for the PMU. ERRORS
No error code, besides -1, is returned by this function. SEE ALSO
pfm_find_event(3) AUTHOR
Stephane Eranian <eranian@gmail.com> September, 2009 LIBPFM(3)

Check Out this Related Man Page

LIBPFM(3)						     Linux Programmer's Manual							 LIBPFM(3)

NAME
libpfm_intel_snbep_unc_pcu - support for Intel Sandy Bridge-EP Power Controller Unit (PCU) uncore PMU SYNOPSIS
#include <perfmon/pfmlib.h> PMU name: snbep_unc_pcu PMU desc: Intel Sandy Bridge-EP PCU uncore PMU DESCRIPTION
The library supports the Intel Sandy Bridge Power Controller Unit uncore PMU. This PMU model only exists on Sandy Bridge model 45. There is only one PCU PMU per processor socket. MODIFIERS
The following modifiers are supported on Intel Sandy Bridge C-Box uncore PMU: i Invert the meaning of the event. The counter will now count HA cycles in which the event is not occurring. This is a boolean modi- fier e Enable edge detection, i.e., count only when there is a state transition from no occurrence of the event to at least one occurrence. This modifier must be combined with a threshold modifier (t) with a value greater or equal to one. This is a boolean modifier. t Set the threshold value. When set to a non-zero value, the counter counts the number of HA cycles in which the number of occurrences of the event is greater or equal to the threshold. This is an integer modifier with values in the range [0:15]. ff Enable frequency band filtering. This modifier applies only to the UNC_P_FREQ_BANDx_CYCLES events, where x is [0-3]. The modifiers expects an integer in the range [0-255]. The value is interpreted as a frequency value to be multipled by 100Mhz. Thus if the value is 32, then all cycles where the processor is running at 3.2GHz and more are counted. Frequency band filtering There are 3 events which support frequency band filtering, namely, UNC_P_FREQ_BAND0_CYCLES, UNC_P_FREQ_BAND1_CYCLES, UNC_P_FREQ_BAND2_CYCLES, UNC_P_FREQ_BAND3_CYCLES. The frequency filter (available via the ff modifier) is stored into a PMU shared register which hold all 4 possible frequency bands, one per event. However, the library generate the encoding for each event individually because it processes events one at a time. The caller or the underlying kernel interface may have to merge the band filter settings to program the filter register properly. AUTHORS
Stephane Eranian <eranian@gmail.com> August, 2012 LIBPFM(3)
Man Page