The Gaudi Framework  v30r3 (a5ef0a68)
perfmon_dfl_smpl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005-2006 Hewlett-Packard Development Company, L.P.
3  * Contributed by Stephane Eranian <eranian@hpl.hp.com>
4  *
5  * This file implements the new dfl sampling buffer format
6  * for perfmon2 subsystem.
7  *
8  * This format is supported used by all platforms. For IA-64, older
9  * applications using perfmon v2.0 MUST use the
10  * perfmon_default_smpl.h
11  */
12 #ifndef __PERFMON_DFL_SMPL_H__
13 #define __PERFMON_DFL_SMPL_H__ 1
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include <perfmon/perfmon.h>
20 
21 #define PFM_DFL_SMPL_NAME "default"
22 
23 #ifdef PFMLIB_OLD_PFMV2
24 /*
25  * UUID for compatibility with perfmon v2.2 (used by Cray)
26  */
27 #define PFM_DFL_SMPL_UUID \
28  { \
29  0xd1, 0x39, 0xb2, 0x9e, 0x62, 0xe8, 0x40, 0xe4, 0xb4, 0x02, 0x73, 0x07, 0x87, 0x92, 0xe9, 0x37 \
30  }
31 #endif
32 
33 /*
34  * format specific parameters (passed at context creation)
35  */
36 typedef struct {
37  uint64_t buf_size; /* size of the buffer in bytes */
38  uint32_t buf_flags; /* buffer specific flags */
39  uint32_t res1; /* for future use */
40  uint64_t reserved[6]; /* for future use */
42 
43 /*
44  * This header is at the beginning of the sampling buffer returned to the user.
45  * It is directly followed by the first record.
46  */
47 typedef struct {
48  uint64_t hdr_count; /* how many valid entries */
49  uint64_t hdr_cur_offs; /* current offset from top of buffer */
50  uint64_t hdr_overflows; /* #overflows for buffer */
51  uint64_t hdr_buf_size; /* bytes in the buffer */
52  uint64_t hdr_min_buf_space; /* minimal buffer size (internal use) */
53  uint32_t hdr_version; /* smpl format version */
54  uint32_t hdr_buf_flags; /* copy of buf_flags */
55  uint64_t hdr_reserved[10]; /* for future use */
57 
58 /*
59  * Entry header in the sampling buffer. The header is directly followed
60  * with the values of the PMD registers of interest saved in increasing
61  * index order: PMD4, PMD5, and so on. How many PMDs are present depends
62  * on how the session was programmed.
63  *
64  * In the case where multiple counters overflow at the same time, multiple
65  * entries are written consecutively.
66  *
67  * last_reset_value member indicates the initial value of the overflowed PMD.
68  */
69 typedef struct {
70  uint32_t pid; /* thread id (for NPTL, this is gettid()) */
71  uint16_t ovfl_pmd; /* index of pmd that overflowed for this sample */
72  uint16_t reserved; /* for future use */
73  uint64_t last_reset_val; /* initial value of overflowed PMD */
74  uint64_t ip; /* where did the overflow interrupt happened */
75  uint64_t tstamp; /* overflow timetamp */
76  uint16_t cpu; /* cpu on which the overfow occured */
77  uint16_t set; /* event set active when overflow ocurred */
78  uint32_t tgid; /* thread group id (for NPTL, this is getpid()) */
80 
81 #define PFM_DFL_SMPL_VERSION_MAJ 1U
82 #define PFM_DFL_SMPL_VERSION_MIN 0U
83 #define PFM_DFL_SMPL_VERSION ( ( ( PFM_DFL_SMPL_VERSION_MAJ & 0xffff ) << 16 ) | ( PFM_DFL_SMPL_VERSION_MIN & 0xffff ) )
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif /* __PERFMON_DFL_SMPL_H__ */
uint16_t cpu
unsigned long long uint64_t
Definition: instrset.h:143
unsigned short int uint16_t
Definition: instrset.h:139
uint16_t ovfl_pmd
uint64_t ip
uint32_t pid
uint64_t last_reset_val
unsigned int uint32_t
Definition: instrset.h:141
uint64_t tstamp
uint32_t tgid
uint16_t reserved