The Gaudi Framework  master (37c0b60a)
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  { 0xd1, 0x39, 0xb2, 0x9e, 0x62, 0xe8, 0x40, 0xe4, 0xb4, 0x02, 0x73, 0x07, 0x87, 0x92, 0xe9, 0x37 }
29 #endif
30 
31 /*
32  * format specific parameters (passed at context creation)
33  */
34 typedef struct {
35  uint64_t buf_size; /* size of the buffer in bytes */
36  uint32_t buf_flags; /* buffer specific flags */
37  uint32_t res1; /* for future use */
38  uint64_t reserved[6]; /* for future use */
40 
41 /*
42  * This header is at the beginning of the sampling buffer returned to the user.
43  * It is directly followed by the first record.
44  */
45 typedef struct {
46  uint64_t hdr_count; /* how many valid entries */
47  uint64_t hdr_cur_offs; /* current offset from top of buffer */
48  uint64_t hdr_overflows; /* #overflows for buffer */
49  uint64_t hdr_buf_size; /* bytes in the buffer */
50  uint64_t hdr_min_buf_space; /* minimal buffer size (internal use) */
51  uint32_t hdr_version; /* smpl format version */
52  uint32_t hdr_buf_flags; /* copy of buf_flags */
53  uint64_t hdr_reserved[10]; /* for future use */
55 
56 /*
57  * Entry header in the sampling buffer. The header is directly followed
58  * with the values of the PMD registers of interest saved in increasing
59  * index order: PMD4, PMD5, and so on. How many PMDs are present depends
60  * on how the session was programmed.
61  *
62  * In the case where multiple counters overflow at the same time, multiple
63  * entries are written consecutively.
64  *
65  * last_reset_value member indicates the initial value of the overflowed PMD.
66  */
67 typedef struct {
68  uint32_t pid; /* thread id (for NPTL, this is gettid()) */
69  uint16_t ovfl_pmd; /* index of pmd that overflowed for this sample */
70  uint16_t reserved; /* for future use */
71  uint64_t last_reset_val; /* initial value of overflowed PMD */
72  uint64_t ip; /* where did the overflow interrupt happened */
73  uint64_t tstamp; /* overflow timetamp */
74  uint16_t cpu; /* cpu on which the overfow occured */
75  uint16_t set; /* event set active when overflow ocurred */
76  uint32_t tgid; /* thread group id (for NPTL, this is getpid()) */
78 
79 #define PFM_DFL_SMPL_VERSION_MAJ 1U
80 #define PFM_DFL_SMPL_VERSION_MIN 0U
81 #define PFM_DFL_SMPL_VERSION ( ( ( PFM_DFL_SMPL_VERSION_MAJ & 0xffff ) << 16 ) | ( PFM_DFL_SMPL_VERSION_MIN & 0xffff ) )
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /* __PERFMON_DFL_SMPL_H__ */
pfm_dfl_smpl_hdr_t::hdr_version
uint32_t hdr_version
Definition: perfmon_dfl_smpl.h:51
pfm_dfl_smpl_arg_t::buf_size
uint64_t buf_size
Definition: perfmon_dfl_smpl.h:35
pfm_dfl_smpl_entry_t::tgid
uint32_t tgid
Definition: perfmon_dfl_smpl.h:76
pfm_dfl_smpl_arg_t::buf_flags
uint32_t buf_flags
Definition: perfmon_dfl_smpl.h:36
pfm_dfl_smpl_entry_t::last_reset_val
uint64_t last_reset_val
Definition: perfmon_dfl_smpl.h:71
pfm_dfl_smpl_hdr_t::hdr_cur_offs
uint64_t hdr_cur_offs
Definition: perfmon_dfl_smpl.h:47
pfm_dfl_smpl_hdr_t::hdr_overflows
uint64_t hdr_overflows
Definition: perfmon_dfl_smpl.h:48
pfm_dfl_smpl_entry_t::cpu
uint16_t cpu
Definition: perfmon_dfl_smpl.h:74
pfm_dfl_smpl_entry_t
Definition: perfmon_dfl_smpl.h:67
pfm_dfl_smpl_arg_t::res1
uint32_t res1
Definition: perfmon_dfl_smpl.h:37
pfm_dfl_smpl_entry_t::set
uint16_t set
Definition: perfmon_dfl_smpl.h:75
perfmon.h
pfm_dfl_smpl_hdr_t::hdr_min_buf_space
uint64_t hdr_min_buf_space
Definition: perfmon_dfl_smpl.h:50
pfm_dfl_smpl_hdr_t
Definition: perfmon_dfl_smpl.h:45
pfm_dfl_smpl_entry_t::pid
uint32_t pid
Definition: perfmon_dfl_smpl.h:68
pfm_dfl_smpl_hdr_t::hdr_buf_size
uint64_t hdr_buf_size
Definition: perfmon_dfl_smpl.h:49
pfm_dfl_smpl_entry_t::reserved
uint16_t reserved
Definition: perfmon_dfl_smpl.h:70
pfm_dfl_smpl_entry_t::ip
uint64_t ip
Definition: perfmon_dfl_smpl.h:72
pfm_dfl_smpl_arg_t
Definition: perfmon_dfl_smpl.h:34
pfm_dfl_smpl_entry_t::tstamp
uint64_t tstamp
Definition: perfmon_dfl_smpl.h:73
pfm_dfl_smpl_entry_t::ovfl_pmd
uint16_t ovfl_pmd
Definition: perfmon_dfl_smpl.h:69
pfm_dfl_smpl_hdr_t::hdr_count
uint64_t hdr_count
Definition: perfmon_dfl_smpl.h:46
pfm_dfl_smpl_hdr_t::hdr_buf_flags
uint32_t hdr_buf_flags
Definition: perfmon_dfl_smpl.h:52