1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "call_manager_dump_helper.h" 17 18 #include "call_manager_service.h" 19 20 namespace OHOS { 21 namespace Telephony { Dump(const std::vector<std::string> & args,std::string & result) const22bool CallManagerDumpHelper::Dump(const std::vector<std::string> &args, std::string &result) const 23 { 24 result.clear(); 25 ShowHelp(result); 26 ShowCallManagerInfo(result); 27 return true; 28 } 29 CallManagerDumpHelper()30CallManagerDumpHelper::CallManagerDumpHelper() 31 { 32 TELEPHONY_LOGI("CallManagerDumpHelper() entry."); 33 } 34 ShowHelp(std::string & result) const35void CallManagerDumpHelper::ShowHelp(std::string &result) const 36 { 37 result.append("Usage:dump <command> [options]\n") 38 .append("Description:\n") 39 .append("-call_manager_info ") 40 .append("dump all call_manager information in the system\n") 41 .append("-input_simulate <event> ") 42 .append("simulate event from ohos call_manager, supported events: login/logout/token_invalid\n") 43 .append("-output_simulate <event> ") 44 .append("simulate event output\n") 45 .append("-show_log_level ") 46 .append("show call_manager SA's log level\n") 47 .append("-set_log_level <level> ") 48 .append("set call_manager SA's log level\n") 49 .append("-perf_dump ") 50 .append("dump performance statistics\n"); 51 } 52 ShowCallManagerInfo(std::string & result) const53void CallManagerDumpHelper::ShowCallManagerInfo(std::string &result) const 54 { 55 result.append("Ohos call_manager service:"); 56 result.append("\n"); 57 result.append("Ohos call_manager bind time: "); 58 result.append(DelayedSingleton<CallManagerService>::GetInstance()->GetBindTime()); 59 result.append("\n"); 60 result.append("Ohos call_manager start spend time(milliseconds): "); 61 result.append(DelayedSingleton<CallManagerService>::GetInstance()->GetStartServiceSpent()); 62 result.append("\n"); 63 } 64 } // namespace Telephony 65 } // namespace OHOS