Izaron added a comment.

We can use this file as an example: `ConstProfiler.cpp` 
https://reviews.llvm.org/P8296
The code does a really big constant evaluation.

This is the generated json **before** the patch: `before.json` 
https://reviews.llvm.org/P8294
Giving this json to https://www.speedscope.app/, we get a big empty gap where 
the constant evaluation is being done.
link to screenshot 
<https://user-images.githubusercontent.com/5406399/195999887-64ea75c0-b995-476d-be85-f65c95600132.png>

This is the generated json **after** the patch: `after.json` 
https://reviews.llvm.org/P8295
The empty gap is filled with four events.
link to screenshot 
<https://user-images.githubusercontent.com/5406399/195999990-130731f6-39fa-41fa-92c3-fef297df9e24.png>

You can use this command for generating the json:

  clang++ ConstProfiler.cpp -std=c++20 -c -ftime-trace 
-ftime-trace-granularity=50

P.S. I'm not sure how to write tests to cover the patch, but I'll find this out 
=)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136022

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to