Deleted Added
full compact
libpmc.c (147759) libpmc.c (155998)
1/*-
2 * Copyright (c) 2003-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

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

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
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003-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

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

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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libpmc/libpmc.c 147759 2005-07-03 16:33:22Z jkoshy $");
28__FBSDID("$FreeBSD: head/lib/libpmc/libpmc.c 155998 2006-02-25 05:34:00Z jkoshy $");
29
30#include <sys/types.h>
31#include <sys/module.h>
32#include <sys/pmc.h>
33#include <sys/syscall.h>
34
35#include <ctype.h>
36#include <errno.h>

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

314 EV_ALIAS("branches", "k8-fr-retired-taken-branches"),
315 EV_ALIAS("branch-mispredicts",
316 "k8-fr-retired-taken-branches-mispredicted"),
317 EV_ALIAS("cycles", "tsc"),
318 EV_ALIAS("dc-misses", "k8-dc-miss"),
319 EV_ALIAS("ic-misses", "k8-ic-miss"),
320 EV_ALIAS("instructions", "k8-fr-retired-x86-instructions"),
321 EV_ALIAS("interrupts", "k8-fr-taken-hardware-interrupts"),
29
30#include <sys/types.h>
31#include <sys/module.h>
32#include <sys/pmc.h>
33#include <sys/syscall.h>
34
35#include <ctype.h>
36#include <errno.h>

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

314 EV_ALIAS("branches", "k8-fr-retired-taken-branches"),
315 EV_ALIAS("branch-mispredicts",
316 "k8-fr-retired-taken-branches-mispredicted"),
317 EV_ALIAS("cycles", "tsc"),
318 EV_ALIAS("dc-misses", "k8-dc-miss"),
319 EV_ALIAS("ic-misses", "k8-ic-miss"),
320 EV_ALIAS("instructions", "k8-fr-retired-x86-instructions"),
321 EV_ALIAS("interrupts", "k8-fr-taken-hardware-interrupts"),
322 EV_ALIAS("unhalted-cycles", "k8-bu-cpu-clk-unhalted"),
322 EV_ALIAS(NULL, NULL)
323};
324
325#define __K8MASK(N,V) PMCMASK(N,(1 << (V)))
326
327/*
328 * Parsing tables
329 */

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

677 */
678
679static struct pmc_event_alias p4_aliases[] = {
680 EV_ALIAS("branches", "p4-branch-retired,mask=mmtp+mmtm"),
681 EV_ALIAS("branch-mispredicts", "p4-mispred-branch-retired"),
682 EV_ALIAS("cycles", "tsc"),
683 EV_ALIAS("instructions",
684 "p4-instr-retired,mask=nbogusntag+nbogustag"),
323 EV_ALIAS(NULL, NULL)
324};
325
326#define __K8MASK(N,V) PMCMASK(N,(1 << (V)))
327
328/*
329 * Parsing tables
330 */

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

678 */
679
680static struct pmc_event_alias p4_aliases[] = {
681 EV_ALIAS("branches", "p4-branch-retired,mask=mmtp+mmtm"),
682 EV_ALIAS("branch-mispredicts", "p4-mispred-branch-retired"),
683 EV_ALIAS("cycles", "tsc"),
684 EV_ALIAS("instructions",
685 "p4-instr-retired,mask=nbogusntag+nbogustag"),
686 EV_ALIAS("unhalted-cycles", "p4-global-power-events"),
685 EV_ALIAS(NULL, NULL)
686};
687
688#define P4_KW_ACTIVE "active"
689#define P4_KW_ACTIVE_ANY "any"
690#define P4_KW_ACTIVE_BOTH "both"
691#define P4_KW_ACTIVE_NONE "none"
692#define P4_KW_ACTIVE_SINGLE "single"

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

1311static struct pmc_event_alias p6_aliases[] = {
1312 EV_ALIAS("branches", "p6-br-inst-retired"),
1313 EV_ALIAS("branch-mispredicts", "p6-br-miss-pred-retired"),
1314 EV_ALIAS("cycles", "tsc"),
1315 EV_ALIAS("dc-misses", "p6-dcu-lines-in"),
1316 EV_ALIAS("ic-misses", "p6-ifu-ifetch-miss"),
1317 EV_ALIAS("instructions", "p6-inst-retired"),
1318 EV_ALIAS("interrupts", "p6-hw-int-rx"),
687 EV_ALIAS(NULL, NULL)
688};
689
690#define P4_KW_ACTIVE "active"
691#define P4_KW_ACTIVE_ANY "any"
692#define P4_KW_ACTIVE_BOTH "both"
693#define P4_KW_ACTIVE_NONE "none"
694#define P4_KW_ACTIVE_SINGLE "single"

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

1313static struct pmc_event_alias p6_aliases[] = {
1314 EV_ALIAS("branches", "p6-br-inst-retired"),
1315 EV_ALIAS("branch-mispredicts", "p6-br-miss-pred-retired"),
1316 EV_ALIAS("cycles", "tsc"),
1317 EV_ALIAS("dc-misses", "p6-dcu-lines-in"),
1318 EV_ALIAS("ic-misses", "p6-ifu-ifetch-miss"),
1319 EV_ALIAS("instructions", "p6-inst-retired"),
1320 EV_ALIAS("interrupts", "p6-hw-int-rx"),
1321 EV_ALIAS("unhalted-cycles", "p6-cpu-clk-unhalted"),
1319 EV_ALIAS(NULL, NULL)
1320};
1321
1322#define P6_KW_CMASK "cmask"
1323#define P6_KW_EDGE "edge"
1324#define P6_KW_INV "inv"
1325#define P6_KW_OS "os"
1326#define P6_KW_UMASK "umask"

--- 908 unchanged lines hidden ---
1322 EV_ALIAS(NULL, NULL)
1323};
1324
1325#define P6_KW_CMASK "cmask"
1326#define P6_KW_EDGE "edge"
1327#define P6_KW_INV "inv"
1328#define P6_KW_OS "os"
1329#define P6_KW_UMASK "umask"

--- 908 unchanged lines hidden ---