more profiler changes in C++ before enabling checkScript changes
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26909
Differential Revision: D17683632
Pulled By: Krovatkin
fbshipit-source-id: 5d36c3c4cf7411c56485ef19fe59262b9f8b45b2