Alternative to https://github.com/tensorflow/tensorflow/pull/46544
Use case: Allow an outer profiler (e.g., a command-line tool) to set an environment variable to prevent interference from TF Profiler. We already have mutual exclusion of profiler clients via ProfilerLock to guarantee at most one profiler client can actually profile. The environment variable TF_DISABLE_PROFILING, when set to 1, disables all profiler clients. We assume that clients already know how to gracefully handle failure to profile.
PiperOrigin-RevId: 357003057
Change-Id: I79ceccd289114d6eac3b9b7b4b14d0c5f1950c4d