Implement iOS startup time tracing#2355
Conversation
premun
left a comment
There was a problem hiding this comment.
Didn't mean to intrude but I was curious in how we measure the startup in iOS.
The new --no-wait could simplify the code a bit I think but I understand that this is working and is totally fine.
| os.remove(file) | ||
|
|
||
| cmdline = xharnesscommand() + [self.devicetype, 'state', '--adb'] | ||
| cmdline = xharnesscommand() + ['android', 'state', '--adb'] |
There was a problem hiding this comment.
Is there a reason that we are moving to the hardcoded value here, when we know that the value will be android because of the elif block?
There was a problem hiding this comment.
basically because of that, it is always android in that block so using a variable is just slightly harder to read IMO.
There was a problem hiding this comment.
Also apple/wasm state --adb is not a valid command so it is imho better to hardcode.
That being said, you could now utilize the android adb command directly and this call and some other below can be removed. You don't need to now get ADB's location from adb.stdout.strip() and call
xharnesscommand() + ['android', 'adb', '--', 'shell', 'vm', 'size']
I'd even maybe add adbcommand() that would do xharnesscommand() + ['android', 'adb', '--']
| 'log', | ||
| 'collect', | ||
| '--device', | ||
| '--start', runCmdTimestamp.strftime("%Y-%m-%d %H:%M:%S"), |
There was a problem hiding this comment.
Couldn't we just get this time from the device itself, so that way we would not be reliant on the two clocks being in sync?
There was a problem hiding this comment.
@DrewScoggins sorry, didn't see this comment until now. There's not an easy way to get the time from the device (at least that I know of).
One thing that might be a better option would be to do an initial log collect and look at the timestamp of the last event in there as our starting point. We can do that if it ever becomes a problem, iPhones/Macs usually do a good job of keeping the time in sync with a timeserver as long as they have Internet connectivity.
No description provided.