|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* Copyright (c) 2002-2006 Hewlett-Packard Development Company, L.P.
|
|
Packit |
577717 |
* Contributed by Stephane Eranian <eranian@hpl.hp.com>
|
|
Packit |
577717 |
*
|
|
Packit |
577717 |
* This file implements the old default sampling buffer format
|
|
Packit |
577717 |
* for the perfmon2 subsystem. It works ONLY with perfmon v2.0
|
|
Packit |
577717 |
* on IA-64 systems.
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#ifndef __PERFMON_DEFAULT_SMPL_H__
|
|
Packit |
577717 |
#define __PERFMON_DEFAULT_SMPL_H__ 1
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#ifndef __ia64__
|
|
Packit |
577717 |
#error "you should not be using this file on a non IA-64 platform"
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#ifdef __cplusplus
|
|
Packit |
577717 |
extern "C" {
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define PFM_DEFAULT_SMPL_UUID { \
|
|
Packit |
577717 |
0x4d, 0x72, 0xbe, 0xc0, 0x06, 0x64, 0x41, 0x43, 0x82, 0xb4, 0xd3, 0xfd, 0x27, 0x24, 0x3c, 0x97}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* format specific parameters (passed at context creation)
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
typedef struct {
|
|
Packit |
577717 |
unsigned long buf_size; /* size of the buffer in bytes */
|
|
Packit |
577717 |
unsigned int flags; /* buffer specific flags */
|
|
Packit |
577717 |
unsigned int res1; /* for future use */
|
|
Packit |
577717 |
unsigned long reserved[2]; /* for future use */
|
|
Packit |
577717 |
} pfm_default_smpl_arg_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* combined context+format specific structure. Can be passed
|
|
Packit |
577717 |
* to PFM_CONTEXT_CREATE
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
typedef struct {
|
|
Packit |
577717 |
pfarg_context_t ctx_arg;
|
|
Packit |
577717 |
pfm_default_smpl_arg_t buf_arg;
|
|
Packit |
577717 |
} pfm_default_smpl_ctx_arg_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* This header is at the beginning of the sampling buffer returned to the user.
|
|
Packit |
577717 |
* It is directly followed by the first record.
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
typedef struct {
|
|
Packit |
577717 |
uint64_t hdr_count; /* how many valid entries */
|
|
Packit |
577717 |
uint64_t hdr_cur_offs; /* current offset from top of buffer */
|
|
Packit |
577717 |
uint64_t dr_reserved2; /* reserved for future use */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
uint64_t hdr_overflows; /* how many times the buffer overflowed */
|
|
Packit |
577717 |
uint64_t hdr_buf_size; /* how many bytes in the buffer */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
uint32_t hdr_version; /* contains perfmon version (smpl format diffs) */
|
|
Packit |
577717 |
uint32_t hdr_reserved1; /* for future use */
|
|
Packit |
577717 |
uint64_t hdr_reserved[10]; /* for future use */
|
|
Packit |
577717 |
} pfm_default_smpl_hdr_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* Entry header in the sampling buffer. The header is directly followed
|
|
Packit |
577717 |
* with the values of the PMD registers of interest saved in increasing
|
|
Packit |
577717 |
* index order: PMD4, PMD5, and so on. How many PMDs are present depends
|
|
Packit |
577717 |
* on how the session was programmed.
|
|
Packit |
577717 |
*
|
|
Packit |
577717 |
* In the case where multiple counters overflow at the same time, multiple
|
|
Packit |
577717 |
* entries are written consecutively.
|
|
Packit |
577717 |
*
|
|
Packit |
577717 |
* last_reset_value member indicates the initial value of the overflowed PMD.
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
typedef struct {
|
|
Packit |
577717 |
pid_t pid; /* thread id (for NPTL, this is gettid()) */
|
|
Packit |
577717 |
uint8_t reserved1[3]; /* for future use */
|
|
Packit |
577717 |
uint8_t ovfl_pmd; /* index of pmd that overflowed for this sample */
|
|
Packit |
577717 |
uint64_t last_reset_val; /* initial value of overflowed PMD */
|
|
Packit |
577717 |
unsigned long ip; /* where did the overflow interrupt happened */
|
|
Packit |
577717 |
uint64_t tstamp; /* overflow timetamp */
|
|
Packit |
577717 |
uint16_t cpu; /* cpu on which the overfow occured */
|
|
Packit |
577717 |
uint16_t set; /* event set active when overflow ocurred */
|
|
Packit |
577717 |
pid_t tgid; /* thread group id (for NPTL, this is getpid()) */
|
|
Packit |
577717 |
} pfm_default_smpl_entry_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define PFM_DEFAULT_MAX_PMDS 64 /* how many pmds supported by data structures (sizeof(unsigned long) */
|
|
Packit |
577717 |
#define PFM_DEFAULT_MAX_ENTRY_SIZE (sizeof(pfm_default_smpl_entry_t)+(sizeof(unsigned long)*PFM_DEFAULT_MAX_PMDS))
|
|
Packit |
577717 |
#define PFM_DEFAULT_SMPL_MIN_BUF_SIZE (sizeof(pfm_default_smpl_hdr_t)+PFM_DEFAULT_MAX_ENTRY_SIZE)
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define PFM_DEFAULT_SMPL_VERSION_MAJ 2U
|
|
Packit |
577717 |
#define PFM_DEFAULT_SMPL_VERSION_MIN 0U
|
|
Packit |
577717 |
#define PFM_DEFAULT_SMPL_VERSION (((PFM_DEFAULT_SMPL_VERSION_MAJ&0xffff)<<16)|(PFM_DEFAULT_SMPL_VERSION_MIN & 0xffff))
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#ifdef __cplusplus
|
|
Packit |
577717 |
};
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#endif /* __PERFMON_DEFAULT_SMPL_H__ */
|