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

android simpleperf support #224

Closed
bylanhao opened this issue Dec 25, 2019 · 8 comments
Closed

android simpleperf support #224

bylanhao opened this issue Dec 25, 2019 · 8 comments

Comments

@bylanhao
Copy link

Your application is perfect in x86 arch, but in embedded, it has a issue to used.
Can you develop analytics based on perf.script? Follow the steps of your document analysis to analyze the embedded perf.data, most of the time hotspot didn't work.
And many Android app can use simpleperf to get perf script, it's hard to use hotspot to analysis android app.

@milianw
Copy link
Member

milianw commented Jan 5, 2020

Hey! Can you please tell me why you think hotspot doesn't work for the embedded use-case? Are you passing the correct paths to e.g. --sysroot - see hotspot --help for more information:

hotspot --help
Usage: hotspot [options] [files...]
Linux perf GUI for performance analysis.

Options:
  -h, --help               Displays help on commandline options.
  --help-all               Displays help including Qt specific options.
  -v, --version            Displays version information.
  --sysroot <path>         Path to sysroot which is used to find libraries.
  --kallsyms <path>        Path to kallsyms file which is used to resolve
                           kernel symbols.
  --debugPaths <paths>     Colon separated list of paths that contain debug
                           information.
  --extraLibPaths <paths>  Colon separated list of extra paths to find
                           libraries.
  --appPath <path>         Path to folder containing the application executable
                           and libraries.
  --arch <path>            Architecture to use for unwinding.

Quite a few people are using hotspot for embedded projects with arm architectures e.g. and it just works. So I wonder why it doesn't work for you?

@bylanhao
Copy link
Author

bylanhao commented Jan 8, 2020

hotspot --kallsyms kallsyms --sysroot root --debugPaths symbols/ --arch arm64 perf.data
bad feature data: 0x7ffe2b6ac4e0
HEADER_TRACING_DATA with unexpected contentSize 2308
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
Segmentation fault (core dumped)
root:/usr/hotspot# unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 6
unhandled event type 5
unhandled event type 6
unhandled event type 5
unhandled event type 5

When I use the Android simpleperf the hotspot is crash, if it can use perf script maybe prefect.

@bylanhao
Copy link
Author

bylanhao commented Jan 8, 2020

python run_simpleperf_on_device.py record -e cpu-clock -e sched:sched_switch -a --call-graph fp --duration 45

and I use this command to get the perf.data.

@milianw milianw changed the title Could you develop perfparser analytics based on perf.script? android simpleperf support Jan 8, 2020
@milianw
Copy link
Member

milianw commented Jan 8, 2020

So the issue is a crash that occurs when you try to analyze the data as produced by simpleperf.
To do anything about this, can you please provide me with a perf.data file recorded with simpleperf please?

@mstange
Copy link

mstange commented Apr 27, 2020

Here's an example perf.data from simpleperf: simpleperf-20200425-perf.data (7.9 MB)
And here's perf script-style text version of it, obtained with report_sample.py: simpleperf-20200425-report_sample.txt.zip (5.5 MB)

I obtained this profile by following the instructions from https://github.com/acreskeyMoz/simpleperf_for_geckoview_example. I was profiling a locally-built Fenix on a Moto G5.

@milianw
Copy link
Member

milianw commented May 15, 2020

The link to the text file references is the same as to the binary perf.data file. Can you get me a correct link please?

@milianw
Copy link
Member

milianw commented May 15, 2020

Please try with the latest AppImage from the continuous build once it finishes. You should be able to parse the simpleperf data files then.

Note that you'll have to provide the paths to the sysroot etc. to be able to resolve debug symbols.

@mstange
Copy link

mstange commented May 15, 2020

I've updated the link in the comment.

milianw added a commit to KDAB/perfparser that referenced this issue Jun 7, 2020
Apparently android's simpleperf doesn't contain the HOSTNAME feature.
Yet the data is still valid - trying to unbreak it would actually
break it for real.

Fixes: KDAB/hotspot#224

Change-Id: I0ed694a79fc731728edee8f6e2e3ba52717e2ea4
milianw added a commit to KDAB/perfparser that referenced this issue Jun 12, 2020
Apparently android's simpleperf doesn't contain the HOSTNAME feature.
Yet the data is still valid - trying to unbreak it would actually
break it for real.

Fixes: KDAB/hotspot#224

Change-Id: I0ed694a79fc731728edee8f6e2e3ba52717e2ea4
milianw added a commit to KDAB/perfparser that referenced this issue Jun 13, 2020
Apparently android's simpleperf doesn't contain the HOSTNAME feature.
Yet the data is still valid - trying to unbreak it would actually
break it for real.

Fixes: KDAB/hotspot#224
Change-Id: I0ed694a79fc731728edee8f6e2e3ba52717e2ea4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants