diff --git a/lld/MachO/Config.h b/lld/MachO/Config.h --- a/lld/MachO/Config.h +++ b/lld/MachO/Config.h @@ -86,7 +86,7 @@ uint32_t headerPad; uint32_t dylibCompatibilityVersion = 0; uint32_t dylibCurrentVersion = 0; - uint32_t timeTraceGranularity = 0; + uint32_t timeTraceGranularity = 500; std::string progName; llvm::StringRef installName; llvm::StringRef mapFile; diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -989,6 +989,8 @@ config->progName = argsArr[0]; config->timeTraceEnabled = args.hasArg(OPT_time_trace); + config->timeTraceGranularity = + args::getInteger(args, OPT_time_trace_granularity_eq, 500); // Initialize time trace profiler. if (config->timeTraceEnabled) diff --git a/lld/MachO/Options.td b/lld/MachO/Options.td --- a/lld/MachO/Options.td +++ b/lld/MachO/Options.td @@ -39,7 +39,7 @@ HelpText<"Use the new pass manager in LLVM">, Group; def time_trace: Flag<["--"], "time-trace">, HelpText<"Record time trace">; -def time_trace_granularity: Flag<["--"], "time-trace-granularity">, +def time_trace_granularity_eq: Flag<["--"], "time-trace-granularity=">, HelpText<"Minimum time granularity (in microseconds) traced by time profiler">; def time_trace_file_eq: Flag<["--"], "time-trace-file=">, HelpText<"Specify time trace output file">;