summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 02:00:55 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 02:00:55 +0000
commit37888a5754cb5ce6f0a931a41b660bc32311b62d (patch)
tree377177e84e87c4cf88dc76b5021b452a33e76a6b
parent521dbcdd7e4c4064c6bed7f75a2836a1401fe5bf (diff)
downloadchromium_src-37888a5754cb5ce6f0a931a41b660bc32311b62d.zip
chromium_src-37888a5754cb5ce6f0a931a41b660bc32311b62d.tar.gz
chromium_src-37888a5754cb5ce6f0a931a41b660bc32311b62d.tar.bz2
Fix tracing on Windows to exclude directories.
Make sure to ignore directories on Windows. There is no good signal to know if the trace is about a file or a directory. Cleanup the blacklist regexps used in isolate_common.py. R=cmp@chromium.org NOTRY=true BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10563028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142896 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--tools/isolate/isolate_common.py7
-rwxr-xr-xtools/isolate/trace_inputs.py11
2 files changed, 12 insertions, 6 deletions
diff --git a/tools/isolate/isolate_common.py b/tools/isolate/isolate_common.py
index 1c5ff6d..84f4dd0 100644
--- a/tools/isolate/isolate_common.py
+++ b/tools/isolate/isolate_common.py
@@ -103,10 +103,11 @@ def generate_simplified(files, root_dir, variables, relative_cwd):
variables and relative_cwd.
"""
# Constants.
- # Skip log in PRODUCT_DIR.
- LOG_FILE = re.compile(r'^\<\(PRODUCT_DIR\)\/[^/]+\.log$')
+ # Skip log in PRODUCT_DIR. Note that these are applied on '/' style path
+ # separator.
+ LOG_FILE = re.compile(r'^\<\(PRODUCT_DIR\)\/[^\/]+\.log$')
EXECUTABLE = re.compile(
- r'^(\<\(PRODUCT_DIR\)\/[^/\.]+)' +
+ r'^(\<\(PRODUCT_DIR\)\/[^\/\.]+)' +
re.escape(variables.get('EXECUTABLE_SUFFIX', '')) +
r'$')
diff --git a/tools/isolate/trace_inputs.py b/tools/isolate/trace_inputs.py
index 1ba8450..aa11640 100755
--- a/tools/isolate/trace_inputs.py
+++ b/tools/isolate/trace_inputs.py
@@ -2064,14 +2064,19 @@ class LogmanTrace(ApiBase):
# Ignore directories and bare drive right away.
if raw_path.endswith(os.path.sep):
return
- filename = self._drive_map.to_win32(raw_path)
+ filepath = self._drive_map.to_win32(raw_path)
# Ignore bare drive right away. Some may still fall through with format
# like '\\?\X:'
- if len(filename) == 2:
+ if len(filepath) == 2:
return
file_object = line[FILE_OBJECT]
+ if os.path.isdir(filepath):
+ # There is no O_DIRECTORY equivalent on Windows. The closed is
+ # FILE_FLAG_BACKUP_SEMANTICS but it's not exactly right either. So
+ # simply discard directories are they are found.
+ return
# Override any stale file object
- proc.file_objects[file_object] = filename
+ proc.file_objects[file_object] = filepath
def handle_FileIo_Rename(self, line):
# TODO(maruel): Handle?