Deleted Added
full compact
pmc_events.h (196739) pmc_events.h (197412)
1/*-
2 * Copyright (c) 2005 Joseph Koshy
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2005 Joseph Koshy
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/hwpmc/pmc_events.h 196739 2009-09-01 17:55:37Z gnn $
26 * $FreeBSD: head/sys/dev/hwpmc/pmc_events.h 197412 2009-09-22 17:45:28Z rpaulo $
27 */
28
29#ifndef _DEV_HWPMC_PMC_EVENTS_H_
30#define _DEV_HWPMC_PMC_EVENTS_H_
31
32/*
33 * Note: Documentation on adding events can be found both in
34 * the source tree at src/share/doc/papers/hwpmc/hwpmc.ms

--- 1939 unchanged lines hidden (view full) ---

1974
1975/* timestamp counters. */
1976#define __PMC_EV_TSC() \
1977 __PMC_EV(TSC, TSC)
1978
1979#define PMC_EV_TSC_FIRST PMC_EV_TSC_TSC
1980#define PMC_EV_TSC_LAST PMC_EV_TSC_TSC
1981
27 */
28
29#ifndef _DEV_HWPMC_PMC_EVENTS_H_
30#define _DEV_HWPMC_PMC_EVENTS_H_
31
32/*
33 * Note: Documentation on adding events can be found both in
34 * the source tree at src/share/doc/papers/hwpmc/hwpmc.ms

--- 1939 unchanged lines hidden (view full) ---

1974
1975/* timestamp counters. */
1976#define __PMC_EV_TSC() \
1977 __PMC_EV(TSC, TSC)
1978
1979#define PMC_EV_TSC_FIRST PMC_EV_TSC_TSC
1980#define PMC_EV_TSC_LAST PMC_EV_TSC_TSC
1981
1982
1982/*
1983/*
1984 * Intel XScale events from "Intel XScale Core Developer's Manual",
1985 * January 2004, #27347302
1986 */
1987#define __PMC_EV_XSCALE() \
1988 __PMC_EV(XSCALE, IC_FETCH) \
1989 __PMC_EV(XSCALE, IC_MISS) \
1990 __PMC_EV(XSCALE, DATA_DEPENDENCY_STALL) \
1991 __PMC_EV(XSCALE, ITLB_MISS) \
1992 __PMC_EV(XSCALE, DTLB_MISS) \
1993 __PMC_EV(XSCALE, BRANCH_EXECUTED) \
1994 __PMC_EV(XSCALE, BRANCH_MISPRED) \
1995 __PMC_EV(XSCALE, INSTR_EXECUTED) \
1996 __PMC_EV(XSCALE, DC_FULL_CYCLE) \
1997 __PMC_EV(XSCALE, DC_FULL_CONTIG) \
1998 __PMC_EV(XSCALE, DC_ACCESS) \
1999 __PMC_EV(XSCALE, DC_MISS) \
2000 __PMC_EV(XSCALE, DC_WRITEBACK) \
2001 __PMC_EV(XSCALE, PC_CHANGE)
2002
2003#define PMC_EV_XSCALE_FIRST PMC_EV_XSCALE_IC_FETCH
2004#define PMC_EV_XSCALE_LAST PMC_EV_XSCALE_PC_CHANGE
2005
2006/*
1983 * All known PMC events.
1984 *
1985 * PMC event numbers are allocated sparsely to allow new PMC events to
1986 * be added to a PMC class without breaking ABI compatibility. The
1987 * current allocation scheme is:
1988 *
1989 * START #EVENTS DESCRIPTION
1990 * 0 0x1000 Reserved
1991 * 0x1000 0x0001 TSC
1992 * 0x2000 0x0080 AMD K7 events
1993 * 0x2080 0x0100 AMD K8 events
1994 * 0x10000 0x0080 INTEL architectural fixed-function events
1995 * 0x10080 0x0F80 INTEL architectural programmable events
1996 * 0x11000 0x0080 INTEL Pentium 4 events
1997 * 0x11080 0x0080 INTEL Pentium MMX events
1998 * 0x11100 0x0100 INTEL Pentium Pro/P-II/P-III/Pentium-M events
2007 * All known PMC events.
2008 *
2009 * PMC event numbers are allocated sparsely to allow new PMC events to
2010 * be added to a PMC class without breaking ABI compatibility. The
2011 * current allocation scheme is:
2012 *
2013 * START #EVENTS DESCRIPTION
2014 * 0 0x1000 Reserved
2015 * 0x1000 0x0001 TSC
2016 * 0x2000 0x0080 AMD K7 events
2017 * 0x2080 0x0100 AMD K8 events
2018 * 0x10000 0x0080 INTEL architectural fixed-function events
2019 * 0x10080 0x0F80 INTEL architectural programmable events
2020 * 0x11000 0x0080 INTEL Pentium 4 events
2021 * 0x11080 0x0080 INTEL Pentium MMX events
2022 * 0x11100 0x0100 INTEL Pentium Pro/P-II/P-III/Pentium-M events
2023 * 0x11200 0x00FF INTEL XScale events
1999 */
2000#define __PMC_EVENTS() \
2001 __PMC_EV_BLOCK(TSC, 0x01000) \
2002 __PMC_EV_TSC() \
2003 __PMC_EV_BLOCK(K7, 0x2000) \
2004 __PMC_EV_K7() \
2005 __PMC_EV_BLOCK(K8, 0x2080) \
2006 __PMC_EV_K8() \
2007 __PMC_EV_BLOCK(IAF, 0x10000) \
2008 __PMC_EV_IAF() \
2009 __PMC_EV_BLOCK(IAP, 0x10080) \
2010 __PMC_EV_IAP() \
2011 __PMC_EV_BLOCK(P4, 0x11000) \
2012 __PMC_EV_P4() \
2013 __PMC_EV_BLOCK(P5, 0x11080) \
2014 __PMC_EV_P5() \
2015 __PMC_EV_BLOCK(P6, 0x11100) \
2024 */
2025#define __PMC_EVENTS() \
2026 __PMC_EV_BLOCK(TSC, 0x01000) \
2027 __PMC_EV_TSC() \
2028 __PMC_EV_BLOCK(K7, 0x2000) \
2029 __PMC_EV_K7() \
2030 __PMC_EV_BLOCK(K8, 0x2080) \
2031 __PMC_EV_K8() \
2032 __PMC_EV_BLOCK(IAF, 0x10000) \
2033 __PMC_EV_IAF() \
2034 __PMC_EV_BLOCK(IAP, 0x10080) \
2035 __PMC_EV_IAP() \
2036 __PMC_EV_BLOCK(P4, 0x11000) \
2037 __PMC_EV_P4() \
2038 __PMC_EV_BLOCK(P5, 0x11080) \
2039 __PMC_EV_P5() \
2040 __PMC_EV_BLOCK(P6, 0x11100) \
2016 __PMC_EV_P6()
2041 __PMC_EV_P6() \
2042 __PMC_EV_BLOCK(XSCALE, 0x11200) \
2043 __PMC_EV_XSCALE()
2017
2018#define PMC_EVENT_FIRST PMC_EV_TSC_TSC
2044
2045#define PMC_EVENT_FIRST PMC_EV_TSC_TSC
2019#define PMC_EVENT_LAST PMC_EV_P6_LAST
2046#define PMC_EVENT_LAST PMC_EV_XSCALE_LAST
2020
2021#endif /* _DEV_HWPMC_PMC_EVENTS_H_ */
2047
2048#endif /* _DEV_HWPMC_PMC_EVENTS_H_ */