From 003b245939bae5e86ed53b3c6b333637dbc571b4 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Thu, 29 Sep 2016 15:32:45 -0700 Subject: Simpleperf: don't expose EventSelection. And some tiny improvements. Bug: http://b/30974760 Test: run simpleperf_unit_test. Change-Id: Ie2d46c8ab9ee763d107527c9a54590f845569da4 --- simpleperf/thread_tree.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'simpleperf/thread_tree.cpp') 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 #include -#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(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(new std::string(comm))); + it->second->comm = thread_comm_storage_.back()->c_str(); + } } void ThreadTree::ForkThread(int pid, int tid, int ppid, int ptid) { -- cgit v1.2.3