[PATCH] D65245: [profile] In Android, do not mkdir() dirs in GCOV_PREFIX

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 20:45:22 PDT 2019


davidxl added inline comments.


================
Comment at: compiler-rt/lib/profile/InstrProfilingUtil.c:53
+    // even attempting to stat()) top-level directories like "/data".
+    const char *gcov_prefix = getenv("GCOV_PREFIX");
+    if (gcov_prefix != NULL && strncmp(path, gcov_prefix, i) == 0)
----------------
getenv is repeatedly called in the loop which is not desired. Can you add a helper function and call it outside the loop to 'strip' the prefix from path?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65245/new/

https://reviews.llvm.org/D65245





More information about the llvm-commits mailing list