Skip to content
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

APP cpuUsage greater than 100% #109

Open
VishalKumarX100 opened this issue May 2, 2023 · 5 comments
Open

APP cpuUsage greater than 100% #109

VishalKumarX100 opened this issue May 2, 2023 · 5 comments

Comments

@VishalKumarX100
Copy link

VishalKumarX100 commented May 2, 2023

Smartphone (please complete the following information):

Device - iphone 12
OS -16
Pyidevice Version 2.2.0

Describe the bug
While using this command for getting app CPU usage, sometimes I am getting cpuUsage greater than 100%. what does this field signify in the output pasted below. Is this related to cores. or this is an error

pyidevice instruments sysmontap --bundle_id com.bundle.id --processes -cf tmp.txt --udid 00000108-000ABCD00001E

[('appPackage', {'memRShrd': 13647872, '__arch': 16777228, '__sandbox': True, 'diskBytesRead': 25415680, 'timerWakeBin2': 0, 'responsibleUniqueID': 0, 'msgRecv': 3459, 'latencyQosTier': 0, 'procFlags': 20987952, 'cpuUsage': 0.04797930536131817, 'tdev': -1, 'timerWakeBin1': 0, 'sysCallsMach': 17065, 'machPortCount': 233, 'rgid': 501, 'memCompressed': 0, 'platIdleWakeups': 29, 'tpgid': 0, 'wqNumThreads': 4, 'wqState': 0, '__restricted': False, 'sysCallsUnix': 70016, 'ppid': 1, 'svgid': 501, 'wqRunThreads': 0, 'procXstatus': 0, 'vmPageIns': 665, 'name': 'JobGet', 'policy': 1, 'ctxSwitch': 12519, 'memResidentSize': 105889792, 'threadCount': 12, 'pjobc': 0, 'threadsSystem': 351165916, 'uid': 501, 'priority': 31, 'memAnon': 32718848, 'cpuTotalSystem': 740381000, 'physFootprint': 32572992, 'nice': 0, 'uniqueID': 1800, 'comm': 'bundle.id', 'throughputQosTier': 0, 'nfiles': 50, 'coalitionID': 674, 'intWakeups': 200, 'memRPrvt': 23707648, 'ruid': 501, 'wiredSize': 0, 'pid': 1800, 'procAge': 38104946750, 'numRunning': 0, 'memAnonPeak': 33505280, 'powerScore': 0.04797930536131817, 'memVirtualSize': 418504065024, 'gid': 501, 'appSleep': False, 'responsiblePID': 1, 'msgSent': 9719, 'diskBytesWritten': 10215424, 'cowFaults': 637, 'pgid': 1800, 'procStatus': 2, 'totalEnergyScore': 158731846142, 'threadsUser': 436358791, 'faults': 9371, 'wqBlockedThreads': 0, 'parentUniqueID': 1, 'startAbsTime': 493105043857, 'memPurgeable': 344064, 'cpuTotalUser': 822345791, 'avgPowerScore': 416.5649336381765, '__suddenTerm': False, 'svuid': 501})]

@YueChen-C
Copy link
Owner

cpuUsage may be greater than 100% when multi-core cpu is used

@VishalKumarX100
Copy link
Author

@YueChen-C , I am concerned about the CPU usage for an IOS application. how to get the correct data. Also is there any way to determine the number of CPU cores through py-ios-device

@YueChen-C
Copy link
Owner

Fields EnabledCPUs and SystemCPUUsage returned by sysmontap

@VishalKumarX100
Copy link
Author

VishalKumarX100 commented May 4, 2023

@YueChen-C
I am trying to use sysmontap for APP cpu usage, for system CPU I am using monitor.

APP - pyidevice instruments sysmontap --bundle_id io.bundle.id --processes --proc_filter cpuUsage --udid 00008101-ID
SYS - pyidevice instruments monitor --filter cpu --udid 00008101-ID

should I divide APP CPU usage by the number of cores
I wanted to confirm for APP CPU usage
can you please confirm

@VishalKumarX100
Copy link
Author

@YueChen-C , dividing by the number of cores for APP CPU utilization is giving unexpected results. it works for SYS CPU

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

No branches or pull requests

2 participants