Visual Studio 2010 SP1 is required.
Generates the lightweight profiling (LWP) instruction slwpcb to flush internal lightweight profiling state to the ring buffer and return the address of the currently active lightweight profiling control block (LWPCB).
void * __slwpcb ();
The effective address of the currently active LWPCB.
Header file <intrin.h>
This intrinsic generates code that flushes the internal LWP hardware state to the currently active ring buffer and returns the address of the currently active LWPCB (which contains a pointer to this ring buffer).
The slwpcb instruction is part of the LWP family of instructions The LWP instructions require both hardware and operating system support. To determine hardware support for LWP, call the __cpuid intrinsic with InfoType = 0x80000001 and check bit 15 of CPUInfo (ECX). This bit is 1 when LWP is supported, and 0 otherwise. Once you know that LWP is supported by the processor, call the __cpuid intrinsic with InfoType = 0x8000001C and check bit 0 of CPUInfo(EAX). This bit is 1 if the operating system has made LWP available, 0 otherwise. This __cpuid test also returns additional information about the LWP implementation. See __llwpcb and AMD's "Lightweight Profiling Specification" (Publication Number 43724) for more information.
For an example, see __llwpcb.