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

How to measure accurate time required to construct callgraph? #555

Open
neupaneprakash opened this issue Dec 1, 2022 · 5 comments
Open

Comments

@neupaneprakash
Copy link

Hello @StevenArzt !
FlowDroid by default gives the following:
Callgraph construction took 0 seconds // for all the applications being analyzed (a set of 50 different apps) callgraph construction is the same irrespective of the apps being analyzed and callgraph being used.
Furthermore, It also gives:
Collecting callbacks and building a callgraph took 18 seconds // this time is different for all apps being analyzed and callgraph being used.
So, I need to measure the accurate time taken to construct the callgraph. What is the best way to do this? Any suggestion Please!

@StevenArzt
Copy link
Member

FlowDroid uses an iterative approach for building the callgraph. It first detects the entry points in the Android components (activities, services, etc.) of the app and builds a callgraph from that list. It then enumerates callback registrations that are reachable inside this initial callgraph, adds the respective callbacks to its model, and builds the callgaph again. This process is repeated until a fixpoint is reached, i.e., no more previously-unseen callback registration sites are found. Therefore, it makes little sense to talk about callgraph generation alone. That's also why FlowDroid reports that accumulated timing that you observed.

@neupaneprakash
Copy link
Author

Thanks, @StevenArzt ! for your precise and helpful information. So, can I consider time required for collecting callbacks and building a callgraph as the time taken for constructing a callgraph?

@StevenArzt
Copy link
Member

Yes.

By the way, if you use FlowDroid as an API, you can get all of that data fro mthe InfoflowResults object and don't need to parse command-line output.

@neupaneprakash
Copy link
Author

Thank you @StevenArzt !

@neupaneprakash
Copy link
Author

neupaneprakash commented Dec 18, 2022

Hello @StevenArzt ! I have followed the same procedure to measure the time for call graph construction. Based on my observations, RTA is taking much more time than other precise call graphs like SPARK or GEOM and conservative call graphs like CHA. Is this observation surprising or may it occur as such?

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

No branches or pull requests

2 participants