2 * Copyright (C) 2002-2003 Hewlett-Packard Co
3 * Stephane Eranian <eranian@hpl.hp.com>
5 * This file implements the default sampling buffer format
6 * for Linux/ia64 perfmon subsystem.
8 #ifndef __PERFMON_DEFAULT_SMPL_H__
9 #define __PERFMON_DEFAULT_SMPL_H__ 1
11 #define PFM_DEFAULT_SMPL_UUID { \
12 0x4d, 0x72, 0xbe, 0xc0, 0x06, 0x64, 0x41, 0x43, 0x82, 0xb4, 0xd3, 0xfd, 0x27, 0x24, 0x3c, 0x97}
15 * format specific parameters (passed at context creation)
18 unsigned long buf_size; /* size of the buffer in bytes */
19 unsigned long reserved[3]; /* for future use */
20 } pfm_default_smpl_arg_t;
23 * combined context+format specific structure. Can be passed
24 * to PFM_CONTEXT_CREATE
27 pfarg_context_t ctx_arg;
28 pfm_default_smpl_arg_t buf_arg;
29 } pfm_default_smpl_ctx_arg_t;
32 * This header is at the beginning of the sampling buffer returned to the user.
33 * It is directly followed by the first record.
36 unsigned long hdr_count; /* how many valid entries */
37 void *hdr_cur_pos; /* current position in the buffer */
38 void *hdr_last_pos; /* first byte beyond buffer */
40 unsigned long hdr_overflows; /* how many times the buffer overflowed */
41 unsigned long hdr_buf_size; /* how many bytes in the buffer */
42 unsigned int hdr_version; /* contains perfmon version (smpl format diffs) */
43 unsigned int hdr_reserved1; /* for future use */
44 unsigned long hdr_reserved[10]; /* for future use */
45 } pfm_default_smpl_hdr_t;
48 * Entry header in the sampling buffer. The header is directly followed
49 * with the PMDs saved in increasing index order: PMD4, PMD5, .... How
50 * many PMDs are present depends on how the session was programmed.
52 * XXX: in this version of the entry, only up to 64 registers can be
53 * recorded. This should be enough for quite some time. Always check
54 * sampling format before parsing entries!
56 * In the case where multiple counters overflow at the same time, the
57 * last_reset_value member indicates the initial value of the
58 * overflowed PMD with the smallest index. For instance, if PMD2 and
59 * PMD5 have overflowed, the last_reset_value member contains the
60 * initial value of PMD2.
63 int pid; /* current process at PMU interrupt point */
64 int cpu; /* cpu on which the overfow occured */
65 unsigned long last_reset_val; /* initial value of 1st overflowed PMD */
66 unsigned long ip; /* where did the overflow interrupt happened */
67 unsigned long ovfl_pmds; /* which PMDS registers overflowed (64 max) */
68 unsigned long tstamp; /* ar.itc on the CPU that took the overflow */
69 unsigned int set; /* event set active when overflow ocurred */
70 unsigned int reserved1; /* for future use */
71 } pfm_default_smpl_entry_t;
73 #define PFM_DEFAULT_MAX_PMDS 64 /* how many pmds supported by data structures (sizeof(unsigned long) */
74 #define PFM_DEFAULT_MAX_ENTRY_SIZE (sizeof(pfm_default_smpl_entry_t)+(sizeof(unsigned long)*PFM_DEFAULT_MAX_PMDS))
75 #define PFM_DEFAULT_SMPL_MIN_BUF_SIZE (sizeof(pfm_default_smpl_hdr_t)+PFM_DEFAULT_MAX_ENTRY_SIZE)
77 #define PFM_DEFAULT_SMPL_VERSION_MAJ 2U
78 #define PFM_DEFAULT_SMPL_VERSION_MIN 0U
79 #define PFM_DEFAULT_SMPL_VERSION (((PFM_DEFAULT_SMPL_VERSION_MAJ&0xffff)<<16)|(PFM_DEFAULT_SMPL_VERSION_MIN & 0xffff))
81 #endif /* __PERFMON_DEFAULT_SMPL_H__ */