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

AdpfWrapper: Add trace for actualDurationNanos #2143

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

robertwu1
Copy link
Collaborator

With ATrace, we can profile the time between callbacks for the workload. Perfetto provides a nice UI to see this callback time in comparison to other metrics like CPU usage and the ADPF session batch size.

Instructions:

  1. Start the perfetto trace on your computer with adb shell -t perfetto audio sched freq power hal idle binder_driver ss --time 20s --out /data/misc/perfetto-traces/test123.pf --app com.mobileer.oboetester
  2. Pull the perfetto trace from the android phone to your computer adb pull /data/misc/perfetto-traces/test123.pf localfile.pf
  3. Open the new file in ui.perfetto.dev

Note that ATrace_setCounter() is only supported on Android level 29 and above and ATrace_isEnabled() is enabled only when the perfetto command is run from adb shell.

@robertwu1 robertwu1 requested a review from philburk January 22, 2025 23:54
src/common/AdpfWrapper.cpp Outdated Show resolved Hide resolved

if (ATrace_beginSection != nullptr && ATrace_endSection != nullptr){
mIsTracingSupported = true;
if (ATrace_beginSection != nullptr && ATrace_endSection != nullptr && ATrace_isEnabled != nullptr && ATrace_isEnabled()){
Copy link
Collaborator

Choose a reason for hiding this comment

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

long line

static void beginSection(const char *format, ...);
static void endSection();
static void initialize();
namespace oboe {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add short comment about being a wrapper for tracing for use with Perfetto.

src/common/AdpfWrapper.cpp Outdated Show resolved Hide resolved
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