Patchwork D7109: dirstate: add some traces on listdir calls

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2019, 2:22 p.m.
Message ID <0742822a9218db823fd1c2e2c086040e@localhost.localdomain>
Download mbox | patch
Permalink /patch/42390/
State Not Applicable
Headers show

Comments

phabricator - Oct. 16, 2019, 2:22 p.m.
Closed by commit rHGbc5c4919a1a0: dirstate: add some traces on listdir calls (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7109?vs=17179&id=17207

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7109/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7109

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -16,6 +16,9 @@ 
 from .i18n import _
 from .node import nullid
 from .pycompat import delattr
+
+from hgdemandimport import tracing
+
 from . import (
     encoding,
     error,
@@ -951,6 +954,7 @@ 
         def traverse(work, alreadynormed):
             wadd = work.append
             while work:
+                tracing.counter('dirstate.walk work', len(work))
                 nd = work.pop()
                 visitentries = match.visitchildrenset(nd)
                 if not visitentries:
@@ -961,7 +965,8 @@ 
                 if nd != b'':
                     skip = b'.hg'
                 try:
-                    entries = listdir(join(nd), stat=True, skip=skip)
+                    with tracing.log('dirstate.walk.traverse listdir %s', nd):
+                        entries = listdir(join(nd), stat=True, skip=skip)
                 except OSError as inst:
                     if inst.errno in (errno.EACCES, errno.ENOENT):
                         match.bad(