Skip to content

start/stop simpleperf from app method #499

@brok85

Description

@brok85

I would like to profile an app while a specific action is executed. For example, I would like to automatically start simpleperf when a specific button starts executing (e.g., onClick is called) and stop it when the button execution finishes (e.g., onClick returns):

public onClick_button_method(view v){
start_simpleperf();
... button code...
stop_simpleperf();
}

A simple implementation (i.e., shown above) it would be to just inject a code line in the app to execute a shell command such as ./simpleperf -e .... at the beginning of the button's method. However, I think this solution may introduce a long latency. If the injected line is synchronous there may be latency overhead, and if it is asynchronous the button execution may finish even before simpleperf actually starts recording. What would be a good way to achieve what I want to do?

Thanks for any help.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions