[PATCH] D78903: [Driver] Add option -fproc-stat-report

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 29 07:28:28 PDT 2020


aganea added inline comments.


================
Comment at: clang/docs/UsersManual.rst:786
+
+  $ clang -fproc-stat-report=- foo.c  
+  clang-11: output=/tmp/foo-123456.o, total=84000, user=76000, mem=87496
----------------
MaskRay wrote:
> aganea wrote:
> > Why not just `-fproc-stat-report` in this case?
> It can save an `Option`..
I was thinking in terms of user experience, I find it a bit awkward. If you want stdin, you say `mytool < file`, if you want stdout you say `mytool` and pipe the output down the line. Is there a need to state the output when we're not writing to a file?

There is a precedent for this, other tools like xray have `llvm-xray account %s -o -`, but it's there for completness, you could just say `llvm-xray account %s`.


================
Comment at: clang/docs/UsersManual.rst:787
+  $ clang -fproc-stat-report=- foo.c  
+  clang-11: output=/tmp/foo-123456.o, total=84000, user=76000, mem=87496
+  ld: output=a.out, total=8000, user=8000, mem=53548
----------------
MaskRay wrote:
> aganea wrote:
> > I think it is better if the units are specified along (and locale-formatted, if possible):
> > ```
> > clang-11: output=/tmp/foo-123456.o  total=84,000 ms  user=76,000 ms  mem=87,496 kb
> > ```
> Sorry, I tend to disagree with the argument for decimal separators and locale differences. They make behaviors divergent and make the output difficult to parse by a script. (Scripts may have to use `LANG=C clang -fproc-stat-report=-` to cancel the locale effect)
In my sense, CSV or YAML are for machine parsing, TXT is for human consumption. A script should not parse a human-targetted output.
Maybe an option is missing here to set the format? Again xray has `-f=text` or `-f=csv`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78903





More information about the cfe-commits mailing list