Grigory-Rylov / android-methods-profiler

Yet another Android Profiler for AOSP .trace files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide a way to filter operations and get duration

Monabr opened this issue · comments

Hello.

I want to use a profiler to measure how long each of the methods in my application takes. I measured it and made a trace, but there are a lot of system calls in it. How can I make it show only my methods and the time for them? I need a list of my methods from different threads because there are a lot of coroutines running.

Hello! Do I understand correctly that you want to generate a flat list in a text file containing the names of the methods corresponding to some filter and the duration of the methods? Did you want it for selected thread or all threads? If so, I've made something similar before and will try to make that kind report.

@Grigory-Rylov I have a business logic with 200+ methods. I want to optimize the calculations, but to do this I either need to manually put all the logs or use a profiler. The problem is, there are 20+ different threads running. In the android studio profiler, I collect them into one selection and go to the "BottomUp" tab. There is a search there, but when I enter the name of my package, it gives me a lot of library methods, such as run, park, runWorker, etc., which clutters the list and does not allow me to properly analyze which longest method I should start with, so I'm searching tools to solve the problem.

Having stumbled upon your library, I did not find such functionality and would really like to get it.

@Monabr for now you can use custom color highlighting for your methods in Call chart and Flame char (View -> Show highlighting settings, add color relation for your package filter).

And then you can open Flame chart and look for your methods (read more about flame chart in https://developer.android.com/studio/profile/inspect-traces)

@Grigory-Rylov I think you didn't fully understand me. I think I don’t need a diagram, plus it shows the diagram for each thread separately, but I need it for all of them together. I don't have problems with rendering, I have a need to measure the duration of the methods. The diagram is also inconvenient for this purpose in my opinion.

@Monabr what you expect to receive in report, when, for example, you have next code:
'''
class Foo{

fun main() {
a()
}

fun a() {
b()
}

fun b() {
c()
}

fun c() {}

}
'''
?

name                           | duration
--------------------------------------------
- main()                       | 100s
-- a()                         | 100s
--- b()                        | 100s  
---- c()                       | 100s

@Grigory-Rylov This is what I would like to get based on your example.

Hi - are there any updates on this? I also have the same needs as @Monabr (measuring how long each of the methods in my application takes)

Hi - are there any updates on this? I also have the same needs as @Monabr (measuring how long each of the methods in my application takes)

Hello! Sorry, I was busy as a bee) I' ll try to make that ability due to several days.