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

Issue 1254173003: [telemetry] Add Python dynamic analysis find_dependencies.

Created:
5 years, 4 months ago by dtu
Modified:
4 years, 2 months ago
Reviewers:
CC:
chromium-reviews, telemetry-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[telemetry] Add Python dynamic analysis find_dependencies. If we import all the modules in Telemetry, then our sys.modules should contain most of Telemetry's dependencies. This check is fairly fast, so we can do it on all files, in addition to using modulefinder on a few select files. BUG= TEST=Diif the output of src/tools/telemetry/build/generate_telemetry_harness.sh with and without this patch. Ensure it makes sense. (The new entries are all py_trace_event.)

Patch Set 1 #

Total comments: 2

Patch Set 2 : Ensure .py exists. #

Patch Set 3 : Do both checks. Allow user to specify a directory. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -9 lines) Patch
M tools/telemetry/telemetry/internal/util/find_dependencies.py View 1 2 4 chunks +63 lines, -9 lines 5 comments Download

Messages

Total messages: 8 (2 generated)
nednguyen
https://codereview.chromium.org/1254173003/diff/1/tools/telemetry/telemetry/internal/util/find_dependencies.py File tools/telemetry/telemetry/internal/util/find_dependencies.py (right): https://codereview.chromium.org/1254173003/diff/1/tools/telemetry/telemetry/internal/util/find_dependencies.py#newcode53 tools/telemetry/telemetry/internal/util/find_dependencies.py:53: module_path = root + '.py' We have issues with ...
5 years, 4 months ago (2015-07-28 00:23:33 UTC) #2
dtu
https://codereview.chromium.org/1254173003/diff/1/tools/telemetry/telemetry/internal/util/find_dependencies.py File tools/telemetry/telemetry/internal/util/find_dependencies.py (right): https://codereview.chromium.org/1254173003/diff/1/tools/telemetry/telemetry/internal/util/find_dependencies.py#newcode53 tools/telemetry/telemetry/internal/util/find_dependencies.py:53: module_path = root + '.py' On 2015/07/28 00:23:33, nednguyen ...
5 years, 4 months ago (2015-07-28 00:40:49 UTC) #3
nednguyen
On 2015/07/28 00:40:49, dtu wrote: > https://codereview.chromium.org/1254173003/diff/1/tools/telemetry/telemetry/internal/util/find_dependencies.py > File tools/telemetry/telemetry/internal/util/find_dependencies.py (right): > > https://codereview.chromium.org/1254173003/diff/1/tools/telemetry/telemetry/internal/util/find_dependencies.py#newcode53 > ...
5 years, 4 months ago (2015-07-28 01:40:37 UTC) #4
dtu
On 2015/07/28 01:40:37, nednguyen wrote: > On 2015/07/28 00:40:49, dtu wrote: > > > https://codereview.chromium.org/1254173003/diff/1/tools/telemetry/telemetry/internal/util/find_dependencies.py ...
5 years, 4 months ago (2015-07-30 08:23:05 UTC) #5
dtu
Ping
5 years, 4 months ago (2015-08-04 21:04:33 UTC) #6
nednguyen
5 years, 4 months ago (2015-08-04 22:22:02 UTC) #7
https://codereview.chromium.org/1254173003/diff/40001/tools/telemetry/telemet...
File tools/telemetry/telemetry/internal/util/find_dependencies.py (right):

https://codereview.chromium.org/1254173003/diff/40001/tools/telemetry/telemet...
tools/telemetry/telemetry/internal/util/find_dependencies.py:41: def
FindDynamicAnalysisDependencies(module_paths):
the method name is ambiguous.

https://codereview.chromium.org/1254173003/diff/40001/tools/telemetry/telemet...
tools/telemetry/telemetry/internal/util/find_dependencies.py:45:
_LoadModules(module_paths)
Wouldn't this includes module imported by this file?

https://codereview.chromium.org/1254173003/diff/40001/tools/telemetry/telemet...
tools/telemetry/telemetry/internal/util/find_dependencies.py:48: for module in
sys.modules.itervalues():
So I guess the difference between this and other method is that this also
discovers modules that only become importable due to loading others in
module_paths?

Can you add unittest to show the differences?

https://codereview.chromium.org/1254173003/diff/40001/tools/telemetry/telemet...
tools/telemetry/telemetry/internal/util/find_dependencies.py:74: def
FindStaticAnalysisDependencies(module_path):
ditto

https://codereview.chromium.org/1254173003/diff/40001/tools/telemetry/telemet...
tools/telemetry/telemetry/internal/util/find_dependencies.py:78:
_LoadModules([module_path])
Doesn't modulefinder also execute the sys.path modification?

Powered by Google App Engine
This is Rietveld 408576698