当前位置: 首页>>代码示例>>C++>>正文


C++ PerformanceCounter::getEventSelect方法代码示例

本文整理汇总了C++中PerformanceCounter::getEventSelect方法的典型用法代码示例。如果您正苦于以下问题:C++ PerformanceCounter::getEventSelect方法的具体用法?C++ PerformanceCounter::getEventSelect怎么用?C++ PerformanceCounter::getEventSelect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PerformanceCounter的用法示例。


在下文中一共展示了PerformanceCounter::getEventSelect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mask

void Processor::K10PerformanceCounters::perfCounterGetInfo (class Processor *p) {

	PerformanceCounter *performanceCounter;
	DWORD node, core, slot;

	printf ("Caption:\n");
	printf ("Evt:\tperformance counter event\n");
	printf ("En:\tperformance counter is enabled\n");
	printf ("U:\tperformance counter will count usermode instructions\n");
	printf ("OS:\tperformance counter will counter Os/kernel instructions\n");
	printf ("cMsk:\tperformance counter mask (see processor manual reference)\n");
	printf ("ED:\tcounting on edge detect, else counting on level detect\n");
	printf ("APIC:\tif set, an APIC interrupt will be issued on counter overflow\n");
	printf ("icMsk:\tif set, mask is inversed (see processor manual reference)\n");
	printf ("uMsk:\tunit mask (see processor manual reference)\n\n");

	for (node = 0; node < p->getProcessorNodes(); node++)
	{
		printf ("--- Node %d\n", node);

		p->setNode(node);
		p->setCore(ALL_CORES);

		for (slot = 0; slot < p->getMaxSlots(); slot++)
		{
			performanceCounter = new PerformanceCounter(p->getMask(), slot, p->getMaxSlots());

			for (core = 0; core < p->getProcessorCores(); core++)
			{
				if (!performanceCounter->fetch (core))
				{
					printf ("K10PerformanceCounters.cpp::perfCounterGetInfo - unable to read performance counter register\n");
					free (performanceCounter);
					return;
				}

				printf ("Slot %d core %d - evt:0x%x En:%d U:%d OS:%d cMsk:%x ED:%d APIC:%d icMsk:%x uMsk:%x\n",
						slot,
						core,
						performanceCounter->getEventSelect(),
						performanceCounter->getEnabled(),
						performanceCounter->getCountUserMode(),
						performanceCounter->getCountOsMode(),
						performanceCounter->getCounterMask(),
						performanceCounter->getEdgeDetect(),
						performanceCounter->getEnableAPICInterrupt(),
						performanceCounter->getInvertCntMask(),
						performanceCounter->getUnitMask()
						);
			}
			free (performanceCounter);
		}
	}
}
开发者ID:kszysiu,项目名称:tpc,代码行数:54,代码来源:K10PerformanceCounters.cpp


注:本文中的PerformanceCounter::getEventSelect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。