[all-commits] [llvm/llvm-project] f5d9de: [Clang] Add a new clang option "-ftime-trace=<value>"

dongjunduo via All-commits all-commits at lists.llvm.org
Fri Jul 15 08:56:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5d9de8cc33014923fbd1c5682758557887e85ba
      https://github.com/llvm/llvm-project/commit/f5d9de8cc33014923fbd1c5682758557887e85ba
  Author: dongjunduo <andj4cn at gmail.com>
  Date:   2022-07-15 (Fri, 15 Jul 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Frontend/FrontendOptions.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/Driver/check-time-trace.cpp
    M clang/tools/driver/cc1_main.cpp

  Log Message:
  -----------
  [Clang] Add a new clang option "-ftime-trace=<value>"

The time profiler traces the stages during the clang compile
process. Each compiling stage of a single source file
corresponds to a separately .json file which holds its
time tracing data. However, the .json files are stored in the
same path/directory as its corresponding stage's '-o' option.
For example, if we compile the "demo.cc" to "demo.o" with option
"-o /tmp/demo.o", the time trace data file path is "/tmp/demo.json".

A typical c++ project can contain multiple source files in different
path, but all the json files' paths can be a mess.

The option "-ftime-trace=<value>" allows you to specify where the json
files should be stored. This allows the users to place the time trace
data files of interest in the desired location for further data analysis.

Usage:
    - clang/clang++ -ftime-trace ...
    - clang/clang++ -ftime-trace=the-directory-you-want ...
    - clang/clang++ -ftime-trace=the-directory-you-want/ ...
    - clang/clang++ -ftime-trace=the-full-file-path-you-want ...

Differential Revision: https://reviews.llvm.org/D128048




More information about the All-commits mailing list