Check if profiler is disabled in push/pop event (#18908)
Summary:
Make sure to check if profiler is disabled in push/pop and mark event
functions
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18908
Differential Revision: D14791931
Pulled By: ilia-cher
fbshipit-source-id: e4f5149e69999ee2b9238c21cccad6d27c6a714a