1 /* 2 * Copyright (c) 2009-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 * 4 * UniProton is licensed under Mulan PSL v2. 5 * You can use this software according to the terms and conditions of the Mulan PSL v2. 6 * You may obtain a copy of Mulan PSL v2 at: 7 * http://license.coscl.org.cn/MulanPSL2 8 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 9 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 10 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 11 * See the Mulan PSL v2 for more details. 12 * Create: 2009-12-22 13 * Description: CPU占用率模块的C文件 14 */ 15 #include "prt_cpup_internal.h" 16 17 /* 18 * 描述:获取当前cpu占用率。 19 */ PRT_CpupNow(void)20OS_SEC_L2_TEXT U32 PRT_CpupNow(void) 21 { 22 U32 ret; 23 24 /* 如果没有初始化,则进行CPUP初始化 */ 25 ret = OsCpupLazyInit(); 26 if (ret != OS_OK) { 27 OS_REPORT_ERROR(ret); 28 return (U32)OS_INVALID; 29 } 30 31 return g_cpupNow(); 32 } 33 34