PAPI 7.1.0.0
Loading...
Searching...
No Matches
perfmon_default_smpl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2002-2006 Hewlett-Packard Development Company, L.P.
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
4 *
5 * This file implements the old default sampling buffer format
6 * for the perfmon2 subsystem. It works ONLY with perfmon v2.0
7 * on IA-64 systems.
8 */
9#ifndef __PERFMON_DEFAULT_SMPL_H__
10#define __PERFMON_DEFAULT_SMPL_H__ 1
11
12#ifndef __ia64__
13#error "you should not be using this file on a non IA-64 platform"
14#endif
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define PFM_DEFAULT_SMPL_UUID { \
21 0x4d, 0x72, 0xbe, 0xc0, 0x06, 0x64, 0x41, 0x43, 0x82, 0xb4, 0xd3, 0xfd, 0x27, 0x24, 0x3c, 0x97}
22
23/*
24 * format specific parameters (passed at context creation)
25 */
26typedef struct {
27 unsigned long buf_size; /* size of the buffer in bytes */
28 unsigned int flags; /* buffer specific flags */
29 unsigned int res1; /* for future use */
30 unsigned long reserved[2]; /* for future use */
32
33/*
34 * combined context+format specific structure. Can be passed
35 * to PFM_CONTEXT_CREATE
36 */
37typedef struct {
41
42/*
43 * This header is at the beginning of the sampling buffer returned to the user.
44 * It is directly followed by the first record.
45 */
46typedef struct {
47 uint64_t hdr_count; /* how many valid entries */
48 uint64_t hdr_cur_offs; /* current offset from top of buffer */
49 uint64_t dr_reserved2; /* reserved for future use */
50
51 uint64_t hdr_overflows; /* how many times the buffer overflowed */
52 uint64_t hdr_buf_size; /* how many bytes in the buffer */
53
54 uint32_t hdr_version; /* contains perfmon version (smpl format diffs) */
55 uint32_t hdr_reserved1; /* for future use */
56 uint64_t hdr_reserved[10]; /* for future use */
58
59/*
60 * Entry header in the sampling buffer. The header is directly followed
61 * with the values of the PMD registers of interest saved in increasing
62 * index order: PMD4, PMD5, and so on. How many PMDs are present depends
63 * on how the session was programmed.
64 *
65 * In the case where multiple counters overflow at the same time, multiple
66 * entries are written consecutively.
67 *
68 * last_reset_value member indicates the initial value of the overflowed PMD.
69 */
70typedef struct {
71 pid_t pid; /* thread id (for NPTL, this is gettid()) */
72 uint8_t reserved1[3]; /* for future use */
73 uint8_t ovfl_pmd; /* index of pmd that overflowed for this sample */
74 uint64_t last_reset_val; /* initial value of overflowed PMD */
75 unsigned long ip; /* where did the overflow interrupt happened */
76 uint64_t tstamp; /* overflow timetamp */
77 uint16_t cpu; /* cpu on which the overfow occured */
78 uint16_t set; /* event set active when overflow ocurred */
79 pid_t tgid; /* thread group id (for NPTL, this is getpid()) */
81
82#define PFM_DEFAULT_MAX_PMDS 64 /* how many pmds supported by data structures (sizeof(unsigned long) */
83#define PFM_DEFAULT_MAX_ENTRY_SIZE (sizeof(pfm_default_smpl_entry_t)+(sizeof(unsigned long)*PFM_DEFAULT_MAX_PMDS))
84#define PFM_DEFAULT_SMPL_MIN_BUF_SIZE (sizeof(pfm_default_smpl_hdr_t)+PFM_DEFAULT_MAX_ENTRY_SIZE)
85
86#define PFM_DEFAULT_SMPL_VERSION_MAJ 2U
87#define PFM_DEFAULT_SMPL_VERSION_MIN 0U
88#define PFM_DEFAULT_SMPL_VERSION (((PFM_DEFAULT_SMPL_VERSION_MAJ&0xffff)<<16)|(PFM_DEFAULT_SMPL_VERSION_MIN & 0xffff))
89
90#ifdef __cplusplus
91};
92#endif
93
94#endif /* __PERFMON_DEFAULT_SMPL_H__ */
uint16_t reserved
pfm_default_smpl_arg_t buf_arg
uint16_t cpu
pid_t pid
pid_t tgid
uint64_t tstamp
uint64_t last_reset_val
uint16_t set
uint8_t ovfl_pmd
unsigned long ip