Deleted Added
full compact
hwpmc_amd.c (147510) hwpmc_amd.c (147867)
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

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

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
28#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

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

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
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_amd.c 147510 2005-06-21 06:03:30Z jkoshy $");
29__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_amd.c 147867 2005-07-09 17:29:36Z jkoshy $");
30
31/* Support for the AMD K7 and later processors */
32
33#include <sys/param.h>
34#include <sys/lock.h>
35#include <sys/malloc.h>
36#include <sys/mutex.h>
37#include <sys/pmc.h>

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

674 struct pmc *pm;
675 struct pmc_cpu *pc;
676 struct pmc_hw *phw;
677 pmc_value_t v;
678
679 KASSERT(cpu >= 0 && cpu < mp_ncpus,
680 ("[amd,%d] out of range CPU %d", __LINE__, cpu));
681
30
31/* Support for the AMD K7 and later processors */
32
33#include <sys/param.h>
34#include <sys/lock.h>
35#include <sys/malloc.h>
36#include <sys/mutex.h>
37#include <sys/pmc.h>

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

674 struct pmc *pm;
675 struct pmc_cpu *pc;
676 struct pmc_hw *phw;
677 pmc_value_t v;
678
679 KASSERT(cpu >= 0 && cpu < mp_ncpus,
680 ("[amd,%d] out of range CPU %d", __LINE__, cpu));
681
682 PMCDBG(MDP,INT,1, "cpu=%d eip=%p", cpu, (void *) eip);
682 PMCDBG(MDP,INT,1, "cpu=%d eip=%p um=%d", cpu, (void *) eip,
683 usermode);
683
684 retval = 0;
685
686 pc = pmc_pcpu[cpu];
687
688 /*
689 * look for all PMCs that have interrupted:
690 * - skip over the TSC [PMC#0]

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

728 /* restart if there was no error during logging */
729 error = pmc_process_interrupt(cpu, pm, eip, usermode);
730 if (error == 0)
731 wrmsr(evsel, config | AMD_PMC_ENABLE);
732
733 retval = 1; /* found an interrupting PMC */
734 }
735
684
685 retval = 0;
686
687 pc = pmc_pcpu[cpu];
688
689 /*
690 * look for all PMCs that have interrupted:
691 * - skip over the TSC [PMC#0]

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

729 /* restart if there was no error during logging */
730 error = pmc_process_interrupt(cpu, pm, eip, usermode);
731 if (error == 0)
732 wrmsr(evsel, config | AMD_PMC_ENABLE);
733
734 retval = 1; /* found an interrupting PMC */
735 }
736
736 if (retval == 0)
737 atomic_add_int(&pmc_stats.pm_intr_ignored, 1);
737 atomic_add_int(retval ? &pmc_stats.pm_intr_processed :
738 &pmc_stats.pm_intr_ignored, 1);
739
738 return retval;
739}
740
741/*
742 * describe a PMC
743 */
744static int
745amd_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc)

--- 252 unchanged lines hidden ---
740 return retval;
741}
742
743/*
744 * describe a PMC
745 */
746static int
747amd_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc)

--- 252 unchanged lines hidden ---