<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOReporter_IVars/legendWith",
  "metadataVersion" : "0.1.0",
  "role" : "Static Method",
  "symbol" : {
    "kind" : "Static Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOReporter_IVars@F@legendWith#*$@S@OSArray#S0_#$@SA@IOReportChannelType#k#S"
  },
  "title" : "legendWith"
}
-->

# legendWith

```
static OSSharedPtr<IOReportLegendEntry> legendWith(OSArray *channelIDs, OSArray *channelNames, IOReportChannelType channelType, IOReportUnit unit);
```

## Parameters

`channelIDs`

- OSArray of OSNumber(uint64_t) channels IDs.

`channelNames`

- parrallel OSArray of OSSymbol(rich names)

`channelType`

- the type of all channels in this legend

`unit`

- The unit for the quantity recorded by this reporter object

## Return Value

An IOReportLegendEntry object or NULL on failure

## Discussion

\abstract Internal method to help create legend entries
\discussion This static method is the main legend creation function. It is called by
IOReporter sub-classes and is responsible for building an
IOReportLegendEntry corresponding to this reporter object.
This legend entry may be extended by the sub-class of IOReporter if
required.

Locking: SAFE to call concurrently (no static globals), MAY BLOCK

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)