1*59af95e0SDapeng MiWhat: /sys/bus/event_source/devices/cpu.../rdpmc 2*59af95e0SDapeng MiDate: November 2011 3*59af95e0SDapeng MiKernelVersion: 3.10 4*59af95e0SDapeng MiContact: Linux kernel mailing list linux-kernel@vger.kernel.org 5*59af95e0SDapeng MiDescription: The /sys/bus/event_source/devices/cpu.../rdpmc attribute 6*59af95e0SDapeng Mi is used to show/manage if rdpmc instruction can be 7*59af95e0SDapeng Mi executed in user space. This attribute supports 3 numbers. 8*59af95e0SDapeng Mi - rdpmc = 0 9*59af95e0SDapeng Mi user space rdpmc is globally disabled for all PMU 10*59af95e0SDapeng Mi counters. 11*59af95e0SDapeng Mi - rdpmc = 1 12*59af95e0SDapeng Mi user space rdpmc is globally enabled only in event mmap 13*59af95e0SDapeng Mi ioctl called time window. If the mmap region is unmapped, 14*59af95e0SDapeng Mi user space rdpmc is disabled again. 15*59af95e0SDapeng Mi - rdpmc = 2 16*59af95e0SDapeng Mi user space rdpmc is globally enabled for all PMU 17*59af95e0SDapeng Mi counters. 18*59af95e0SDapeng Mi 19*59af95e0SDapeng Mi In the Intel platforms supporting counter level's user 20*59af95e0SDapeng Mi space rdpmc disable feature (CPUID.23H.EBX[2] = 1), the 21*59af95e0SDapeng Mi meaning of 3 numbers is extended to 22*59af95e0SDapeng Mi - rdpmc = 0 23*59af95e0SDapeng Mi global user space rdpmc and counter level's user space 24*59af95e0SDapeng Mi rdpmc of all counters are both disabled. 25*59af95e0SDapeng Mi - rdpmc = 1 26*59af95e0SDapeng Mi No changes on behavior of global user space rdpmc. 27*59af95e0SDapeng Mi counter level's rdpmc of system-wide events is disabled 28*59af95e0SDapeng Mi but counter level's rdpmc of non-system-wide events is 29*59af95e0SDapeng Mi enabled. 30*59af95e0SDapeng Mi - rdpmc = 2 31*59af95e0SDapeng Mi global user space rdpmc and counter level's user space 32*59af95e0SDapeng Mi rdpmc of all counters are both enabled unconditionally. 33*59af95e0SDapeng Mi 34*59af95e0SDapeng Mi The default value of rdpmc is 1. 35*59af95e0SDapeng Mi 36*59af95e0SDapeng Mi Please notice: 37*59af95e0SDapeng Mi - global user space rdpmc's behavior would change 38*59af95e0SDapeng Mi immediately along with the rdpmc value's change, 39*59af95e0SDapeng Mi but the behavior of counter level's user space rdpmc 40*59af95e0SDapeng Mi won't take effect immediately until the event is 41*59af95e0SDapeng Mi reactivated or recreated. 42*59af95e0SDapeng Mi - The rdpmc attribute is global, even for x86 hybrid 43*59af95e0SDapeng Mi platforms. For example, changing cpu_core/rdpmc will 44*59af95e0SDapeng Mi also change cpu_atom/rdpmc. 45