New issue
Advanced search Search tips

Issue 888857 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocked on:
issue 688465
issue 702625



Sign in to add a comment

Size trybot: Ensure no unused JNI methods are added

Project Member Reported by agrieve@chromium.org, Sep 25

Issue description

To find unused Java->Native methods:
 * Ensure Monochrome is stripping unused native methods (bug 688465).
 * Find all java native methods post-proguard via dexdump/supersize.
 * Find all native implementations of these methods using nm/readelf/supersize (symbols that start with JAVA_)
 * Report how many dex methods do not have corresponding java methods. These are the unused ones.

To find unused native->java methods (@UsedByNatives):
 * Find list of java symbols by recording them during jni_registration_generator().
   * Monochrome have one of these, so maybe add one just for this purpose?
 * Find which ones are called using nm/supersize to list .bss symbols storing the method references. 
E.g. (g_org_chromium_base_Callback_00024Helper_onObjectResultFromNative)
https://cs.chromium.org/chromium/src/out/android-Debug/gen/base/base_jni_headers/base/jni/Callback_jni.h?rcl=5fd41a1dd021a054cd4033a6b8bf7b2470aecfda&l=52
 * Report how many java methods exists but native method symbols is missing.


Note: Neither of these approaches has actually been tested! First step should be to prove they actually work.
Note: Might be nice to implemented both of these in "canned_queries.py"
 
Description: Show this description
Blocking: 702625
Blockedon: 702625
Blocking: -702625
Status: Assigned (was: Untriaged)
This issue has an owner, a component and a priority, but is still listed as untriaged or unconfirmed. By definition, this bug is triaged. Changing status to "assigned". Please reach out to me if you disagree with how I've done this.

Sign in to add a comment