diff options
author | Yabin Cui <yabinc@google.com> | 2016-09-29 15:32:45 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2016-09-29 15:42:37 -0700 |
commit | 003b245939bae5e86ed53b3c6b333637dbc571b4 (patch) | |
tree | 24d04f34e38f206c64ad1bc1bbd8e3d43e858454 /simpleperf/thread_tree.cpp | |
parent | 1a35848b34d6572a6b65fe50133414b2dcbea92b (diff) | |
download | extras-003b245939bae5e86ed53b3c6b333637dbc571b4.tar.gz |
Simpleperf: don't expose EventSelection.
And some tiny improvements.
Bug: http://b/30974760
Test: run simpleperf_unit_test.
Change-Id: Ie2d46c8ab9ee763d107527c9a54590f845569da4
Diffstat (limited to 'simpleperf/thread_tree.cpp')
-rw-r--r-- | simpleperf/thread_tree.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/simpleperf/thread_tree.cpp b/simpleperf/thread_tree.cpp index 981a5dd2..56e5fbfb 100644 --- a/simpleperf/thread_tree.cpp +++ b/simpleperf/thread_tree.cpp @@ -23,7 +23,6 @@ #include <android-base/logging.h> #include <android-base/stringprintf.h> -#include "environment.h" #include "perf_event.h" #include "record.h" @@ -59,9 +58,11 @@ void ThreadTree::AddThread(int pid, int tid, const std::string& comm) { CHECK(pair.second); it = pair.first; } - thread_comm_storage_.push_back( - std::unique_ptr<std::string>(new std::string(comm))); - it->second->comm = thread_comm_storage_.back()->c_str(); + if (comm != it->second->comm) { + thread_comm_storage_.push_back( + std::unique_ptr<std::string>(new std::string(comm))); + it->second->comm = thread_comm_storage_.back()->c_str(); + } } void ThreadTree::ForkThread(int pid, int tid, int ppid, int ptid) { |