Skip to content

Implement iOS startup time tracing #2355

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 7 commits into from
Apr 12, 2022
Merged

Conversation

akoeplinger
Copy link
Member

No description provided.

Copy link
Member

@LoopedBard3 LoopedBard3 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@premun premun left a comment

Choose a reason for hiding this comment

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

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.

@@ -327,7 +329,7 @@ def run(self):
getLogger().info("Removed: " + os.path.join(const.TRACEDIR, file))
os.remove(file)

cmdline = xharnesscommand() + [self.devicetype, 'state', '--adb']
cmdline = xharnesscommand() + ['android', 'state', '--adb']
Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

basically because of that, it is always android in that block so using a variable is just slightly harder to read IMO.

Copy link
Member

@premun premun May 2, 2022

Choose a reason for hiding this comment

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

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"),
Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

@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.

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.

5 participants