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

Add: ftrace support #130

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Add: ftrace support #130

wants to merge 4 commits into from

Conversation

TriedAngle
Copy link
Contributor

@apaolillo @jschwe

this pull request's intention is to add ftrace parsing support to benchkit.
it's not complete yet, I seem to have issues with the parsing of the events.

I also had the issue of instantiating adb bridge with my local android device that does not have an IP Address but a small identifier code (similar to hdc right now?) do I miss something? For a quick workaround I removed ip_addr and port from AndroidDebugBridge and added identifier to it (this may cause issues for other things?, at least it works for my experimentation) I also added a from_device constructor for the AndroidDebugBridge, very similar to HDC.

@apaolillo
Copy link
Collaborator

Adding ftrace support is a great idea!
But shouldn't this be develop in a module that is independent from Android? This is a general capability of Linux right? Btw for now I only see a test file (and no real "integration" of the module), I guess you're trying this out?

@apaolillo apaolillo marked this pull request as draft October 13, 2024 17:58
@apaolillo apaolillo self-requested a review October 13, 2024 17:58
@TriedAngle
Copy link
Contributor Author

This is a general capability of Linux right?

yes it is, android is just the target of main concern right now, so tested it with it. I will make it into a module once it works and split the test between android and linux (and maybe harmony)

Btw for now I only see a test file (and no real "integration" of the module), I guess you're trying this out?

yes, it's a mix between trying out and adding the module. Once the test works, it's moved into a module.

event_stack = []

# TODO: fix this parsing, it seems to be incorrect
with open(file, "r") as f:
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to use the perfetto trace processor. https://perfetto.dev/docs/analysis/trace-processor-python
Did you try it out already and ran into issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no i did not, but this looks like a very promising idea, I'll try it out.

@TriedAngle
Copy link
Contributor Author

TriedAngle commented Oct 19, 2024

@jschwe @apaolillo the perfetto TraceProcessor works and allows easy event filtering via SQL.
The next step is to extract it and write a library out of it. Where in benchkit/ would be a good place for that?
Concerning benchmarks, I suppose this is a pre and post run hook.

Also where should the platform abstraction take place? Right now the comm layer is not working for android and harmony, and if we assume it was, where would the current functions like: enable_tracing(AndroidDebugBridge) be placed?

# Returns:
# str: adb identifier of current device.
# """
# return _identifier_from(ip_addr=self._ip, port=self._port)
Copy link
Member

Choose a reason for hiding this comment

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

Why can't this just return self.identifier?

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.

3 participants