diff --git a/centipede/BUILD b/centipede/BUILD index 6fcf3f0db..9beecfbab 100644 --- a/centipede/BUILD +++ b/centipede/BUILD @@ -883,12 +883,14 @@ cc_library( ":feature", ":feature_set", ":logging", + ":rusage_profiler", ":shard_reader", ":util", ":workdir", "@com_google_absl//absl/log", "@com_google_absl//absl/log:check", "@com_google_absl//absl/strings", + "@com_google_absl//absl/time", ], ) diff --git a/centipede/distill.cc b/centipede/distill.cc index faea09791..c04a239c8 100644 --- a/centipede/distill.cc +++ b/centipede/distill.cc @@ -26,12 +26,14 @@ #include "absl/log/check.h" #include "absl/log/log.h" #include "absl/strings/str_cat.h" +#include "absl/time/time.h" #include "./centipede/blob_file.h" #include "./centipede/defs.h" #include "./centipede/environment.h" #include "./centipede/feature.h" #include "./centipede/feature_set.h" #include "./centipede/logging.h" +#include "./centipede/rusage_profiler.h" #include "./centipede/shard_reader.h" #include "./centipede/util.h" #include "./centipede/workdir.h" @@ -113,6 +115,11 @@ void DistillTask(const Environment &env, } int Distill(const Environment &env) { + RPROF_THIS_FUNCTION_WITH_TIMELAPSE( // + /*enable=*/VLOG_IS_ON(1), // + /*timelapse_interval=*/absl::Seconds(VLOG_IS_ON(2) ? 10 : 60), // + /*also_log_timelapses=*/VLOG_IS_ON(10)); + // Run `env.num_threads` independent distillation threads. std::vector threads(env.num_threads); std::vector envs(env.num_threads, env);