aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorVolodymyr Sapsai <vsapsai@apple.com>2020-10-19 13:39:47 -0700
committerVolodymyr Sapsai <vsapsai@apple.com>2020-10-19 15:44:11 -0700
commit4000c9ee18ecebe3ff0f197af8c1fb434ad986e5 (patch)
treef89daf1e2ddab0e526a150bdc0a11cf9e7ce0a78 /llvm/lib/Support/Path.cpp
parent6ddadf99018bc5ef91dc57173eb0b8b42a7c6213 (diff)
downloadllvm-4000c9ee18ecebe3ff0f197af8c1fb434ad986e5.zip
llvm-4000c9ee18ecebe3ff0f197af8c1fb434ad986e5.tar.gz
llvm-4000c9ee18ecebe3ff0f197af8c1fb434ad986e5.tar.bz2
Reland "[Modules] Add stats to measure performance of building and loading modules."
Measure amount of high-level or fixed-cost operations performed during building/loading modules and during header search. High-level operations like building a module or processing a .pcm file are motivated by previous issues where clang was re-building modules or re-reading .pcm files unnecessarily. Fixed-cost operations like `stat` calls are tracked because clang cannot change how long each operation takes but it can perform fewer of such operations to improve the compile time. Also tracking such stats over time can help us detect compile-time regressions. Added stats are more stable than the actual measured compilation time, so expect the detected regressions to be less noisy. On relanding drop stats in MemoryBuffer.cpp as their value is pretty low but affects a lot of clients and many of those aren't interested in modules and header search. rdar://problem/55715134 Reviewed By: aprantl, bruno Differential Revision: https://reviews.llvm.org/D86895
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index bbc02a2..7f4b7cb 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -12,6 +12,7 @@
#include "llvm/Support/Path.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Errc.h"
@@ -31,6 +32,10 @@
using namespace llvm;
using namespace llvm::support::endian;
+#define DEBUG_TYPE "file-system"
+
+ALWAYS_ENABLED_STATISTIC(NumStatusCalls, "Number of `status` calls.");
+
namespace {
using llvm::StringRef;
using llvm::sys::path::is_separator;