diff --git a/tensorflow/core/profiler/internal/traceme_recorder.cc b/tensorflow/core/profiler/internal/traceme_recorder.cc index d4e937728c3..365e3992bc3 100644 --- a/tensorflow/core/profiler/internal/traceme_recorder.cc +++ b/tensorflow/core/profiler/internal/traceme_recorder.cc @@ -196,12 +196,12 @@ class TraceMeRecorder::ThreadLocalRecorder { return singleton; } -void TraceMeRecorder::RegisterThread(int32 tid, ThreadLocalRecorder* thread) { +void TraceMeRecorder::RegisterThread(uint32 tid, ThreadLocalRecorder* thread) { mutex_lock lock(mutex_); threads_.emplace(tid, thread); } -void TraceMeRecorder::UnregisterThread(int32 tid) { +void TraceMeRecorder::UnregisterThread(uint32 tid) { mutex_lock lock(mutex_); auto it = threads_.find(tid); if (it != threads_.end()) { diff --git a/tensorflow/core/profiler/internal/traceme_recorder.h b/tensorflow/core/profiler/internal/traceme_recorder.h index 9836e716532..561368dd431 100644 --- a/tensorflow/core/profiler/internal/traceme_recorder.h +++ b/tensorflow/core/profiler/internal/traceme_recorder.h @@ -59,7 +59,7 @@ class TraceMeRecorder { uint64 end_time; // 0 = missing }; struct ThreadInfo { - int32 tid; + uint32 tid; string name; }; struct ThreadEvents { @@ -101,8 +101,8 @@ class TraceMeRecorder { TF_DISALLOW_COPY_AND_ASSIGN(TraceMeRecorder); - void RegisterThread(int32 tid, ThreadLocalRecorder* thread); - void UnregisterThread(int32 tid); + void RegisterThread(uint32 tid, ThreadLocalRecorder* thread); + void UnregisterThread(uint32 tid); bool StartRecording(int level); Events StopRecording(); @@ -113,7 +113,7 @@ class TraceMeRecorder { mutex mutex_; // Map of the static container instances (thread_local storage) for each // thread. While active, a ThreadLocalRecorder stores trace events. - absl::flat_hash_map threads_ GUARDED_BY(mutex_); + absl::flat_hash_map threads_ GUARDED_BY(mutex_); // Events from threads that died during recording. TraceMeRecorder::Events orphaned_events_ GUARDED_BY(mutex_); };