Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py

Issue 308123002: Telemetry: Build symfs for Android VTune profiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: conditional import of sqlite3 Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py b/tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py
index f2e21440385eb434bb870307841356d9be3dcbbc..bb9228f9b38f79a45af78dad12a49320a14e32c4 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py
@@ -11,6 +11,11 @@ import re
import shutil
import subprocess
+try:
+ import sqlite3
+except ImportError:
+ sqlite3 = None
+
from telemetry.core import util
from telemetry.core.platform.profiler import android_prebuilt_profiler_helper
@@ -109,6 +114,27 @@ def GetRequiredLibrariesForPerfProfile(profile_file):
return libs
+def GetRequiredLibrariesForVTuneProfile(profile_file):
+ """Returns the set of libraries necessary to symbolize a given VTune profile.
+
+ Args:
+ profile_file: Path to VTune profile to analyse.
+
+ Returns:
+ A set of required library file names.
+ """
+ db_file = os.path.join(profile_file, 'sqlite-db', 'dicer.db')
+ conn = sqlite3.connect(db_file)
+
+ try:
+ # The 'dd_module_file' table lists all libraries on the device. Only the
+ # ones with 'bin_located_path' are needed for the profile.
+ query = 'SELECT bin_path, bin_located_path FROM dd_module_file'
+ return set(row[0] for row in conn.cursor().execute(query) if row[1])
+ finally:
+ conn.close()
+
+
def CreateSymFs(device, symfs_dir, libraries, use_symlinks=True):
"""Creates a symfs directory to be used for symbolizing profiles.
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698