OSDN Git Service

simpleperf: fix report_sample_test.
authorYabin Cui <yabinc@google.com>
Mon, 15 May 2017 20:39:36 +0000 (13:39 -0700)
committerYabin Cui <yabinc@google.com>
Mon, 15 May 2017 20:43:27 +0000 (13:43 -0700)
When running cmd_report_sample.* tests, it may call
ReportSampleCmd()->Run() more than once. If we shutdown
protobuf library in one call, using protobuf in the
following calls will encounter failures.

Bug: http://b/37996565
Test: run CtsSimpleperfTestCases.
Change-Id: I5ca217406e786645d45fda518055c4a63ab3db3c

simpleperf/cmd_report_sample.cpp

index e28ea3b..f43f682 100644 (file)
@@ -184,7 +184,6 @@ bool ReportSampleCommand::Run(const std::vector<std::string>& args) {
       return false;
     }
     protobuf_coded_os.reset(nullptr);
-    google::protobuf::ShutdownProtobufLibrary();
   } else {
     PrintLostSituation();
     fflush(report_fp_);
@@ -331,7 +330,6 @@ bool ReportSampleCommand::DumpProtobufReport(const std::string& filename) {
       return false;
     }
   }
-  google::protobuf::ShutdownProtobufLibrary();
   return true;
 }