fix mobile build

PiperOrigin-RevId: 427606248
Change-Id: Ic853152a544025ddde2a894911103b4ba651f9b3
diff --git a/tensorflow/core/profiler/lib/profiler_session.cc b/tensorflow/core/profiler/lib/profiler_session.cc
index 85c308d..3385d07 100644
--- a/tensorflow/core/profiler/lib/profiler_session.cc
+++ b/tensorflow/core/profiler/lib/profiler_session.cc
@@ -59,10 +59,10 @@
   return status_;
 }
 
+#if !defined(IS_MOBILE_PLATFORM)
 Status ProfilerSession::CollectDataInternal(profiler::XSpace* space) {
   mutex_lock l(mutex_);
   TF_RETURN_IF_ERROR(status_);
-#if !defined(IS_MOBILE_PLATFORM)
   LOG(INFO) << "Profiler session collecting data.";
   if (profilers_ != nullptr) {
     profilers_->Stop().IgnoreError();
@@ -71,9 +71,9 @@
   }
   // Allow another session to start.
   profiler_lock_.ReleaseIfActive();
-#endif
   return Status::OK();
 }
+#endif
 
 Status ProfilerSession::CollectData(profiler::XSpace* space) {
 #if !defined(IS_MOBILE_PLATFORM)