> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ConfigureNBPMCs

> ConfigureNBPMCs

# ConfigureNBPMCs

配置北桥内部的四个硬件性能监视计数器 (PMC)，以便游戏能够直接为游戏代码读取这些计数器。

## 语法

```cpp theme={null}
HRESULT ConfigureNBPMCs(  
         unsigned int eventIndex6,  
         unsigned int eventIndex7,  
         unsigned int eventIndex8,  
         unsigned int eventIndex9  
)  
```

### 参数

*eventIndex6*   \
类型：unsigned int

要计数的事件的索引。

*eventIndex7*   \
类型：unsigned int

要计数的事件的索引。

*eventIndex8*   \
类型：unsigned int

要计数的事件的索引。

*eventIndex9*   \
类型：unsigned int

要计数的事件的索引。

### 返回值

类型：HRESULT

成功或错误代码。

| 代码                | 描述           |
| ----------------- | ------------ |
| S\_OK             | 成功。          |
| E\_INVALIDARG     | 一个或多个索引超出范围。 |
| E\_ACCESS\_DENIED | 对驱动程序的访问被拒绝。 |

## 备注

北桥有 4 个可以计数事件的性能计数器。NB PMC 值可以从任何核心读取。北桥内存事务为 64 字节。

带 \* 号的事件是从 DRAM 控制器 (DCT) 记录的。仅在配置这些事件时设置 eventIndex6，因为需要为每个 DRAM 控制器设置相同的事件。
在 XBOX One 上，我们有 4 个 DRAM 控制器和 4 个计数器，因此将 PMC6-PMC9 相加即可得到总结果。\
例如：NBAllReadWrites 的总内存流量 = (PCM6+PMC7+PCM8+PMC9) \* 64

在 XBOX One X 上，我们有 12 个 DRAM 控制器和 4 个计数器，因此我们仅统计每 3 个 DCT 的流量。内存流量基本对称，因此可以合理地假设事件总数是 PMC6-PMC9 之和的三倍。\
例如：NBAllReadWrites 的总内存流量 = (PCM6+PMC7+PCM8+PMC9) \* 3 \* 64

| 索引 | 事件                    | 描述               |
| -- | --------------------- | ---------------- |
| 0  | Reserved              |                  |
| 1  | NBGarlicReads\*       | garlic 总线读取次数    |
| 2  | NBGarlicWrites\*      | garlic 总线写入次数    |
| 3  | NBGarlicReadsWrites\* | garlic 总线读取和写入次数 |
| 4  | NBOnionReads\*        | onion 总线读取次数     |
| 5  | NBOnionWrites\*       | onion 总线写入次数     |
| 6  | NBOnionReadsWrites\*  | onion 总线读取和写入次数  |
| 7  | NBAllReadWrites\*     | 所有 NB 读取和写入次数    |
| 8  | NBCPUToMemory         | CPU 到内存的事务次数     |
| 9  | NBIOToMemory          | IO 到内存的事务次数      |

## 要求

**头文件：** pix3.h

**库：** pixevt.lib

**支持的平台：** XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[GetPMCValue](/reference/tools/pix3/functions/getpmcvalue)\
[ConfigurePMCs](/reference/tools/pix3/functions/configurepmcs)\
[ConfigureL2IPMCs](/reference/tools/pix3/functions/configurel2ipmcs)\
[XBOX 上的 PIX3](/reference/tools/pix3/pix3_members)\
[PIX（NDA 主题）](/tools/tools-console/pix/pix)


## Related topics

- [ConfigurePMCs](/zh-CN/reference/tools/pix3/functions/configurepmcs.md)
- [ConfigureL2IPMCs](/zh-CN/reference/tools/pix3/functions/configurel2ipmcs.md)
- [GetPMCValue](/zh-CN/reference/tools/pix3/functions/getpmcvalue.md)
- [PIX3](/zh-CN/reference/tools/pix3/pix3_members.md)
- [PartyChatControl::ConfigureAudioManipulationVoiceStream](/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_configureaudiomanipulationvoicestream.md)
