From 590c86a492311d5c0d0efd49aa40c6388f03c4f9 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 25 Apr 2018 21:59:48 -0700 Subject: [PATCH] Perfprofd: Use the right parameter Fix a typo. (cherry picked from commit 51c08f9041648378717c79f787db773ac55e74b1) Bug: 73175642 Test: perfprofd_test Merged-In: I5d80887af08e3b3a1b19a1a303ca1c63bec75fbd Change-Id: I5d80887af08e3b3a1b19a1a303ca1c63bec75fbd --- perfprofd/perfprofdcore.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/perfprofd/perfprofdcore.cc b/perfprofd/perfprofdcore.cc index d7b0e9b4..065f8e67 100644 --- a/perfprofd/perfprofdcore.cc +++ b/perfprofd/perfprofdcore.cc @@ -456,7 +456,6 @@ PROFILE_RESULT encode_to_proto(const std::string &data_file_path, // static PROFILE_RESULT invoke_perf(Config& config, const std::string &perf_path, - unsigned sampling_period, const char *stack_profile_opt, unsigned duration, const std::string &data_file_path, @@ -495,11 +494,11 @@ static PROFILE_RESULT invoke_perf(Config& config, std::string p_str; if (config.sampling_frequency > 0) { argv[slot++] = "-f"; - p_str = android::base::StringPrintf("%u", sampling_period); + p_str = android::base::StringPrintf("%u", config.sampling_frequency); argv[slot++] = p_str.c_str(); } else if (config.sampling_period > 0) { argv[slot++] = "-c"; - p_str = android::base::StringPrintf("%u", sampling_period); + p_str = android::base::StringPrintf("%u", config.sampling_period); argv[slot++] = p_str.c_str(); } @@ -657,11 +656,9 @@ static ProtoUniquePtr collect_profile(Config& config) const char *stack_profile_opt = (config.stack_profile ? "-g" : nullptr); const std::string& perf_path = config.perf_path; - uint32_t period = config.sampling_period; PROFILE_RESULT ret = invoke_perf(config, perf_path.c_str(), - period, stack_profile_opt, duration, data_file_path, -- 2.11.0