Skip to content

Commit

Permalink
add apk file paths in backup sosource logging
Browse files Browse the repository at this point in the history
Summary: print the `mZipSources` path list in Backup soSource.

Reviewed By: adicatana

Differential Revision: D56665839

fbshipit-source-id: d37665c7169890656b13e5ab100046adeb366f35
  • Loading branch information
simpleton authored and facebook-github-bot committed Apr 29, 2024
1 parent d9bd759 commit dc3fbfc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
21 changes: 21 additions & 0 deletions java/com/facebook/soloader/BackupSoSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,25 @@ public SoSource recover(Context context) {
}
return recovered;
}

@Override
public String toString() {
String path;
try {
path = String.valueOf(soDirectory.getCanonicalPath());
} catch (IOException e) {
path = soDirectory.getName();
}

return new StringBuilder()
.append(getName())
.append("[root = ")
.append(path)
.append(" flags = ")
.append(flags)
.append(" apks = ")
.append(mZipSources.toString())
.append("]")
.toString();
}
}
9 changes: 9 additions & 0 deletions java/com/facebook/soloader/ExtractFromZipSoSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,13 @@ public int hashCode() {
return 31 * result + backingEntry.hashCode();
}
}

@Override
public String toString() {
try {
return mZipFileName.getCanonicalPath();
} catch (IOException e) {
return mZipFileName.getName();
}
}
}
4 changes: 2 additions & 2 deletions java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ private static void initSoSources(Context context, int flags) throws IOException
SoSource[] finalSoSources = soSources.toArray(new SoSource[soSources.size()]);
int prepareFlags = makePrepareFlags();
for (int i = finalSoSources.length; i-- > 0; ) {
LogUtil.d(TAG, "Preparing SO source: " + finalSoSources[i]);
LogUtil.i(TAG, "Preparing SO source: " + finalSoSources[i]);

if (SYSTRACE_LIBRARY_LOADING) {
Api18TraceUtils.beginTraceSection(TAG, "_", finalSoSources[i].getClass().getSimpleName());
Expand All @@ -400,7 +400,7 @@ private static void initSoSources(Context context, int flags) throws IOException
}
sSoSources = finalSoSources;
sSoSourcesVersion.getAndIncrement();
LogUtil.d(TAG, "init finish: " + sSoSources.length + " SO sources prepared");
LogUtil.i(TAG, "init finish: " + sSoSources.length + " SO sources prepared");
} finally {
sSoSourcesLock.writeLock().unlock();
}
Expand Down

0 comments on commit dc3fbfc

Please sign in to comment.