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

# setElementValues

```
virtual IOReturn setElementValues(int element_index, IOReportElementValues *values, uint64_t record_time);
```

## Parameters

`element_index`

- index of the _element in internal array

`values`

- IORepoterElementValues to replace those at _elements[idx]

`record_time`

- optional mach_absolute_time to be used for metadata

## Return Value

IOReturn code

## Discussion

\abstract Atomically update a specific member of _elements[].
\discussion element_index can be obtained from getFirstElementIndex().  If
record_time is not provided, IOReporter::setElementValues() will
fetch the current mach_absolute_time.  If the current time is
already known, it is more efficient to pass it along.

Locking: Caller must ensure that the reporter (data) lock is held.

---

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)