Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Apr 2012 10:06:42 +0200
From:      Monthadar Al Jaberi <monthadar@gmail.com>
To:        Fabien Thomas <fabien.thomas@netasq.com>
Cc:        monthadar@freebsd.org, Adrian Chadd <adrian@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>, Fabien Thomas <fabient@freebsd.org>, freebsd-mips@freebsd.org
Subject:   Re: svn commit: r233628 - in head: lib/libpmc sys/amd64/amd64 sys/amd64/include sys/arm/include sys/conf sys/dev/hwpmc sys/i386/i386 sys/i386/include sys/kern sys/mips/include sys/modules/hwpmc sys/pow...
Message-ID:  <CA%2BsBSo%2B%2BDytD_0b%2BFh=aPzpgx8LMEH=%2B48bq6thxTgUdhDYyrw@mail.gmail.com>
In-Reply-To: <25D59FAA-D52A-42FB-8120-66467863AB0B@netasq.com>
References:  <201203282058.q2SKwVsJ053900@svn.freebsd.org> <CAJ-Vmok-JHRsnwh5j2vnw54ccVSDOoYHCut_N9wfohsQSvOaZA@mail.gmail.com> <CA%2BsBSoJ_5OrgeD_K%2BpM18%2BW9MomYTiierrD8bvZ0Kk4t6su=AQ@mail.gmail.com> <25D59FAA-D52A-42FB-8120-66467863AB0B@netasq.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 23, 2012 at 9:47 AM, Fabien Thomas <fabien.thomas@netasq.com> w=
rote:
> Hi,
>
> The rumors seems true :)
> Can you try the patch attached (I cannot test as i've no MIPS hardware) ?

my RSPRO boots fine now, thank you :)

>
> Thanks,
> Fabien
>
>
>> On Mon, Apr 23, 2012 at 8:44 AM, Adrian Chadd <adrian@freebsd.org> wrote=
:
>>> Hi Fabien,
>>>
>>> I've heard some rumours that this broke hwpmc support for mips24k.
>>>
>>> Monthadar, can you please provide some background info for this?
>>>
>>
>> This is the log output
>>
>> Using default protocol (TFTP)
>> Entry point: 0x80050100, address range: 0x80050000-0x804f1dcc
>> RedBoot> exec
>> Now booting linux kernel:
>> Base address 0x80050000 Entry 0x80050100
>> memsize=3D0x08000000
>> modetty0=3D0,n,8,1,hw
>> board=3DRouterStation PRO
>> ethaddr=3D00.15.6d.c8.c9.2e
>> CPU platform: Atheros AR7161 rev 2
>> CPU Frequency=3D720 MHz
>> CPU DDR Frequency=3D360 MHz
>> CPU AHB Frequency=3D180 MHz
>> platform frequency: 720000000
>> arguments:
>> =C2=A0a0 =3D 00000002
>> =C2=A0a1 =3D 80050028
>> =C2=A0a2 =3D 80050000
>> =C2=A0a3 =3D 00000001
>> Cmd line: =C2=A0=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BDm=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD_}=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=DF=BEq=EF=BF=BD=EF=
=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD =EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=DF=BF=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD_=EF=BF=
=BDw=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD?-=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD{=EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD~=EF=BF=BD=EF=BF=BD
>> Environment:
>> =C2=A0memsize =3D 0x08000000
>> =C2=A0modetty0 =3D 0,n,8,1,hw
>> =C2=A0ethaddr =3D 00.15.6d.c8.c9.2e
>> =C2=A0board =3D RouterStation PRO
>> Cache info:
>> =C2=A0picache_stride =C2=A0 =C2=A0=3D 4096
>> =C2=A0picache_loopcount =3D 16
>> =C2=A0pdcache_stride =C2=A0 =C2=A0=3D 4096
>> =C2=A0pdcache_loopcount =3D 8
>> cpu0: MIPS Technologies processor v116.147
>> =C2=A0MMU: Standard TLB, 16 entries
>> =C2=A0L1 i-cache: 4 ways of 512 sets, 32 bytes per line
>> =C2=A0L1 d-cache: 4 ways of 256 sets, 32 bytes per line
>> =C2=A0Config1=3D0x9ee3519e<PerfCount,WatchRegs,MIPS16,EJTAG>
>> =C2=A0Config3=3D0x20
>> KDB: debugger backends: ddb
>> KDB: current backend: ddb
>> Copyright (c) 1992-2012 The FreeBSD Project.
>> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
>> =C2=A0 =C2=A0 =C2=A0 The Regents of the University of California. All ri=
ghts reserved.
>> FreeBSD is a registered trademark of The FreeBSD Foundation.
>> FreeBSD 10.0-CURRENT #12: Fri Apr 20 18:03:16 CEST 2012
>> =C2=A0 =C2=A0root@freebsd-re-9:/usr/obj/mips.mips/usr/src/sys/RSPRO_USB_=
PROD mips
>> WARNING: WITNESS option enabled, expect reduced performance.
>> MEMGUARD DEBUGGING ALLOCATOR INITIALIZED:
>> =C2=A0 =C2=A0 =C2=A0 MEMGUARD map base: 0xc0800000
>> =C2=A0 =C2=A0 =C2=A0 MEMGUARD map limit: 0xc1c00000
>> =C2=A0 =C2=A0 =C2=A0 MEMGUARD map size: 20480 KBytes
>> real memory =C2=A0=3D 134217728 (131072K bytes)
>> avail memory =3D 123117568 (117MB)
>> random device not loaded; using insecure entropy
>> nexus0: <MIPS32 root nexus>
>> clock0: <Generic MIPS32 ticker> on nexus0
>> Timecounter "MIPS32" frequency 360000000 Hz quality 800
>> Event timer "MIPS32" frequency 360000000 Hz quality 800
>> apb0 at irq 4 on nexus0
>> uart0: <16550 or compatible> on apb0
>> uart0: console (115200,n,8,1)
>> gpio0: <Atheros AR71XX GPIO driver> on apb0
>> gpio0: [GIANT-LOCKED]
>> gpio0: gpio pinmask=3D0x0
>> gpioc0: <GPIO controller> on gpio0
>> gpiobus0: <GPIO bus> on gpio0
>> ehci0: <AR71XX Integrated USB 2.0 controller> at mem
>> 0x1b000000-0x1bffffff irq 1 on nexus0
>> usbus0: set host controller mode
>> usbus0: EHCI version 1.0
>> usbus0: set host controller mode
>> usbus0 on ehci0
>> pcib0 at irq 0 on nexus0
>> pci0: <PCI bus> on pcib0
>> pci0: <old, non-VGA display device> at device 0.0 (no driver attached)
>> ath0: <Atheros 5413> irq 0 at device 17.0 on pci0
>> ath0: AR5413 mac 10.5 RF5413 phy 6.1
>> ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0063
>> arge0: <Atheros AR71xx built-in ethernet interface> at mem
>> 0x19000000-0x19000fff irq 2 on nexus0
>> arge0: No PHY specified, using mask 16
>> miibus0: <MII bus> on arge0
>> ukphy0: <Generic IEEE 802.3u media interface> PHY 4 on miibus0
>> ukphy0: =C2=A0none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX,
>> 1000baseT-FDX, 1000baseT-FDX-master, auto
>> arge0: Ethernet address: 00:15:6d:c8:c9:2e
>> arge1: <Atheros AR71xx built-in ethernet interface> at mem
>> 0x1a000000-0x1a000fff irq 3 on nexus0
>> arge1: No PHY specified, using mask 15
>> arge1: Ethernet address: 00:15:6d:c8:c9:2f
>> spi0: <AR71XX SPI> at mem 0x1f000000-0x1f00000f on nexus0
>> spibus0: <spibus bus> on spi0
>> mx25l0: <M25Pxx Flash Family> at cs 0 on spibus0
>> mx25l0: mx25ll128, sector 65536 bytes, 256 sectors
>> ar71xx_wdog0: <Atheros AR71XX watchdog timer> on nexus0
>> Timecounters tick every 1.000 msec
>> usbus0: 480Mbps High Speed USB v2.0
>> ugen0.1: <Atheros> at usbus0
>> uhub0: <Atheros EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbu=
s0
>> panic: [pmc,4816] npmc miscomputed: ri=3D0, md->npmc=3D2
>> KDB: enter: panic
>> [ thread pid 0 tid 100000 ]
>> Stopped at =C2=A0 =C2=A0 =C2=A0kdb_enter+0x4c: lui =C2=A0 =C2=A0 at,0x80=
50
>> db> tr
>> Tracing pid 0 tid 100000 td 0x804f76d0
>> db_trace_thread+30 (?,?,?,?) ra 8068b94800000018 sp 0 sz 0
>> 80075adc+114 (0,?,ffffffff,?) ra 8068b96000000020 sp 100000000 sz 1
>> 80074e24+388 (?,?,?,?) ra 8068b980000000a8 sp 0 sz 0
>> db_command_loop+70 (?,?,?,?) ra 8068ba2800000018 sp 0 sz 0
>> 80077900+f4 (?,?,?,?) ra 8068ba40000001a8 sp 0 sz 0
>> kdb_trap+110 (?,?,?,?) ra 8068bbe800000030 sp 0 sz 0
>> trap+c7c (?,?,?,?) ra 8068bc18000000b8 sp 0 sz 0
>> MipsKernGenException+134 (0,4,8043b1d4,119) ra 8068bcd0000000c8 sp
>> 100000001 sz 1
>> kdb_enter+4c (?,?,?,?) ra 8068bd9800000018 sp 0 sz 0
>> panic+11c (?,12d0,0,2) ra 8068bdb000000028 sp 1 sz 1
>> 800e8ca8+274 (?,?,?,?) ra 8068bdd800000038 sp 0 sz 0
>> syscall_module_handler+b8 (?,?,?,?) ra 8068be1000000028 sp 0 sz 0
>> module_register_init+9c (?,?,?,?) ra 8068be3800000028 sp 0 sz 0
>> mi_startup+138 (?,?,?,?) ra 8068be6000000020 sp 0 sz 0
>> _start+90 (?,?,?,?) ra 8068be8000000000 sp 0 sz 0
>> pid 0
>> db>
>>
>>> Thanks,
>>>
>>>
>>>
>>> adrian
>>>
>>> On 28 March 2012 13:58, Fabien Thomas <fabient@freebsd.org> wrote:
>>>> Author: fabient
>>>> Date: Wed Mar 28 20:58:30 2012
>>>> New Revision: 233628
>>>> URL: http://svn.freebsd.org/changeset/base/233628
>>>>
>>>> Log:
>>>> =C2=A0Add software PMC support.
>>>>
>>>> =C2=A0New kernel events can be added at various location for sampling =
or counting.
>>>> =C2=A0This will for example allow easy system profiling whatever the p=
rocessor is
>>>> =C2=A0with known tools like pmcstat(8).
>>>>
>>>> =C2=A0Simultaneous usage of software PMC and hardware PMC is possible,=
 for example
>>>> =C2=A0looking at the lock acquire failure, page fault while sampling o=
n
>>>> =C2=A0instructions.
>>>>
>>>> =C2=A0Sponsored by: NETASQ
>>>> =C2=A0MFC after: =C2=A0 =C2=A01 month
>>>>
>>>> Added:
>>>> =C2=A0head/lib/libpmc/pmc.soft.3 =C2=A0 (contents, props changed)
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_soft.c =C2=A0 (contents, props changed)
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_soft.h =C2=A0 (contents, props changed)
>>>> Modified:
>>>> =C2=A0head/lib/libpmc/Makefile
>>>> =C2=A0head/lib/libpmc/libpmc.c
>>>> =C2=A0head/lib/libpmc/pmc.3
>>>> =C2=A0head/lib/libpmc/pmc.atom.3
>>>> =C2=A0head/lib/libpmc/pmc.core.3
>>>> =C2=A0head/lib/libpmc/pmc.core2.3
>>>> =C2=A0head/lib/libpmc/pmc.corei7.3
>>>> =C2=A0head/lib/libpmc/pmc.corei7uc.3
>>>> =C2=A0head/lib/libpmc/pmc.iaf.3
>>>> =C2=A0head/lib/libpmc/pmc.k7.3
>>>> =C2=A0head/lib/libpmc/pmc.k8.3
>>>> =C2=A0head/lib/libpmc/pmc.mips24k.3
>>>> =C2=A0head/lib/libpmc/pmc.octeon.3
>>>> =C2=A0head/lib/libpmc/pmc.p4.3
>>>> =C2=A0head/lib/libpmc/pmc.p5.3
>>>> =C2=A0head/lib/libpmc/pmc.p6.3
>>>> =C2=A0head/lib/libpmc/pmc.sandybridge.3
>>>> =C2=A0head/lib/libpmc/pmc.sandybridgeuc.3
>>>> =C2=A0head/lib/libpmc/pmc.tsc.3
>>>> =C2=A0head/lib/libpmc/pmc.ucf.3
>>>> =C2=A0head/lib/libpmc/pmc.westmere.3
>>>> =C2=A0head/lib/libpmc/pmc.westmereuc.3
>>>> =C2=A0head/lib/libpmc/pmc.xscale.3
>>>> =C2=A0head/lib/libpmc/pmclog.c
>>>> =C2=A0head/lib/libpmc/pmclog.h
>>>> =C2=A0head/sys/amd64/amd64/trap.c
>>>> =C2=A0head/sys/amd64/include/pmc_mdep.h
>>>> =C2=A0head/sys/arm/include/pmc_mdep.h
>>>> =C2=A0head/sys/conf/files
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_amd.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_core.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_intel.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_logging.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_mips.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_mod.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_piv.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_powerpc.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_ppro.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_tsc.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_x86.c
>>>> =C2=A0head/sys/dev/hwpmc/hwpmc_xscale.c
>>>> =C2=A0head/sys/dev/hwpmc/pmc_events.h
>>>> =C2=A0head/sys/i386/i386/trap.c
>>>> =C2=A0head/sys/i386/include/pmc_mdep.h
>>>> =C2=A0head/sys/kern/kern_clock.c
>>>> =C2=A0head/sys/kern/kern_lock.c
>>>> =C2=A0head/sys/kern/kern_mutex.c
>>>> =C2=A0head/sys/kern/kern_pmc.c
>>>> =C2=A0head/sys/kern/kern_rwlock.c
>>>> =C2=A0head/sys/kern/kern_sx.c
>>>> =C2=A0head/sys/kern/subr_trap.c
>>>> =C2=A0head/sys/mips/include/pmc_mdep.h
>>>> =C2=A0head/sys/modules/hwpmc/Makefile
>>>> =C2=A0head/sys/powerpc/include/pmc_mdep.h
>>>> =C2=A0head/sys/sys/pmc.h
>>>> =C2=A0head/sys/sys/pmckern.h
>>>> =C2=A0head/sys/sys/pmclog.h
>>>> =C2=A0head/usr.sbin/pmcstat/pmcstat_log.c
>>>>
>>>> Modified: head/lib/libpmc/Makefile
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/Makefile =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/Makefile =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -20,6 +20,7 @@ MAN+=3D pmc_read.3
>>>> =C2=A0MAN+=3D =C2=A0pmc_set.3
>>>> =C2=A0MAN+=3D =C2=A0pmc_start.3
>>>> =C2=A0MAN+=3D =C2=A0pmclog.3
>>>> +MAN+=3D =C2=A0pmc.soft.3
>>>>
>>>> =C2=A0# PMC-dependent manual pages
>>>> =C2=A0.if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=
=3D "amd64"
>>>>
>>>> Modified: head/lib/libpmc/libpmc.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/libpmc.c =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/libpmc.c =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -77,11 +77,12 @@ static int tsc_allocate_pmc(enum pmc_eve
>>>> =C2=A0static int xscale_allocate_pmc(enum pmc_event _pe, char *_ctrspe=
c,
>>>> =C2=A0 =C2=A0 struct pmc_op_pmcallocate *_pmc_config);
>>>> =C2=A0#endif
>>>> -
>>>> =C2=A0#if defined(__mips__)
>>>> =C2=A0static int mips_allocate_pmc(enum pmc_event _pe, char* ctrspec,
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct pmc_op_pmcallocate *_pmc_config);
>>>> =C2=A0#endif /* __mips__ */
>>>> +static int soft_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
>>>> + =C2=A0 =C2=A0struct pmc_op_pmcallocate *_pmc_config);
>>>>
>>>> =C2=A0#if defined(__powerpc__)
>>>> =C2=A0static int ppc7450_allocate_pmc(enum pmc_event _pe, char* ctrspe=
c,
>>>> @@ -156,6 +157,8 @@ PMC_CLASSDEP_TABLE(octeon, OCTEON);
>>>> =C2=A0PMC_CLASSDEP_TABLE(ucf, UCF);
>>>> =C2=A0PMC_CLASSDEP_TABLE(ppc7450, PPC7450);
>>>>
>>>> +static struct pmc_event_descr soft_event_table[PMC_EV_DYN_COUNT];
>>>> +
>>>> =C2=A0#undef __PMC_EV_ALIAS
>>>> =C2=A0#define =C2=A0 =C2=A0 =C2=A0 =C2=A0__PMC_EV_ALIAS(N,CODE) =C2=A0=
{ N, PMC_EV_##CODE },
>>>>
>>>> @@ -215,21 +218,22 @@ static const struct pmc_event_descr west
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_CLASS_##C, =
__VA_ARGS__ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0\
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>>>
>>>> -PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC);
>>>> -PMC_MDEP_TABLE(core, IAP, PMC_CLASS_TSC);
>>>> -PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC);
>>>> -PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_U=
CF, PMC_CLASS_UCP);
>>>> -PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CL=
ASS_UCF, PMC_CLASS_UCP);
>>>> -PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS=
_UCF, PMC_CLASS_UCP);
>>>> -PMC_MDEP_TABLE(k7, K7, PMC_CLASS_TSC);
>>>> -PMC_MDEP_TABLE(k8, K8, PMC_CLASS_TSC);
>>>> -PMC_MDEP_TABLE(p4, P4, PMC_CLASS_TSC);
>>>> -PMC_MDEP_TABLE(p5, P5, PMC_CLASS_TSC);
>>>> -PMC_MDEP_TABLE(p6, P6, PMC_CLASS_TSC);
>>>> -PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_XSCALE);
>>>> -PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_MIPS24K);
>>>> -PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_OCTEON);
>>>> -PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_PPC7450);
>>>> +PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TS=
C);
>>>> +PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC);
>>>> +PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_T=
SC);
>>>> +PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_=
TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
>>>> +PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_C=
LASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
>>>> +PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLAS=
S_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
>>>> +PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC);
>>>> +PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC);
>>>> +PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, PMC_CLASS_TSC);
>>>> +PMC_MDEP_TABLE(p5, P5, PMC_CLASS_SOFT, PMC_CLASS_TSC);
>>>> +PMC_MDEP_TABLE(p6, P6, PMC_CLASS_SOFT, PMC_CLASS_TSC);
>>>> +PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE);
>>>> +PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_SOFT, PMC_CLASS_MIPS24K);
>>>> +PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_SOFT, PMC_CLASS_OCTEON);
>>>> +PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450);
>>>> +PMC_MDEP_TABLE(generic, SOFT, PMC_CLASS_SOFT);
>>>>
>>>> =C2=A0static const struct pmc_event_descr tsc_event_table[] =3D
>>>> =C2=A0{
>>>> @@ -279,16 +283,24 @@ PMC_CLASS_TABLE_DESC(tsc, TSC, tsc, tsc)
>>>> =C2=A0#if =C2=A0 =C2=A0defined(__XSCALE__)
>>>> =C2=A0PMC_CLASS_TABLE_DESC(xscale, XSCALE, xscale, xscale);
>>>> =C2=A0#endif
>>>> -
>>>> =C2=A0#if defined(__mips__)
>>>> =C2=A0PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips);
>>>> =C2=A0PMC_CLASS_TABLE_DESC(octeon, OCTEON, octeon, mips);
>>>> =C2=A0#endif /* __mips__ */
>>>> -
>>>> =C2=A0#if defined(__powerpc__)
>>>> =C2=A0PMC_CLASS_TABLE_DESC(ppc7450, PPC7450, ppc7450, ppc7450);
>>>> =C2=A0#endif
>>>>
>>>> +static struct pmc_class_descr soft_class_table_descr =3D
>>>> +{
>>>> + =C2=A0 =C2=A0 =C2=A0 .pm_evc_name =C2=A0=3D "SOFT-",
>>>> + =C2=A0 =C2=A0 =C2=A0 .pm_evc_name_size =3D sizeof("SOFT-") - 1,
>>>> + =C2=A0 =C2=A0 =C2=A0 .pm_evc_class =3D PMC_CLASS_SOFT,
>>>> + =C2=A0 =C2=A0 =C2=A0 .pm_evc_event_table =3D NULL,
>>>> + =C2=A0 =C2=A0 =C2=A0 .pm_evc_event_table_size =3D 0,
>>>> + =C2=A0 =C2=A0 =C2=A0 .pm_evc_allocate_pmc =3D soft_allocate_pmc
>>>> +};
>>>> +
>>>> =C2=A0#undef PMC_CLASS_TABLE_DESC
>>>>
>>>> =C2=A0static const struct pmc_class_descr **pmc_class_table;
>>>> @@ -343,9 +355,12 @@ static const char * pmc_state_names[] =3D
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0__PMC_STATES()
>>>> =C2=A0};
>>>>
>>>> -static int pmc_syscall =3D -1; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* =
filled in by pmc_init() */
>>>> -
>>>> -static struct pmc_cpuinfo cpu_info; =C2=A0 =C2=A0/* filled in by pmc_=
init() */
>>>> +/*
>>>> + * Filled in by pmc_init().
>>>> + */
>>>> +static int pmc_syscall =3D -1;
>>>> +static struct pmc_cpuinfo cpu_info;
>>>> +static struct pmc_op_getdyneventinfo soft_event_info;
>>>>
>>>> =C2=A0/* Event masks for events */
>>>> =C2=A0struct pmc_masks {
>>>> @@ -2179,6 +2194,25 @@ tsc_allocate_pmc(enum pmc_event pe, char
>>>> =C2=A0}
>>>> =C2=A0#endif
>>>>
>>>> +static struct pmc_event_alias generic_aliases[] =3D {
>>>> + =C2=A0 =C2=A0 =C2=A0 EV_ALIAS("instructions", =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"SOFT-CLOCK.HARD"),
>>>> + =C2=A0 =C2=A0 =C2=A0 EV_ALIAS(NULL, NULL)
>>>> +};
>>>> +
>>>> +static int
>>>> +soft_allocate_pmc(enum pmc_event pe, char *ctrspec,
>>>> + =C2=A0 =C2=A0struct pmc_op_pmcallocate *pmc_config)
>>>> +{
>>>> + =C2=A0 =C2=A0 =C2=A0 (void)ctrspec;
>>>> + =C2=A0 =C2=A0 =C2=A0 (void)pmc_config;
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 if (pe < PMC_EV_SOFT_FIRST || pe > PMC_EV_SOFT_=
LAST)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (-1);
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 pmc_config->pm_caps |=3D (PMC_CAP_READ | PMC_CA=
P_WRITE);
>>>> + =C2=A0 =C2=A0 =C2=A0 return (0);
>>>> +}
>>>> +
>>>> =C2=A0#if =C2=A0 =C2=A0defined(__XSCALE__)
>>>>
>>>> =C2=A0static struct pmc_event_alias xscale_aliases[] =3D {
>>>> @@ -2663,6 +2697,10 @@ pmc_event_names_of_class(enum pmc_class
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ev =3D ppc7450_=
event_table;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0count =3D PMC_E=
VENT_TABLE_SIZE(ppc7450);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
>>>> + =C2=A0 =C2=A0 =C2=A0 case PMC_CLASS_SOFT:
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ev =3D soft_event_t=
able;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 count =3D soft_even=
t_info.pm_nevent;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0default:
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0errno =3D EINVA=
L;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (-1);
>>>> @@ -2676,6 +2714,7 @@ pmc_event_names_of_class(enum pmc_class
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0for (;count--; ev++, names++)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*names =3D ev->=
pm_ev_name;
>>>> +
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
>>>> =C2=A0}
>>>>
>>>> @@ -2780,11 +2819,34 @@ pmc_init(void)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_class_table=
[n] =3D NULL;
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0/*
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0* Get soft events list.
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
>>>> + =C2=A0 =C2=A0 =C2=A0 soft_event_info.pm_class =3D PMC_CLASS_SOFT;
>>>> + =C2=A0 =C2=A0 =C2=A0 if (PMC_CALL(GETDYNEVENTINFO, &soft_event_info)=
 < 0)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (pmc_syscall=
 =3D -1);
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 /* Map soft events to static list. */
>>>> + =C2=A0 =C2=A0 =C2=A0 for (n =3D 0; n < soft_event_info.pm_nevent; n+=
+) {
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 soft_event_table[n]=
.pm_ev_name =3D
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 soft_=
event_info.pm_events[n].pm_ev_name;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 soft_event_table[n]=
.pm_ev_code =3D
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 soft_=
event_info.pm_events[n].pm_ev_code;
>>>> + =C2=A0 =C2=A0 =C2=A0 }
>>>> + =C2=A0 =C2=A0 =C2=A0 soft_class_table_descr.pm_evc_event_table_size =
=3D \
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 soft_event_info.pm_nevent;
>>>> + =C2=A0 =C2=A0 =C2=A0 soft_class_table_descr.pm_evc_event_table =3D \
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 soft_event_table;
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 /*
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Fill in the class table.
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0n =3D 0;
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 /* Fill soft events information. */
>>>> + =C2=A0 =C2=A0 =C2=A0 pmc_class_table[n++] =3D &soft_class_table_desc=
r;
>>>> =C2=A0#if defined(__amd64__) || defined(__i386__)
>>>> - =C2=A0 =C2=A0 =C2=A0 pmc_class_table[n++] =3D &tsc_class_table_descr=
;
>>>> + =C2=A0 =C2=A0 =C2=A0 if (cpu_info.pm_cputype !=3D PMC_CPU_GENERIC)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_class_table[n++=
] =3D &tsc_class_table_descr;
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0/*
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Check if this CPU has fixed function cou=
nters.
>>>> @@ -2867,6 +2929,9 @@ pmc_init(void)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_class_table=
[n] =3D &p4_class_table_descr;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
>>>> =C2=A0#endif
>>>> + =C2=A0 =C2=A0 =C2=A0 case PMC_CPU_GENERIC:
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMC_MDEP_INIT(gener=
ic);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>>>> =C2=A0#if defined(__XSCALE__)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0case PMC_CPU_INTEL_XSCALE:
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_INIT(x=
scale);
>>>> @@ -3035,18 +3100,19 @@ _pmc_name_of_event(enum pmc_event pe, en
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0evfence =3D xsc=
ale_event_table + PMC_EVENT_TABLE_SIZE(xscale);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (pe >=3D PMC_EV_MIPS24K_FIRST && =
pe <=3D PMC_EV_MIPS24K_LAST) {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ev =3D mips24k_=
event_table;
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 evfence =3D mips24k=
_event_table + PMC_EVENT_TABLE_SIZE(mips24k
>>>> -);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 evfence =3D mips24k=
_event_table + PMC_EVENT_TABLE_SIZE(mips24k);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (pe >=3D PMC_EV_OCTEON_FIRST && p=
e <=3D PMC_EV_OCTEON_LAST) {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ev =3D octeon_e=
vent_table;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0evfence =3D oct=
eon_event_table + PMC_EVENT_TABLE_SIZE(octeon);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (pe >=3D PMC_EV_PPC7450_FIRST && =
pe <=3D PMC_EV_PPC7450_LAST) {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ev =3D ppc7450_=
event_table;
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 evfence =3D ppc7450=
_event_table + PMC_EVENT_TABLE_SIZE(ppc7450
>>>> -);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 evfence =3D ppc7450=
_event_table + PMC_EVENT_TABLE_SIZE(ppc7450);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (pe =3D=3D PMC_EV_TSC_TSC) {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ev =3D tsc_even=
t_table;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0evfence =3D tsc=
_event_table + PMC_EVENT_TABLE_SIZE(tsc);
>>>> + =C2=A0 =C2=A0 =C2=A0 } else if (pe >=3D PMC_EV_SOFT_FIRST && pe <=3D=
 PMC_EV_SOFT_LAST) {
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ev =3D soft_event_t=
able;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 evfence =3D soft_ev=
ent_table + soft_event_info.pm_nevent;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0for (; ev !=3D evfence; ev++)
>>>>
>>>> Modified: head/lib/libpmc/pmc.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.3 =C2=A0 =C2=A0 =C2=A0 Wed Mar 28 20:49:11 201=
2 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.3 =C2=A0 =C2=A0 =C2=A0 Wed Mar 28 20:58:30 201=
2 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -223,6 +223,8 @@ and
>>>> =C2=A0CPUs.
>>>> =C2=A0.It Li PMC_CLASS_TSC
>>>> =C2=A0The timestamp counter on i386 and amd64 architecture CPUs.
>>>> +.It Li PMC_CLASS_SOFT
>>>> +Software events.
>>>> =C2=A0.El
>>>> =C2=A0.Ss PMC Capabilities
>>>> =C2=A0Capabilities of performance monitoring hardware are denoted usin=
g
>>>> @@ -525,6 +527,7 @@ API is
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> =C2=A0.Xr hwpmc 4 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.atom.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.atom.3 =C2=A0Wed Mar 28 20:49:11 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.atom.3 =C2=A0Wed Mar 28 20:58:30 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -1176,6 +1176,7 @@ and the underlying hardware events used
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.core.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.core.3 =C2=A0Wed Mar 28 20:49:11 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.core.3 =C2=A0Wed Mar 28 20:58:30 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -792,6 +792,7 @@ may not count some transitions.
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> =C2=A0.Xr hwpmc 4
>>>>
>>>> Modified: head/lib/libpmc/pmc.core2.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.core2.3 Wed Mar 28 20:49:11 2012 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.core2.3 Wed Mar 28 20:58:30 2012 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0(r233628)
>>>> @@ -1107,6 +1107,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.corei7.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.corei7.3 =C2=A0 =C2=A0 =C2=A0 =C2=A0Wed Mar 28=
 20:49:11 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.corei7.3 =C2=A0 =C2=A0 =C2=A0 =C2=A0Wed Mar 28=
 20:58:30 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -1559,6 +1559,7 @@ Counts number of segment register loads.
>>>> =C2=A0.Xr pmc.corei7uc 3 ,
>>>> =C2=A0.Xr pmc.westmere 3 ,
>>>> =C2=A0.Xr pmc.westmereuc 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.corei7uc.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.corei7uc.3 =C2=A0 =C2=A0 =C2=A0Wed Mar 28 20:4=
9:11 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.corei7uc.3 =C2=A0 =C2=A0 =C2=A0Wed Mar 28 20:5=
8:30 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -863,6 +863,7 @@ refreshed or needs to go into a power do
>>>> =C2=A0.Xr pmc.corei7 3 ,
>>>> =C2=A0.Xr pmc.westmere 3 ,
>>>> =C2=A0.Xr pmc.westmereuc 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.iaf.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.iaf.3 =C2=A0 Wed Mar 28 20:49:11 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.iaf.3 =C2=A0 Wed Mar 28 20:58:30 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -132,6 +132,7 @@ CPU, use the event specifier
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.k7.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.k7.3 =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.k7.3 =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -249,6 +249,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> =C2=A0.Xr hwpmc 4
>>>>
>>>> Modified: head/lib/libpmc/pmc.k8.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.k8.3 =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.k8.3 =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -783,6 +783,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> =C2=A0.Xr hwpmc 4
>>>>
>>>> Modified: head/lib/libpmc/pmc.mips24k.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.mips24k.3 =C2=A0 =C2=A0 =C2=A0 Wed Mar 28 20:4=
9:11 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.mips24k.3 =C2=A0 =C2=A0 =C2=A0 Wed Mar 28 20:5=
8:30 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -392,6 +392,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.octeon.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.octeon.3 =C2=A0 =C2=A0 =C2=A0 =C2=A0Wed Mar 28=
 20:49:11 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.octeon.3 =C2=A0 =C2=A0 =C2=A0 =C2=A0Wed Mar 28=
 20:58:30 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -232,6 +232,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.p4.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.p4.3 =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.p4.3 =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -1208,6 +1208,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc.k8 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> =C2=A0.Xr hwpmc 4
>>>>
>>>> Modified: head/lib/libpmc/pmc.p5.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.p5.3 =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.p5.3 =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -444,6 +444,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc.k8 3 ,
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> =C2=A0.Xr hwpmc 4
>>>>
>>>> Modified: head/lib/libpmc/pmc.p6.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.p6.3 =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.p6.3 =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -1010,6 +1010,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc.k8 3 ,
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> =C2=A0.Xr hwpmc 4
>>>>
>>>> Modified: head/lib/libpmc/pmc.sandybridge.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.sandybridge.3 =C2=A0 Wed Mar 28 20:49:11 2012 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.sandybridge.3 =C2=A0 Wed Mar 28 20:58:30 2012 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -907,6 +907,7 @@ Split locks in SQ.
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> =C2=A0.Xr pmc.sandybridgeuc 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc.ucf 3 ,
>>>> =C2=A0.Xr pmc.westmere 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.sandybridgeuc.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.sandybridgeuc.3 Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.sandybridgeuc.3 Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -208,6 +208,7 @@ Counts the number of core-outgoing entri
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> =C2=A0.Xr pmc.sandybridge 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc.ucf 3 ,
>>>> =C2=A0.Xr pmc.westmere 3 ,
>>>>
>>>> Added: head/lib/libpmc/pmc.soft.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- /dev/null =C2=A0 00:00:00 1970 =C2=A0 (empty, because file is newl=
y added)
>>>> +++ head/lib/libpmc/pmc.soft.3 =C2=A0Wed Mar 28 20:58:30 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -0,0 +1,104 @@
>>>> +.\" Copyright (c) 2012 Fabien Thomas. =C2=A0All rights reserved.
>>>> +.\"
>>>> +.\" Redistribution and use in source and binary forms, with or withou=
t
>>>> +.\" modification, are permitted provided that the following condition=
s
>>>> +.\" are met:
>>>> +.\" 1. Redistributions of source code must retain the above copyright
>>>> +.\" =C2=A0 =C2=A0notice, this list of conditions and the following di=
sclaimer.
>>>> +.\" 2. Redistributions in binary form must reproduce the above copyri=
ght
>>>> +.\" =C2=A0 =C2=A0notice, this list of conditions and the following di=
sclaimer in the
>>>> +.\" =C2=A0 =C2=A0documentation and/or other materials provided with t=
he distribution.
>>>> +.\"
>>>> +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'=
' AND
>>>> +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,=
 THE
>>>> +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULA=
R PURPOSE
>>>> +.\" ARE DISCLAIMED. =C2=A0IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR=
S BE LIABLE
>>>> +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONS=
EQUENTIAL
>>>> +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE=
 GOODS
>>>> +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPT=
ION)
>>>> +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRAC=
T, STRICT
>>>> +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN=
 ANY WAY
>>>> +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILI=
TY OF
>>>> +.\" SUCH DAMAGE.
>>>> +.\"
>>>> +.\" $FreeBSD$
>>>> +.\"
>>>> +.Dd March 28, 2012
>>>> +.Os
>>>> +.Dt PMC.SOFT 3
>>>> +.Sh NAME
>>>> +.Nm pmc.soft
>>>> +.Nd measurements using software based events
>>>> +.Sh LIBRARY
>>>> +.Lb libpmc
>>>> +.Sh SYNOPSIS
>>>> +.In pmc.h
>>>> +.Sh DESCRIPTION
>>>> +Software events are used to collect various source of software events=
.
>>>> +.Ss PMC Features
>>>> +16 sampling counters using software events based on various sources.
>>>> +These PMCs support the following capabilities:
>>>> +.Bl -column "PMC_CAP_INTERRUPT" "Support"
>>>> +.It Em Capability Ta Em Support
>>>> +.It PMC_CAP_CASCADE Ta \&No
>>>> +.It PMC_CAP_EDGE Ta \&No
>>>> +.It PMC_CAP_INTERRUPT Ta Yes
>>>> +.It PMC_CAP_INVERT Ta \&No
>>>> +.It PMC_CAP_READ Ta Yes
>>>> +.It PMC_CAP_PRECISE Ta \&No
>>>> +.It PMC_CAP_SYSTEM Ta Yes
>>>> +.It PMC_CAP_TAGGING Ta \&No
>>>> +.It PMC_CAP_THRESHOLD Ta \&No
>>>> +.It PMC_CAP_USER Ta Yes
>>>> +.It PMC_CAP_WRITE Ta Yes
>>>> +.El
>>>> +.Ss Event Qualifiers
>>>> +There is no supported event qualifier.
>>>> +.Pp
>>>> +The event specifiers supported by software are:
>>>> +.Bl -tag -width indent
>>>> +.It Li CLOCK.HARD
>>>> +Hard clock ticks.
>>>> +.It Li CLOCK.STAT
>>>> +Stat clock ticks.
>>>> +.It Li LOCK.FAILED
>>>> +Lock acquisition failed.
>>>> +.It Li PAGE_FAULT.ALL
>>>> +All page fault type.
>>>> +.It Li PAGE_FAULT.READ
>>>> +Read page fault.
>>>> +.It Li PAGE_FAULT.WRITE
>>>> +Write page fault.
>>>> +.El
>>>> +.Sh SEE ALSO
>>>> +.Xr pmc 3 ,
>>>> +.Xr pmc.atom 3 ,
>>>> +.Xr pmc.core 3 ,
>>>> +.Xr pmc.iaf 3 ,
>>>> +.Xr pmc.ucf 3 ,
>>>> +.Xr pmc.k7 3 ,
>>>> +.Xr pmc.k8 3 ,
>>>> +.Xr pmc.p4 3 ,
>>>> +.Xr pmc.p5 3 ,
>>>> +.Xr pmc.p6 3 ,
>>>> +.Xr pmc.corei7 3 ,
>>>> +.Xr pmc.corei7uc 3 ,
>>>> +.Xr pmc.westmereuc 3 ,
>>>> +.Xr pmc.tsc 3 ,
>>>> +.Xr pmc_cpuinfo 3 ,
>>>> +.Xr pmclog 3 ,
>>>> +.Xr hwpmc 4
>>>> +.Sh HISTORY
>>>> +The
>>>> +.Nm pmc
>>>> +library first appeared in
>>>> +.Fx 6.0 .
>>>> +.Sh AUTHORS
>>>> +The
>>>> +.Lb libpmc
>>>> +library was written by
>>>> +.An "Joseph Koshy"
>>>> +.Aq jkoshy@FreeBSD.org .
>>>> +Software PMC was written by
>>>> +.An "Fabien Thomas"
>>>> +.Aq fabient@FreeBSD.org .
>>>>
>>>> Modified: head/lib/libpmc/pmc.tsc.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.tsc.3 =C2=A0 Wed Mar 28 20:49:11 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.tsc.3 =C2=A0 Wed Mar 28 20:58:30 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -68,6 +68,7 @@ maps to the TSC.
>>>> =C2=A0.Xr pmc.p4 3 ,
>>>> =C2=A0.Xr pmc.p5 3 ,
>>>> =C2=A0.Xr pmc.p6 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> =C2=A0.Xr hwpmc 4
>>>> =C2=A0.Sh HISTORY
>>>>
>>>> Modified: head/lib/libpmc/pmc.ucf.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.ucf.3 =C2=A0 Wed Mar 28 20:49:11 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.ucf.3 =C2=A0 Wed Mar 28 20:58:30 2012 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -96,6 +96,7 @@ offset C0H under device number 0 and Fun
>>>> =C2=A0.Xr pmc.corei7uc 3 ,
>>>> =C2=A0.Xr pmc.westmere 3 ,
>>>> =C2=A0.Xr pmc.westmereuc 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.westmere.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.westmere.3 =C2=A0 =C2=A0 =C2=A0Wed Mar 28 20:4=
9:11 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.westmere.3 =C2=A0 =C2=A0 =C2=A0Wed Mar 28 20:5=
8:30 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -1381,6 +1381,7 @@ Counts number of SID integer 64 bit shif
>>>> =C2=A0.Xr pmc.corei7 3 ,
>>>> =C2=A0.Xr pmc.corei7uc 3 ,
>>>> =C2=A0.Xr pmc.westmereuc 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.westmereuc.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.westmereuc.3 =C2=A0 =C2=A0Wed Mar 28 20:49:11 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.westmereuc.3 =C2=A0 =C2=A0Wed Mar 28 20:58:30 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -1066,6 +1066,7 @@ disabled.
>>>> =C2=A0.Xr pmc.corei7 3 ,
>>>> =C2=A0.Xr pmc.corei7uc 3 ,
>>>> =C2=A0.Xr pmc.westmere 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr pmc.tsc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>>
>>>> Modified: head/lib/libpmc/pmc.xscale.3
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmc.xscale.3 =C2=A0 =C2=A0 =C2=A0 =C2=A0Wed Mar 28=
 20:49:11 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmc.xscale.3 =C2=A0 =C2=A0 =C2=A0 =C2=A0Wed Mar 28=
 20:58:30 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -134,6 +134,7 @@ and the underlying hardware events used.
>>>> =C2=A0.Xr pmc 3 ,
>>>> =C2=A0.Xr pmc_cpuinfo 3 ,
>>>> =C2=A0.Xr pmclog 3 ,
>>>> +.Xr pmc.soft 3 ,
>>>> =C2=A0.Xr hwpmc 4
>>>> =C2=A0.Sh HISTORY
>>>> =C2=A0The
>>>>
>>>> Modified: head/lib/libpmc/pmclog.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmclog.c =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmclog.c =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -369,6 +369,12 @@ pmclog_get_event(void *cookie, char **da
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=3D=3D NULL)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0goto error;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
>>>> + =C2=A0 =C2=A0 =C2=A0 case PMCLOG_TYPE_PMCALLOCATEDYN:
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_READ32(le,ev=
->pl_u.pl_ad.pl_pmcid);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_READ32(le,ev=
->pl_u.pl_ad.pl_event);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_READ32(le,ev=
->pl_u.pl_ad.pl_flags);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_READSTRING(l=
e,ev->pl_u.pl_ad.pl_evname,PMC_NAME_MAX);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0case PMCLOG_TYPE_PMCATTACH:
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMCLOG_GET_PATH=
LEN(pathlen,evlen,pmclog_pmcattach);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMCLOG_READ32(l=
e,ev->pl_u.pl_t.pl_pmcid);
>>>>
>>>> Modified: head/lib/libpmc/pmclog.h
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/lib/libpmc/pmclog.h =C2=A0 =C2=A0Wed Mar 28 20:49:11 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/lib/libpmc/pmclog.h =C2=A0 =C2=A0Wed Mar 28 20:58:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -88,6 +88,13 @@ struct pmclog_ev_pmcallocate {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_id_t =C2=A0 =C2=A0 =C2=A0 =C2=A0pl_pmci=
d;
>>>> =C2=A0};
>>>>
>>>> +struct pmclog_ev_pmcallocatedyn {
>>>> + =C2=A0 =C2=A0 =C2=A0 uint32_t =C2=A0 =C2=A0 =C2=A0 =C2=A0pl_event;
>>>> + =C2=A0 =C2=A0 =C2=A0 char =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0p=
l_evname[PMC_NAME_MAX];
>>>> + =C2=A0 =C2=A0 =C2=A0 uint32_t =C2=A0 =C2=A0 =C2=A0 =C2=A0pl_flags;
>>>> + =C2=A0 =C2=A0 =C2=A0 pmc_id_t =C2=A0 =C2=A0 =C2=A0 =C2=A0pl_pmcid;
>>>> +};
>>>> +
>>>> =C2=A0struct pmclog_ev_pmcattach {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_id_t =C2=A0 =C2=A0 =C2=A0 =C2=A0pl_pmci=
d;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0pid_t =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pl=
_pid;
>>>> @@ -146,6 +153,7 @@ struct pmclog_ev {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmclog_e=
v_map_out =C2=A0 =C2=A0 =C2=A0 =C2=A0pl_mo;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmclog_e=
v_pcsample =C2=A0 =C2=A0 =C2=A0 pl_s;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmclog_e=
v_pmcallocate =C2=A0 =C2=A0pl_a;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct pmclog_ev_pm=
callocatedyn pl_ad;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmclog_e=
v_pmcattach =C2=A0 =C2=A0 =C2=A0pl_t;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmclog_e=
v_pmcdetach =C2=A0 =C2=A0 =C2=A0pl_d;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmclog_e=
v_proccsw =C2=A0 =C2=A0 =C2=A0 =C2=A0pl_c;
>>>>
>>>> Modified: head/sys/amd64/amd64/trap.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/amd64/amd64/trap.c Wed Mar 28 20:49:11 2012 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/amd64/amd64/trap.c Wed Mar 28 20:58:30 2012 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0(r233628)
>>>> @@ -71,6 +71,9 @@ __FBSDID("$FreeBSD$");
>>>> =C2=A0#include <sys/vmmeter.h>
>>>> =C2=A0#ifdef HWPMC_HOOKS
>>>> =C2=A0#include <sys/pmckern.h>
>>>> +PMC_SOFT_DEFINE( , , page_fault, all);
>>>> +PMC_SOFT_DEFINE( , , page_fault, read);
>>>> +PMC_SOFT_DEFINE( , , page_fault, write);
>>>> =C2=A0#endif
>>>>
>>>> =C2=A0#include <vm/vm.h>
>>>> @@ -743,8 +746,20 @@ trap_pfault(frame, usermode)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rv =3D vm_fault=
(map, va, ftype, VM_FAULT_NORMAL);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>>> - =C2=A0 =C2=A0 =C2=A0 if (rv =3D=3D KERN_SUCCESS)
>>>> + =C2=A0 =C2=A0 =C2=A0 if (rv =3D=3D KERN_SUCCESS) {
>>>> +#ifdef HWPMC_HOOKS
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ftype =3D=3D VM=
_PROT_READ || ftype =3D=3D VM_PROT_WRITE) {
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 PMC_SOFT_CALL_TF( , , page_fault, all, frame);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 if (ftype =3D=3D VM_PROT_READ)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMC_SOFT_CALL_TF( , , page_fault, re=
ad,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frame);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 else
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMC_SOFT_CALL_TF( , , page_fault, wr=
ite,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frame);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>>> +#endif
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
>>>> + =C2=A0 =C2=A0 =C2=A0 }
>>>> =C2=A0nogo:
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!usermode) {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (td->td_intr=
_nesting_level =3D=3D 0 &&
>>>>
>>>> Modified: head/sys/amd64/include/pmc_mdep.h
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/amd64/include/pmc_mdep.h =C2=A0 Wed Mar 28 20:49:11 2012 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/amd64/include/pmc_mdep.h =C2=A0 Wed Mar 28 20:58:30 2012 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -50,13 +50,13 @@ struct pmc_mdep;
>>>> =C2=A0* measurement architecture have PMCs of the following classes: T=
SC,
>>>> =C2=A0* IAF, IAP, UCF and UCP.
>>>> =C2=A0*/
>>>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_TSC =C2=A0 =
=C2=A0 =C2=A0 =C2=A00
>>>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_K8 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 1
>>>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_P4 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 1
>>>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_IAP =C2=A0 =
=C2=A0 =C2=A0 =C2=A01
>>>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_IAF =C2=A0 =
=C2=A0 =C2=A0 =C2=A02
>>>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_UCP =C2=A0 =
=C2=A0 =C2=A0 =C2=A03
>>>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_UCF =C2=A0 =
=C2=A0 =C2=A0 =C2=A04
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_TSC =C2=A0 =
=C2=A0 =C2=A0 =C2=A01
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_K8 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 2
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_P4 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 2
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_IAP =C2=A0 =
=C2=A0 =C2=A0 =C2=A02
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_IAF =C2=A0 =
=C2=A0 =C2=A0 =C2=A03
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_UCP =C2=A0 =
=C2=A0 =C2=A0 =C2=A04
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_UCF =C2=A0 =
=C2=A0 =C2=A0 =C2=A05
>>>>
>>>> =C2=A0/*
>>>> =C2=A0* On the amd64 platform we support the following PMCs.
>>>> @@ -119,6 +119,15 @@ union pmc_md_pmc {
>>>>
>>>> =C2=A0#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_IN_USERSPACE(va) ((va) <=
=3D VM_MAXUSER_ADDRESS)
>>>>
>>>> +/* Build a fake kernel trapframe from current instruction pointer. */
>>>> +#define PMC_FAKE_TRAPFRAME(TF) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \
>>>> + =C2=A0 =C2=A0 =C2=A0 do { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0\
>>>> + =C2=A0 =C2=A0 =C2=A0 (TF)->tf_cs =3D 0; (TF)->tf_rflags =3D 0; =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 \
>>>> + =C2=A0 =C2=A0 =C2=A0 __asm __volatile("movq %%rbp,%0" : "=3Dr" ((TF)=
->tf_rbp)); =C2=A0 =C2=A0 =C2=A0 =C2=A0\
>>>> + =C2=A0 =C2=A0 =C2=A0 __asm __volatile("movq %%rsp,%0" : "=3Dr" ((TF)=
->tf_rsp)); =C2=A0 =C2=A0 =C2=A0 =C2=A0\
>>>> + =C2=A0 =C2=A0 =C2=A0 __asm __volatile("call 1f \n\t1: pop %0" : "=3D=
r"((TF)->tf_rip)); \
>>>> + =C2=A0 =C2=A0 =C2=A0 } while (0)
>>>> +
>>>> =C2=A0/*
>>>> =C2=A0* Prototypes
>>>> =C2=A0*/
>>>>
>>>> Modified: head/sys/arm/include/pmc_mdep.h
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/arm/include/pmc_mdep.h =C2=A0 =C2=A0 Wed Mar 28 20:49:11 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/arm/include/pmc_mdep.h =C2=A0 =C2=A0 Wed Mar 28 20:58:30 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -29,7 +29,7 @@
>>>> =C2=A0#ifndef _MACHINE_PMC_MDEP_H_
>>>> =C2=A0#define =C2=A0 =C2=A0 =C2=A0 =C2=A0_MACHINE_PMC_MDEP_H_
>>>>
>>>> -#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_XSCALE =C2=A0=
 =C2=A0 0
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMC_MDEP_CLASS_INDEX_XSCALE =C2=A0=
 =C2=A0 1
>>>> =C2=A0/*
>>>> =C2=A0* On the ARM platform we support the following PMCs.
>>>> =C2=A0*
>>>>
>>>> Modified: head/sys/conf/files
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/conf/files Wed Mar 28 20:49:11 2012 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0(r233627)
>>>> +++ head/sys/conf/files Wed Mar 28 20:58:30 2012 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0(r233628)
>>>> @@ -1260,6 +1260,7 @@ dev/hme/if_hme_sbus.c =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 optional hme sbus
>>>> =C2=A0dev/hptiop/hptiop.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0opt=
ional hptiop scbus
>>>> =C2=A0dev/hwpmc/hwpmc_logging.c =C2=A0 =C2=A0 =C2=A0optional hwpmc
>>>> =C2=A0dev/hwpmc/hwpmc_mod.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional=
 hwpmc
>>>> +dev/hwpmc/hwpmc_soft.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 optional hwpmc
>>>> =C2=A0dev/ichsmb/ichsmb.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0opt=
ional ichsmb
>>>> =C2=A0dev/ichsmb/ichsmb_pci.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0optional ichsmb pci
>>>> =C2=A0dev/ida/ida.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0optional ida
>>>>
>>>> Modified: head/sys/dev/hwpmc/hwpmc_amd.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/dev/hwpmc/hwpmc_amd.c =C2=A0 =C2=A0 =C2=A0Wed Mar 28 20:4=
9:11 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/dev/hwpmc/hwpmc_amd.c =C2=A0 =C2=A0 =C2=A0Wed Mar 28 20:5=
8:30 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -687,7 +687,8 @@ amd_intr(int cpu, struct trapframe *tf)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0wrmsr(perfctr, =
AMD_RELOAD_COUNT_TO_PERFCTR_VALUE(v));
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Restart the =
counter if logging succeeded. */
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, pm, tf, TRAPF_USERMODE(tf));
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, PMC_HR, pm, tf,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TRAPF=
_USERMODE(tf));
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (error =3D=
=3D 0)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0wrmsr(evsel, config | AMD_PMC_ENABLE);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>>> @@ -874,7 +875,7 @@ amd_pcpu_fini(struct pmc_mdep *md, int c
>>>> =C2=A0struct pmc_mdep *
>>>> =C2=A0pmc_amd_initialize(void)
>>>> =C2=A0{
>>>> - =C2=A0 =C2=A0 =C2=A0 int classindex, error, i, nclasses, ncpus;
>>>> + =C2=A0 =C2=A0 =C2=A0 int classindex, error, i, ncpus;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmc_classdep *pcd;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0enum pmc_cputype cputype;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmc_mdep *pmc_mdep;
>>>> @@ -926,12 +927,9 @@ pmc_amd_initialize(void)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 * These processors have two classes of PMC=
s: the TSC and
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 * programmable PMCs.
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>>>> - =C2=A0 =C2=A0 =C2=A0 nclasses =3D 2;
>>>> - =C2=A0 =C2=A0 =C2=A0 pmc_mdep =3D malloc(sizeof(struct pmc_mdep) + n=
classes * sizeof (struct pmc_classdep),
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 M_PMC, M_WAITOK|M_ZERO);
>>>> + =C2=A0 =C2=A0 =C2=A0 pmc_mdep =3D pmc_mdep_alloc(2);
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_mdep->pmd_cputype =3D cputype;
>>>> - =C2=A0 =C2=A0 =C2=A0 pmc_mdep->pmd_nclass =C2=A0=3D nclasses;
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0ncpus =3D pmc_cpu_max();
>>>>
>>>>
>>>> Modified: head/sys/dev/hwpmc/hwpmc_core.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/dev/hwpmc/hwpmc_core.c =C2=A0 =C2=A0 Wed Mar 28 20:49:11 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/dev/hwpmc/hwpmc_core.c =C2=A0 =C2=A0 Wed Mar 28 20:58:30 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -2239,7 +2239,7 @@ core_intr(int cpu, struct trapframe *tf)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (pm->pm_stat=
e !=3D PMC_STATE_RUNNING)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0continue;
>>>>
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, pm, tf,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, PMC_HR, pm, tf,
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0T=
RAPF_USERMODE(tf));
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0v =3D pm->pm_sc=
.pm_reloadcount;
>>>> @@ -2326,7 +2326,7 @@ core2_intr(int cpu, struct trapframe *tf
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0!=
PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0continue;
>>>>
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, pm, tf,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, PMC_HR, pm, tf,
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0T=
RAPF_USERMODE(tf));
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (error)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0intrenable &=3D ~flag;
>>>> @@ -2354,7 +2354,7 @@ core2_intr(int cpu, struct trapframe *tf
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0!=
PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0continue;
>>>>
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, pm, tf,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, PMC_HR, pm, tf,
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0T=
RAPF_USERMODE(tf));
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (error)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0intrenable &=3D ~flag;
>>>>
>>>> Modified: head/sys/dev/hwpmc/hwpmc_intel.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/dev/hwpmc/hwpmc_intel.c =C2=A0 =C2=A0Wed Mar 28 20:49:11 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/dev/hwpmc/hwpmc_intel.c =C2=A0 =C2=A0Wed Mar 28 20:58:30 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -162,12 +162,10 @@ pmc_intel_initialize(void)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (NULL);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>>>
>>>> - =C2=A0 =C2=A0 =C2=A0 pmc_mdep =3D malloc(sizeof(struct pmc_mdep) + n=
classes *
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(struct pmc_classdep), M_PM=
C, M_WAITOK|M_ZERO);
>>>> + =C2=A0 =C2=A0 =C2=A0 /* Allocate base class and initialize machine d=
ependent struct */
>>>> + =C2=A0 =C2=A0 =C2=A0 pmc_mdep =3D pmc_mdep_alloc(nclasses);
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_mdep->pmd_cputype =C2=A0 =C2=A0=3D cput=
ype;
>>>> - =C2=A0 =C2=A0 =C2=A0 pmc_mdep->pmd_nclass =C2=A0 =C2=A0 =3D nclasses=
;
>>>> -
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_mdep->pmd_switch_in =C2=A0=3D intel_swi=
tch_in;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_mdep->pmd_switch_out =3D intel_switch_o=
ut;
>>>>
>>>>
>>>> Modified: head/sys/dev/hwpmc/hwpmc_logging.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/dev/hwpmc/hwpmc_logging.c =C2=A0Wed Mar 28 20:49:11 2012 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/dev/hwpmc/hwpmc_logging.c =C2=A0Wed Mar 28 20:58:30 2012 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -129,6 +129,7 @@ static struct mtx pmc_kthread_mtx; =C2=A0/* sl
>>>>
>>>> =C2=A0/* Emit a string. =C2=A0Caution: does NOT update _le, so needs t=
o be last */
>>>> =C2=A0#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMCLOG_EMITSTRING(S,L) =C2=A0=
do { bcopy((S), _le, (L)); } while (0)
>>>> +#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMCLOG_EMITNULLSTRING(L) do { bzer=
o(_le, (L)); } while (0)
>>>>
>>>> =C2=A0#define =C2=A0 =C2=A0 =C2=A0 =C2=A0PMCLOG_DESPATCH(PO) =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pmclog_release(=
(PO)); =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
>>>> @@ -835,16 +836,33 @@ void
>>>> =C2=A0pmclog_process_pmcallocate(struct pmc *pm)
>>>> =C2=A0{
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pmc_owner *po;
>>>> + =C2=A0 =C2=A0 =C2=A0 struct pmc_soft *ps;
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0po =3D pm->pm_owner;
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0PMCDBG(LOG,ALL,1, "pm=3D%p", pm);
>>>>
>>>> - =C2=A0 =C2=A0 =C2=A0 PMCLOG_RESERVE(po, PMCALLOCATE, sizeof(struct p=
mclog_pmcallocate));
>>>> - =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->pm_id);
>>>> - =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->pm_event);
>>>> - =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->pm_flags);
>>>> - =C2=A0 =C2=A0 =C2=A0 PMCLOG_DESPATCH(po);
>>>> + =C2=A0 =C2=A0 =C2=A0 if (PMC_TO_CLASS(pm) =3D=3D PMC_CLASS_SOFT) {
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_RESERVE(po, =
PMCALLOCATEDYN,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeo=
f(struct pmclog_pmcallocatedyn));
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->p=
m_id);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->p=
m_event);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->p=
m_flags);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ps =3D pmc_soft_ev_=
acquire(pm->pm_event);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ps !=3D NULL)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 PMCLOG_EMITSTRING(ps->ps_ev.pm_ev_name,PMC_NAME_MAX);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 PMCLOG_EMITNULLSTRING(PMC_NAME_MAX);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_soft_ev_release=
(ps);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_DESPATCH(po)=
;
>>>> + =C2=A0 =C2=A0 =C2=A0 } else {
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_RESERVE(po, =
PMCALLOCATE,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeo=
f(struct pmclog_pmcallocate));
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->p=
m_id);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->p=
m_event);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_EMIT32(pm->p=
m_flags);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMCLOG_DESPATCH(po)=
;
>>>> + =C2=A0 =C2=A0 =C2=A0 }
>>>> =C2=A0}
>>>>
>>>> =C2=A0void
>>>>
>>>> Modified: head/sys/dev/hwpmc/hwpmc_mips.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/dev/hwpmc/hwpmc_mips.c =C2=A0 =C2=A0 Wed Mar 28 20:49:11 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/dev/hwpmc/hwpmc_mips.c =C2=A0 =C2=A0 Wed Mar 28 20:58:30 =
2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -287,7 +287,7 @@ mips_pmc_intr(int cpu, struct trapframe
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D 1;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (pm->pm_stat=
e !=3D PMC_STATE_RUNNING)
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0continue;
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, pm, tf,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D pmc_proce=
ss_interrupt(cpu, PMC_HR, pm, tf,
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0T=
RAPF_USERMODE(tf));
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (error) {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0/* Clear/disable the relevant counter */
>>>>
>>>> Modified: head/sys/dev/hwpmc/hwpmc_mod.c
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>> --- head/sys/dev/hwpmc/hwpmc_mod.c =C2=A0 =C2=A0 =C2=A0Wed Mar 28 20:4=
9:11 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233627)
>>>> +++ head/sys/dev/hwpmc/hwpmc_mod.c =C2=A0 =C2=A0 =C2=A0Wed Mar 28 20:5=
8:30 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r233628)
>>>> @@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$");
>>>> =C2=A0#include <vm/vm_map.h>
>>>> =C2=A0#include <vm/vm_object.h>
>>>>
>>>> +#include "hwpmc_soft.h"
>>>> +
>>>> =C2=A0/*
>>>> =C2=A0* Types
>>>> =C2=A0*/
>>>> @@ -182,7 +184,7 @@ static int =C2=A0pmc_attach_one_process(struct
>>>> =C2=A0static int =C2=A0 =C2=A0 pmc_can_allocate_rowindex(struct proc *=
p, unsigned int ri,
>>>> =C2=A0 =C2=A0 int cpu);
>>>> =C2=A0static int =C2=A0 =C2=A0 pmc_can_attach(struct pmc *pm, struct p=
roc *p);
>>>> -static void =C2=A0 =C2=A0pmc_capture_user_callchain(int cpu, struct t=
rapframe *tf);
>>>> +static void =C2=A0 =C2=A0pmc_capture_user_callchain(int cpu, int soft=
, struct trapframe *tf);
>>>> =C2=A0static void =C2=A0 =C2=A0pmc_cleanup(void);
>>>> =C2=A0static int =C2=A0 =C2=A0 pmc_detach_process(struct proc *p, stru=
ct pmc *pm);
>>>> =C2=A0static int =C2=A0 =C2=A0 pmc_detach_one_process(struct proc *p, =
struct pmc *pm,
>>>> @@ -206,7 +208,7 @@ static void pmc_process_csw_out(struct t
>>>> =C2=A0static void =C2=A0 =C2=A0pmc_process_exit(void *arg, struct proc=
 *p);
>>>> =C2=A0static void =C2=A0 =C2=A0pmc_process_fork(void *arg, struct proc=
 *p1,
>>>> =C2=A0 =C2=A0 struct proc *p2, int n);
>>>> -static void =C2=A0 =C2=A0pmc_process_samples(int cpu);
>>>> +static void =C2=A0 =C2=A0pmc_process_samples(int cpu, int soft);
>>>> =C2=A0static void =C2=A0 =C2=A0pmc_release_pmc_descriptor(struct pmc *=
pmc);
>>>> =C2=A0static void =C2=A0 =C2=A0pmc_remove_owner(struct pmc_owner *po);
>>>> =C2=A0static void =C2=A0 =C2=A0pmc_remove_process_descriptor(struct pm=
c_process *pp);
>>>> @@ -218,12 +220,16 @@ static int =C2=A0 =C2=A0 =C2=A0 =C2=A0pmc_stop(s=
truct pmc *pm);
>>>> =C2=A0static int =C2=A0 =C2=A0 pmc_syscall_handler(struct thread *td, =
void *syscall_args);
>>>> =C2=A0static void =C2=A0 =C2=A0pmc_unlink_target_process(struct pmc *p=
mc,
>>>> =C2=A0 =C2=A0 struct pmc_process *pp);
>>>> +static int generic_switch_in(struct pmc_cpu *pc, struct pmc_process *=
pp);
>>>> +static int generic_switch_out(struct pmc_cpu *pc, struct pmc_process =
*pp);
>>>> +static struct pmc_mdep *pmc_generic_cpu_initialize(void);
>>>> +static void pmc_generic_cpu_finalize(struct pmc_mdep *md);
>>>>
>>>> =C2=A0/*
>>>> =C2=A0* Kernel tunables and sysctl(8) interface.
>>>> =C2=A0*/
>>>>
>>>> -SYSCTL_NODE(_kern, OID_AUTO, hwpmc, CTLFLAG_RW, 0, "HWPMC parameters"=
);
>>>> +SYSCTL_DECL(_kern_hwpmc);
>>>>
>>>> =C2=A0static int pmc_callchaindepth =3D PMC_CALLCHAIN_DEPTH;
>>>> =C2=A0TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "callchaindepth", &pmc_callch=
aindepth);
>>>> @@ -1833,7 +1839,9 @@ const char *pmc_hooknames[] =3D {
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0"KLDUNLOAD",
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0"MMAP",
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0"MUNMAP",
>>>> - =C2=A0 =C2=A0 =C2=A0 "CALLCHAIN"
>>>> + =C2=A0 =C2=A0 =C2=A0 "CALLCHAIN-NMI",
>>>> + =C2=A0 =C2=A0 =C2=A0 "CALLCHAIN-SOFT",
>>>> + =C2=A0 =C2=A0 =C2=A0 "SOFTSAMPLING"
>>>> =C2=A0};
>>>> =C2=A0#endif
>>>>
>>>> @@ -1992,7 +2000,8 @@ pmc_hook_handler(struct thread *td, int
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * lose the int=
errupt sample.
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0CPU_CLR_ATOMIC(=
PCPU_GET(cpuid), &pmc_cpumask);
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_process_samples=
(PCPU_GET(cpuid));
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_process_samples=
(PCPU_GET(cpuid), PMC_HR);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_process_samples=
(PCPU_GET(cpuid), PMC_SR);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
>>>>
>>>>
>>>> @@ -2022,11 +2031,30 @@ pmc_hook_handler(struct thread *td, int
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KASSERT(td =3D=
=3D curthread, ("[pmc,%d] td !=3D curthread",
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_=
_LINE__));
>>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_capture_user_ca=
llchain(PCPU_GET(cpuid),
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_capture_user_ca=
llchain(PCPU_GET(cpuid), PMC_HR,
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(=
struct trapframe *) arg);
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0td->td_pflags &=
=3D ~TDP_CALLCHAIN;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
>>>>
>>>> + =C2=A0 =C2=A0 =C2=A0 case PMC_FN_USER_CALLCHAIN_SOFT:
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Record a ca=
ll chain.
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KASSERT(td =3D=3D c=
urthread, ("[pmc,%d] td !=3D curthread",
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __LIN=
E__));
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_capture_user_ca=
llchain(PCPU_GET(cpuid), PMC_SR,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (stru=
ct trapframe *) arg);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 td->td_pflags &=3D =
~TDP_CALLCHAIN;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 case PMC_FN_SOFT_SAMPLING:
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Call soft P=
MC sampling intr.
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pmc_soft_intr((stru=
ct pmckern_soft *) arg);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>>>> +
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0default:
>>>> =C2=A0#ifdef DEBUG
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KASSERT(0, ("[p=
mc,%d] unknown hook %d\n", __LINE__, function));
>>>> @@ -2221,18 +2249,17 @@ pmc_destroy_pmc_descriptor(struct pmc *p
>>>> =C2=A0static void
>>>> =C2=A0pmc_wait_for_pmc_idle(struct pmc *pm)
>>>> =C2=A0{
>>>> -#ifdef DEBUG
>>>> +#ifdef DEBUG
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0volatile int maxloop;
>>>>
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0maxloop =3D 100 * pmc_cpu_max();
>>>> =C2=A0#endif
>>>> -
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0/*
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Loop (with a forced context switch) till=
 the PMC's runcount
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 * comes down to zero.
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0while (atomic_load_acq_32(&pm->pm_runcount)=
 > 0) {
>>>> -#ifdef DEBUG
>>>> +#ifdef DEBUG
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0maxloop--;
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KASSERT(maxloop=
 > 0,
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(=
"[pmc,%d] (ri%d, rc%d) waiting too long for "
>>>> @@ -2972,6 +2999,53 @@ pmc_syscall_handler(struct thread *td, v
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
>>>>
>>>> + =C2=A0 =C2=A0 =C2=A0 /*
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0* Retrieve soft events list.
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
>>>> + =C2=A0 =C2=A0 =C2=A0 case PMC_OP_GETDYNEVENTINFO:
>>>> + =C2=A0 =C2=A0 =C2=A0 {
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 enum pmc_class =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cl;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 enum pmc_event =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ev;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct pmc_op_getdy=
neventinfo =C2=A0 *gei;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct pmc_dyn_even=
t_descr =C2=A0 =C2=A0 =C2=A0dev;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct pmc_soft =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *ps;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint32_t =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ne=
vent;
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sx_assert(&pmc_sx, =
SX_LOCKED);
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gei =3D (struct pmc=
_op_getdyneventinfo *) arg;
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((error =3D copy=
in(&gei->pm_class, &cl, sizeof(cl))) !=3D 0)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 break;
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Only SOFT class =
is dynamic. */
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (cl !=3D PMC_CLA=
SS_SOFT) {
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 error =3D EINVAL;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 break;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nevent =3D 0;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (ev =3D PMC_EV_=
SOFT_FIRST; ev <=3D PMC_EV_SOFT_LAST; ev++) {
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ps =3D pmc_soft_ev_acquire(ev);
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 if (ps =3D=3D NULL)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 bcopy(&ps->ps_ev, &dev, sizeof(dev));
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 pmc_soft_ev_release(ps);
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 error =3D copyout(&dev,
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &gei->pm_events[nevent],
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 sizeof(struct pmc_dyn_event_descr));
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 if (error !=3D 0)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 nevent++;
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (error !=3D 0)
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 break;
>>>> +
>>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error =3D copyout(&=
nevent, &gei->pm_nevent,
>>>>
>>>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
>>
>>
>>
>> --
>> Monthadar Al Jaberi
>> <RSPRO_USB_PROD>
>
>



--=20
Monthadar Al Jaberi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BsBSo%2B%2BDytD_0b%2BFh=aPzpgx8LMEH=%2B48bq6thxTgUdhDYyrw>