patch-2.4.21 linux-2.4.21/include/asm-ia64/perfmon.h
Next file: linux-2.4.21/include/asm-ia64/pgalloc.h
Previous file: linux-2.4.21/include/asm-ia64/pci.h
Back to the patch index
Back to the overall index
- Lines: 144
- Date:
2003-06-13 07:51:38.000000000 -0700
- Orig file:
linux-2.4.20/include/asm-ia64/perfmon.h
- Orig date:
2002-11-28 15:53:15.000000000 -0800
diff -urN linux-2.4.20/include/asm-ia64/perfmon.h linux-2.4.21/include/asm-ia64/perfmon.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001-2002 Hewlett-Packard Co
+ * Copyright (C) 2001-2003 Hewlett-Packard Co
* Stephane Eranian <eranian@hpl.hp.com>
*/
@@ -40,11 +40,13 @@
#define PFM_FL_INHERIT_ALL 0x02 /* always clone pfm_context across fork() */
#define PFM_FL_NOTIFY_BLOCK 0x04 /* block task on user level notifications */
#define PFM_FL_SYSTEM_WIDE 0x08 /* create a system wide context */
+#define PFM_FL_EXCL_IDLE 0x20 /* exclude idle task from system wide session */
/*
* PMC flags
*/
#define PFM_REGFL_OVFL_NOTIFY 0x1 /* send notification on overflow */
+#define PFM_REGFL_RANDOM 0x2 /* randomize sampling interval */
/*
* PMD/PMC/IBR/DBR return flags (ignored on input)
@@ -85,9 +87,12 @@
unsigned long reg_long_reset; /* reset after sampling buffer overflow (large) */
unsigned long reg_short_reset;/* reset after counter overflow (small) */
- unsigned long reg_reset_pmds[4]; /* which other counters to reset on overflow */
+ unsigned long reg_reset_pmds[4]; /* which other counters to reset on overflow */
+ unsigned long reg_random_seed; /* seed value when randomization is used */
+ unsigned long reg_random_mask; /* bitmask used to limit random value */
+ unsigned long reg_last_reset_value;/* last value used to reset the PMD (PFM_READ_PMDS) */
- unsigned long reserved[16]; /* for future use */
+ unsigned long reserved[13]; /* for future use */
} pfarg_reg_t;
typedef struct {
@@ -104,6 +109,31 @@
} pfarg_features_t;
/*
+ * Entry header in the sampling buffer.
+ * The header is directly followed with the PMDS saved in increasing index
+ * order: PMD4, PMD5, .... How many PMDs are present is determined by the
+ * user program during context creation.
+ *
+ * XXX: in this version of the entry, only up to 64 registers can be recorded
+ * This should be enough for quite some time. Always check sampling format
+ * before parsing entries!
+ *
+ * In the case where multiple counters overflow at the same time, the
+ * last_reset_value member indicates the initial value of the PMD with
+ * the smallest index. For instance, if PMD2 and PMD5 have overflowed,
+ * the last_reset_value member contains the initial value of PMD2.
+ */
+typedef struct {
+ int pid; /* identification of process */
+ int cpu; /* which cpu was used */
+ unsigned long last_reset_value;/* initial value of overflowed counter */
+ unsigned long stamp; /* timestamp (unique per CPU) */
+ unsigned long ip; /* where did the overflow interrupt happened */
+ unsigned long regs; /* bitmask of which registers overflowed */
+ unsigned long period; /* unused */
+} perfmon_smpl_entry_t;
+
+/*
* This header is at the beginning of the sampling buffer returned to the user.
* It is exported as Read-Only at this point. It is directly followed by the
* first record.
@@ -120,7 +150,7 @@
* Define the version numbers for both perfmon as a whole and the sampling buffer format.
*/
#define PFM_VERSION_MAJ 1U
-#define PFM_VERSION_MIN 0U
+#define PFM_VERSION_MIN 3U
#define PFM_VERSION (((PFM_VERSION_MAJ&0xffff)<<16)|(PFM_VERSION_MIN & 0xffff))
#define PFM_SMPL_VERSION_MAJ 1U
@@ -131,35 +161,15 @@
#define PFM_VERSION_MAJOR(x) (((x)>>16) & 0xffff)
#define PFM_VERSION_MINOR(x) ((x) & 0xffff)
-/*
- * Entry header in the sampling buffer.
- * The header is directly followed with the PMDS saved in increasing index
- * order: PMD4, PMD5, .... How many PMDs are present is determined by the
- * user program during context creation.
- *
- * XXX: in this version of the entry, only up to 64 registers can be recorded
- * This should be enough for quite some time. Always check sampling format
- * before parsing entries!
- *
- * Inn the case where multiple counters have overflowed at the same time, the
- * rate field indicate the initial value of the first PMD, based on the index.
- * For instance, if PMD2 and PMD5 have ovewrflowed for this entry, the rate field
- * will show the initial value of PMD2.
- */
-typedef struct {
- int pid; /* identification of process */
- int cpu; /* which cpu was used */
- unsigned long rate; /* initial value of overflowed counter */
- unsigned long stamp; /* timestamp */
- unsigned long ip; /* where did the overflow interrupt happened */
- unsigned long regs; /* bitmask of which registers overflowed */
- unsigned long period; /* sampling period used by overflowed counter (smallest pmd index) */
-} perfmon_smpl_entry_t;
-
-extern int perfmonctl(pid_t pid, int cmd, void *arg, int narg);
#ifdef __KERNEL__
+extern long perfmonctl(pid_t pid, int cmd, void *arg, int narg);
+
+typedef struct {
+ void (*handler)(int irq, void *arg, struct pt_regs *regs);
+} pfm_intr_handler_desc_t;
+
extern void pfm_save_regs (struct task_struct *);
extern void pfm_load_regs (struct task_struct *);
@@ -171,8 +181,22 @@
extern int pfm_use_debug_registers(struct task_struct *);
extern int pfm_release_debug_registers(struct task_struct *);
extern int pfm_cleanup_smpl_buf(struct task_struct *);
-extern void pfm_syst_wide_update_task(struct task_struct *, int);
-extern void perfmon_init_percpu(void);
+extern void pfm_syst_wide_update_task(struct task_struct *, unsigned long info, int is_ctxswin);
+extern void pfm_init_percpu(void);
+
+/*
+ * hooks to allow VTune/Prospect to cooperate with perfmon.
+ * (reserved for system wide monitoring modules only)
+ */
+extern int pfm_install_alternate_syswide_subsystem(pfm_intr_handler_desc_t *h);
+extern int pfm_remove_alternate_syswide_subsystem(pfm_intr_handler_desc_t *h);
+
+/*
+ * describe the content of the local_cpu_date->pfm_syst_info field
+ */
+#define PFM_CPUINFO_SYST_WIDE 0x1 /* if set a system wide session exist on the CPU */
+#define PFM_CPUINFO_DCR_PP 0x2 /* if set a system wide session started on the CPU */
+#define PFM_CPUINFO_EXCL_IDLE 0x4 /* system wide session excludes the idle task */
#endif /* __KERNEL__ */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)