|
Packit |
577717 |
.TH LIBPFM 3 "September, 2006" "" "Linux Programmer's Manual"
|
|
Packit |
577717 |
.SH NAME
|
|
Packit |
577717 |
pfm_get_cycle_event, pfm_get_inst_retired_event - get basic event
|
|
Packit |
577717 |
descriptors
|
|
Packit |
577717 |
|
|
Packit |
577717 |
.SH SYNOPSIS
|
|
Packit |
577717 |
.nf
|
|
Packit |
577717 |
.B #include <perfmon/pfmlib.h>
|
|
Packit |
577717 |
.sp
|
|
Packit |
577717 |
.BI "int pfm_get_cycle_event(pfmlib_event_t *"ev ");"
|
|
Packit |
577717 |
.BI "int pfm_get_inst_retired_event(pfmlib_event_t *"ev ");"
|
|
Packit |
577717 |
.sp
|
|
Packit |
577717 |
.SH DESCRIPTION
|
|
Packit |
577717 |
In order to build very simple generic examples that work across
|
|
Packit |
577717 |
all PMU models, the library provides a way to retrieve information
|
|
Packit |
577717 |
about two basic events that are present in most PMU models: cycles
|
|
Packit |
577717 |
and instruction retired. The first event, cycles, counts the number
|
|
Packit |
577717 |
of elapsed cycles. The second event, instruction retired, counts the
|
|
Packit |
577717 |
number of instructions that have executed and retired from the processor
|
|
Packit |
577717 |
pipeline. Depending on the PMU model, there may be variations in the
|
|
Packit |
577717 |
exact definition of those events. The library provides this information
|
|
Packit |
577717 |
on a best effort basis. User must refer to PMU model specific documentation
|
|
Packit |
577717 |
to validate the event definition.
|
|
Packit |
577717 |
.sp
|
|
Packit |
577717 |
The \fBpfm_get_cycle_event()\fR function returns in \fBev\fR the event
|
|
Packit |
577717 |
and optional unit mask descriptors for the event that counts elapsed
|
|
Packit |
577717 |
cycles. Depending on the PMU model, there may be unit mask(s) necessary
|
|
Packit |
577717 |
to count cycles. Application must check the value returned in
|
|
Packit |
577717 |
\fBev->num_masks\fR.
|
|
Packit |
577717 |
|
|
Packit |
577717 |
.sp
|
|
Packit |
577717 |
The \fBpfm_get_inst_retired_event()\fR function returns in \fBev\fR the event
|
|
Packit |
577717 |
and optional unit mask descriptors for the event that counts the number
|
|
Packit |
577717 |
of returned instruction. Depending on the PMU model, there may be unit
|
|
Packit |
577717 |
mask(s) necessary to count retired instructions. Application must check
|
|
Packit |
577717 |
the value returned in \fBev->num_masks\fR.
|
|
Packit |
577717 |
|
|
Packit |
577717 |
.SH RETURN
|
|
Packit |
577717 |
All functions return whether or not the call was successful.
|
|
Packit |
577717 |
A return value of \fBPFMLIB_SUCCESS\fR indicates success,
|
|
Packit |
577717 |
otherwise the value is the error code.
|
|
Packit |
577717 |
.SH ERRORS
|
|
Packit |
577717 |
.B PFMLIB_ERR_NOINIT
|
|
Packit |
577717 |
the library has not been initialized properly.
|
|
Packit |
577717 |
.TP
|
|
Packit |
577717 |
.B PFMLIB_ERR_INVAL
|
|
Packit |
577717 |
the \fBev\fR parameter is NULL.
|
|
Packit |
577717 |
.TP
|
|
Packit |
577717 |
.B PFMLIB_ERR_NOTSUPP
|
|
Packit |
577717 |
the host PMU does not define an event to count cycles or instructions retired.
|
|
Packit |
577717 |
.TP
|
|
Packit |
577717 |
.SH AUTHOR
|
|
Packit |
577717 |
Stephane Eranian <eranian@hpl.hp.com>
|
|
Packit |
577717 |
.PP
|