Skip to content

Update CPU, Architecture and OSInfo system attributes #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 16, 2025

Conversation

melekr
Copy link
Collaborator

@melekr melekr commented Mar 28, 2025

Adds OSInfo name, version and buildNumber
Adds CPU/Device architecture
Fixes Uname .machine and .model attributes
Adds isSimulator attribute

ref: BT-5714

Add OSInfo name, version and buildNumber
Add CPU/Device architecture
Fix uname machine  and model attributes
Add isSimulator attribute
@melekr melekr self-assigned this Mar 28, 2025
@melekr melekr marked this pull request as ready for review March 28, 2025 23:06
Comment on lines 107 to 108
result["device.arch"] = CPU.architecture()
result["cpu.arch"] = CPU.architecture()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. why both?
  2. you don't have any caching here - it means this function will do a lot of stuff twice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting both to avoid "Unknown Architecture", device.arch & cpu.arch are the same thing but developers can filter using either one.

@@ -125,6 +127,33 @@ struct SystemControl {
return baseAddress.withMemoryRebound(to: T.self, capacity: 1, { $0.pointee })
})
}

static func string(forKeys keys: [Int32]) throws -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the point of the string functioN?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we can change the function name it would be great.

@melekr melekr marked this pull request as draft March 31, 2025 14:48
@melekr melekr marked this pull request as ready for review April 23, 2025 03:23
@@ -125,6 +127,33 @@ struct SystemControl {
return baseAddress.withMemoryRebound(to: T.self, capacity: 1, { $0.pointee })
})
}

static func string(forKeys keys: [Int32]) throws -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we can change the function name it would be great.

@melekr melekr merged commit 44b2bf5 into master Jun 16, 2025
4 checks passed
@melekr melekr deleted the device_sysctl_attributes branch June 16, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants