summaryrefslogtreecommitdiffstats
path: root/sys/sys/pmclog.h
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2007-12-03 11:11:08 +0000
committerjkoshy <jkoshy@FreeBSD.org>2007-12-03 11:11:08 +0000
commit8304a663db3ad44c1f9590aedd446c2f1360dd54 (patch)
tree0a4ddd64acca61be6a7ad712882f91b392d9d4c2 /sys/sys/pmclog.h
parentca4d74c30f1aa58b63eaa10ccf9799785eb6ec5c (diff)
downloadFreeBSD-src-8304a663db3ad44c1f9590aedd446c2f1360dd54.zip
FreeBSD-src-8304a663db3ad44c1f9590aedd446c2f1360dd54.tar.gz
Add userland definitions for parsing callchain records.
Sponsored by: FreeBSD Foundation and Google Inc.
Diffstat (limited to 'sys/sys/pmclog.h')
-rw-r--r--sys/sys/pmclog.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/sys/sys/pmclog.h b/sys/sys/pmclog.h
index 8d1b25c..80ae567 100644
--- a/sys/sys/pmclog.h
+++ b/sys/sys/pmclog.h
@@ -1,7 +1,11 @@
/*-
- * Copyright (c) 2005-2006, Joseph Koshy
+ * Copyright (c) 2005-2007, Joseph Koshy
+ * Copyright (c) 2007 The FreeBSD Foundation
* All rights reserved.
*
+ * Portions of this software were developed by A. Joseph Koshy under
+ * sponsorship from the FreeBSD Foundation and Google, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -51,10 +55,12 @@ enum pmclog_type {
* V2 ABI
*
* The MAP_{IN,OUT} event types obsolete the MAPPING_CHANGE
- * event type of the older (V1) ABI.
+ * event type. The CALLCHAIN event type obsoletes the
+ * PCSAMPLE event type.
*/
PMCLOG_TYPE_MAP_IN,
- PMCLOG_TYPE_MAP_OUT
+ PMCLOG_TYPE_MAP_OUT,
+ PMCLOG_TYPE_CALLCHAIN
};
/*
@@ -90,6 +96,20 @@ enum pmclog_type {
* of 4 byte quantities.
*/
+struct pmclog_callchain {
+ PMCLOG_ENTRY_HEADER
+ uint32_t pl_pid;
+ uint32_t pl_pmcid;
+ uint32_t pl_cpuflags;
+ /* 8 byte aligned */
+ uintptr_t pl_pc[PMC_CALLCHAIN_DEPTH_MAX];
+} __packed;
+
+#define PMC_CALLCHAIN_CPUFLAGS_TO_CPU(CF) (((CF) >> 16) & 0xFFFF)
+#define PMC_CALLCHAIN_CPUFLAGS_TO_USERMODE(CF) ((CF) & PMC_CC_F_USERSPACE)
+#define PMC_CALLCHAIN_TO_CPUFLAGS(CPU,FLAGS) \
+ (((CPU) << 16) | ((FLAGS) & 0xFFFF))
+
struct pmclog_closelog {
PMCLOG_ENTRY_HEADER
};
@@ -185,6 +205,7 @@ struct pmclog_userdata {
} __packed;
union pmclog_entry { /* only used to size scratch areas */
+ struct pmclog_callchain pl_cc;
struct pmclog_closelog pl_cl;
struct pmclog_dropnotify pl_dn;
struct pmclog_initialize pl_i;
OpenPOWER on IntegriCloud