| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 */
41 } pfm_dfl_smpl_arg_t;
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 */
56 } pfm_dfl_smpl_hdr_t;
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()) */
79 } pfm_dfl_smpl_entry_t;
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__ */
pfm_dfl_smpl_arg_t::buf_size
uint64_t buf_size
Definition: perfmon_dfl_smpl.h:37
pfm_dfl_smpl_arg_t::buf_flags
uint32_t buf_flags
Definition: perfmon_dfl_smpl.h:38
pfm_dfl_smpl_hdr_t::hdr_buf_flags
uint32_t hdr_buf_flags
Definition: perfmon_dfl_smpl.h:54
pfm_dfl_smpl_hdr_t::hdr_overflows
uint64_t hdr_overflows
Definition: perfmon_dfl_smpl.h:50
pfm_dfl_smpl_entry_t::cpu
uint16_t cpu
Definition: perfmon_dfl_smpl.h:76
uint64_t
unsigned long long uint64_t
Definition: instrset.h:143
uint16_t
unsigned short int uint16_t
Definition: instrset.h:139
pfm_dfl_smpl_entry_t::ovfl_pmd
uint16_t ovfl_pmd
Definition: perfmon_dfl_smpl.h:71
pfm_dfl_smpl_entry_t::ip
uint64_t ip
Definition: perfmon_dfl_smpl.h:74
pfm_dfl_smpl_entry_t
Definition: perfmon_dfl_smpl.h:69
pfm_dfl_smpl_arg_t::res1
uint32_t res1
Definition: perfmon_dfl_smpl.h:39
pfm_dfl_smpl_entry_t::pid
uint32_t pid
Definition: perfmon_dfl_smpl.h:70
pfm_dfl_smpl_hdr_t
Definition: perfmon_dfl_smpl.h:47
pfm_dfl_smpl_entry_t::last_reset_val
uint64_t last_reset_val
Definition: perfmon_dfl_smpl.h:73
pfm_dfl_smpl_arg_t
Definition: perfmon_dfl_smpl.h:36
pfm_dfl_smpl_hdr_t::hdr_min_buf_space
uint64_t hdr_min_buf_space
Definition: perfmon_dfl_smpl.h:52
pfm_dfl_smpl_hdr_t::hdr_buf_size
uint64_t hdr_buf_size
Definition: perfmon_dfl_smpl.h:51
uint32_t
unsigned int uint32_t
Definition: instrset.h:141
pfm_dfl_smpl_entry_t::tstamp
uint64_t tstamp
Definition: perfmon_dfl_smpl.h:75
pfm_dfl_smpl_entry_t::tgid
uint32_t tgid
Definition: perfmon_dfl_smpl.h:78
pfm_dfl_smpl_hdr_t::hdr_count
uint64_t hdr_count
Definition: perfmon_dfl_smpl.h:48
pfm_dfl_smpl_entry_t::reserved
uint16_t reserved
Definition: perfmon_dfl_smpl.h:72
pfm_dfl_smpl_hdr_t::hdr_version
uint32_t hdr_version
Definition: perfmon_dfl_smpl.h:53
perfmon.h
pfm_dfl_smpl_hdr_t::hdr_cur_offs
uint64_t hdr_cur_offs
Definition: perfmon_dfl_smpl.h:49