提交 a36d5d90 编写于 作者: Y yinjiaming

fix: 内核告警修复

【背景】
内核代码经代码扫描工具发现存在一些关于代码格式的告警,
现经修改解除掉告警。

【修改方案】
修改了代码中格式不规范的地方,修改的点有:
1.代码中一行过长
2.没有合理的添加空格和空行
3.没有按照规范进行缩进
4.括号的格式没有按照规范
5.注释的格式不对以及存在魔数字
6.函数的声明与定义的格式不一致
并更新了修改文件的版权头时间

【影响】
对现有的产品编译不会有影响。

re #I5H6F5
Signed-off-by: Nyinjiaming <yinjiaming@huawei.com>
Change-Id: Id8eb0450d03fae537ea4c73190fdadb76b29253d
上级 e1f98630
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -63,5 +63,3 @@ extern VOID HalSecureContextSaveAsm(OsSecureContext *secureContext);
#endif /* __cplusplus */
#endif
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -63,5 +63,3 @@ extern VOID HalSecureContextSaveAsm(OsSecureContext *secureContext);
#endif /* __cplusplus */
#endif
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -107,13 +107,16 @@ UINT32 ArchIntUnLock(VOID);
*
* @attention
* <ul>
* <li>The hardware interrupt module is usable only when the configuration item for hardware interrupt tailoring is enabled.</li>
* <li>Hardware interrupt number value range: [OS_USER_HWI_MIN,OS_USER_HWI_MAX]. The value range applicable for a Cortex-A7 platform is [32,95].</li>
* <li>The hardware interrupt module is usable only when the configuration item for hardware
* interrupt tailoring is enabled.</li>
* <li>Hardware interrupt number value range: [OS_USER_HWI_MIN,OS_USER_HWI_MAX]. The value range
* applicable for a Cortex-A7 platform is [32,95].</li>
* <li>OS_HWI_MAX_NUM specifies the maximum number of interrupts that can be created.</li>
* <li>Before executing an interrupt on a platform, refer to the chip manual of the platform.</li>
* </ul>
*
* @param hwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable for a Cortex-A7 platform is [32,95].
* @param hwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable
* for a Cortex-A7 platform is [32,95].
* @param irqParam [IN] Type #HwiIrqParam *. ID of hardware interrupt which will base on
* when delete the hardware interrupt.
* @retval #OS_ERRNO_HWI_NUM_INVALID 0x02000900: Invalid interrupt number.
......@@ -133,13 +136,16 @@ UINT32 ArchHwiDelete(HWI_HANDLE_T hwiNum, HwiIrqParam *irqParam);
*
* @attention
* <ul>
* <li>The hardware interrupt module is usable only when the configuration item for hardware interrupt tailoring is enabled.</li>
* <li>Hardware interrupt number value range: [OS_USER_HWI_MIN,OS_USER_HWI_MAX]. The value range applicable for a Cortex-A7 platform is [32,95].</li>
* <li>The hardware interrupt module is usable only when the configuration item for hardware
* interrupt tailoring is enabled.</li>
* <li>Hardware interrupt number value range: [OS_USER_HWI_MIN,OS_USER_HWI_MAX]. The value range
* applicable for a Cortex-A7 platform is [32,95].</li>
* <li>OS_HWI_MAX_NUM specifies the maximum number of interrupts that can be created.</li>
* <li>Before executing an interrupt on a platform, refer to the chip manual of the platform.</li>
* </ul>
*
* @param hwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable for a Cortex-A7 platform is [32,95].
* @param hwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable for a
* Cortex-A7 platform is [32,95].
* @param hwiPrio [IN] Type#HWI_PRIOR_T: hardware interrupt priority. Ignore this parameter temporarily.
* @param mode [IN] Type#HWI_MODE_T: hardware interrupt mode. Ignore this parameter temporarily.
* @param handler [IN] Type#HWI_PROC_FUNC: interrupt handler used when a hardware interrupt is triggered.
......@@ -149,7 +155,8 @@ UINT32 ArchHwiDelete(HWI_HANDLE_T hwiNum, HwiIrqParam *irqParam);
* @retval #OS_ERRNO_HWI_PROC_FUNC_NULL 0x02000901: Null hardware interrupt handling function.
* @retval #OS_ERRNO_HWI_NUM_INVALID 0x02000900: Invalid interrupt number.
* @retval #OS_ERRNO_HWI_NO_MEMORY 0x02000903: Insufficient memory for hardware interrupt creation.
* @retval #OS_ERRNO_HWI_ALREADY_CREATED 0x02000904: The interrupt handler being created has already been created.
* @retval #OS_ERRNO_HWI_ALREADY_CREATED 0x02000904: The interrupt handler being created has
* already been created.
* @retval #LOS_OK 0 : The interrupt is successfully created.
* @par Dependency:
* <ul><li>los_interrupt.h: the header file that contains the API declaration.</li></ul>
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -209,7 +209,6 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTskCycleEnd(VOID)
}
cpuCycle = LOS_SysCycleGet();
if (cpuCycle < g_cpup[taskID].startTime) {
cpuCycle += g_cyclesPerTick;
}
......@@ -625,7 +624,6 @@ LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqEnd(UINT32 intNum)
}
cpuCycle = LOS_SysCycleGet();
if (cpuCycle < g_irqCpup[intNum].startTime) {
cpuCycle += g_cyclesPerTick;
}
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -250,7 +250,8 @@ extern UINT32 LOS_SysCpuUsage(VOID);
* This API is used to obtain the historical CPU usage.
* @attention
* <ul>
* <li>This API can be called only after the CPU usage is initialized. Otherwise, the CPU usage fails to be obtained.</li>
* <li>This API can be called only after the CPU usage is initialized. Otherwise, the CPU usage fails
* to be obtained.</li>
* </ul>
*
* @param mode [IN] UINT16. Task mode. The parameter value 0 indicates that the CPU usage within 10s will be
......@@ -273,7 +274,8 @@ extern UINT32 LOS_HistorySysCpuUsage(UINT16 mode);
* This API is used to obtain the CPU usage of a task specified by a passed-in task ID.
* @attention
* <ul>
* <li>This API can be called only after the CPU usage is initialized. Otherwise, the CPU usage fails to be obtained.</li>
* <li>This API can be called only after the CPU usage is initialized. Otherwise, the CPU usage fails
* to be obtained.</li>
* <li>The passed-in task ID must be valid and the task specified by the task ID must be created. Otherwise,
* the CPU usage fails to be obtained.</li>
* </ul>
......@@ -327,7 +329,8 @@ extern UINT32 LOS_HistoryTaskCpuUsage(UINT32 taskID, UINT16 mode);
* This API is used to obtain the CPU usage of all tasks according to maximum number of threads.
* @attention
* <ul>
* <li>This API can be called only after the CPU usage is initialized. Otherwise, the CPU usage fails to be obtained.</li>
* <li>This API can be called only after the CPU usage is initialized. Otherwise, the CPU usage fails
* to be obtained.</li>
* <li>The input parameter pointer must not be NULL, Otherwise, the CPU usage fails to be obtained.</li>
* </ul>
*
......
/*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -867,7 +867,7 @@ STATIC VOID OsDoFini(DynSharedObj *dso)
--func;
finiFunc = (INIT_FINI_FUNC)(*func);
finiFunc();
}
}
}
if (initFiniTab->fini.func != 0) {
......
/*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -129,8 +129,8 @@ typedef struct {
} DynSharedObj;
typedef struct {
CHAR *name;
UINTPTR addr;
CHAR *name;
UINTPTR addr;
} SymInfo;
#define SYM_EXPORT(func) \
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -54,13 +54,15 @@ extern "C" {
#endif
#if (LOSCFG_BASE_CORE_EXC_TSK_SWITCH == 1)
#define MAX_SWITCH_INFO_SIZE (INFO_TYPE_AND_SIZE + (sizeof(UINT32) + sizeof(CHAR) * LOS_TASK_NAMELEN) * OS_TASK_SWITCH_INFO_COUNT)
#define MAX_SWITCH_INFO_SIZE (INFO_TYPE_AND_SIZE + (sizeof(UINT32) + sizeof(CHAR) * LOS_TASK_NAMELEN) \
* OS_TASK_SWITCH_INFO_COUNT)
#else
#define MAX_SWITCH_INFO_SIZE (0)
#endif
#define MAX_MEM_INFO_SIZE (INFO_TYPE_AND_SIZE + sizeof(MemInfoCB) * OS_SYS_MEM_NUM)
#define MAX_EXC_MEM_SIZE (INFO_TYPE_AND_SIZE + MAX_SCENE_INFO_SIZE + MAX_TSK_INFO_SIZE + MAX_QUEUE_INFO_SIZE + MAX_INT_INFO_SIZE + MAX_SWITCH_INFO_SIZE + MAX_MEM_INFO_SIZE)
#define MAX_EXC_MEM_SIZE (INFO_TYPE_AND_SIZE + MAX_SCENE_INFO_SIZE + MAX_TSK_INFO_SIZE + MAX_QUEUE_INFO_SIZE \
+ MAX_INT_INFO_SIZE + MAX_SWITCH_INFO_SIZE + MAX_MEM_INFO_SIZE)
typedef enum {
OS_EXC_TYPE_CONTEXT = 0,
......
......@@ -80,8 +80,8 @@ int LOS_Ftruncate(int fd, off_t length);
int LOS_FsUmount(const char *target);
int LOS_FsUmount2(const char *target, int flag);
int LOS_FsMount(const char *source, const char *target,
const char *fsType, unsigned long mountflags,
const void *data);
const char *fsType, unsigned long mountflags,
const void *data);
/*
* @brief Divide the device into partitions.
*
......
......@@ -909,7 +909,8 @@ static int MapToPosixRet(int ret)
int LOS_Open(const char *path, int flags, ...)
{
#ifdef LOSCFG_RANDOM_DEV
unsigned flagMask = O_RDONLY | O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_LARGEFILE | O_TRUNC | O_EXCL | O_DIRECTORY;
unsigned flagMask = O_RDONLY | O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_LARGEFILE \
| O_TRUNC | O_EXCL | O_DIRECTORY;
if ((unsigned)flags & ~flagMask) {
errno = EINVAL;
return LOS_NOK;
......
......@@ -4,7 +4,8 @@
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
......@@ -54,7 +55,7 @@ struct FsMap *VfsFsMapGet(const char *fsType)
}
int OsFsRegister(const char *fsType, struct MountOps *fsMops,
struct FileOps *fsFops, struct FsManagement *fsMgt)
struct FileOps *fsFops, struct FsManagement *fsMgt)
{
if ((fsMops == NULL) || (fsFops == NULL)) {
return LOS_NOK;
......
......@@ -57,7 +57,7 @@ struct FsMap {
};
int OsFsRegister(const char *fsType, struct MountOps *fsMops,
struct FileOps *fsFops, struct FsManagement *fsMgt);
struct FileOps *fsFops, struct FsManagement *fsMgt);
struct FsMap *VfsFsMapGet(const char *fsType);
#ifdef __cplusplus
......
......@@ -123,8 +123,8 @@ struct MountPoint *VfsMpFind(const char *path, const char **pathInMp)
}
int LOS_FsMount(const char *source, const char *target,
const char *fsType, unsigned long mountflags,
const void *data)
const char *fsType, unsigned long mountflags,
const void *data)
{
int ret;
struct MountPoint *mp = NULL;
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -191,7 +191,7 @@ VOID LOS_LmkOpsNodeInfoShow(VOID)
intSave = LOS_IntLock();
LOS_DL_LIST_FOR_EACH_ENTRY(opsNode, &g_losLmkOps.lmkOpsList, LosLmkOpsNode, node) {
PRINTK("Priority: %-4u Free:0x%-8x Restore:0x%-8x\n", opsNode->priority,
PRINTK("Priority: %-4u Free:0x%-8x Restore:0x%-8x\n", opsNode->priority,
(UINT32)(UINTPTR)opsNode->freeMem, (UINT32)(UINTPTR)opsNode->restoreTask);
}
LOS_IntRestore(intSave);
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -199,7 +199,7 @@ UINT32 LOS_LmkTasksRestore(VOID);
* @brief Kill the tasks to release the used memory.
*
* @par Description:
* This API is used to kill the tasks to release the used memory when low memory killer is triggered.
* This API is used to kill the tasks to release the used memory when low memory killer is triggered.
*
* @attention None.
*
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -56,7 +56,7 @@ void *memcpy(void *dest, const void *src, size_t len)
}
#undef strcat
char *strcat (char *s, const char *append)
char *strcat(char *s, const char *append)
{
if ((s == NULL) || (append == NULL)) {
return NULL;
......
/*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -175,7 +175,8 @@ int gethostbyname2_r(const char * __restrict name, int af, struct hostent * __re
int * __restrict h_errnop);
struct hostent *gethostbyname2(const char *name, int af);
int gethostbyaddr_r(const void * __restrict addr, __socklen_t len, int type, struct hostent * __restrict result_buf, \
char * __restrict buf, size_t buflen, struct hostent ** __restrict result, int * __restrict h_errnop);
char * __restrict buf, size_t buflen, struct hostent ** __restrict result, \
int * __restrict h_errnop);
int getservbyport_r(int port, const char * __restrict proto, struct servent * __restrict result_buf, \
char * __restrict buf, size_t buflen, struct servent ** __restrict result);
int getservbyname_r(const char *name, const char *proto, struct servent *result_buf, char *buf, size_t buflen, \
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -200,7 +200,8 @@ extern UINT32 LOS_EventInit(PEVENT_CB_S eventCB);
*
* @par Description:
* This API is used to check whether an event expected by the user occurs according to the event ID, event mask,
* and event reading mode, and process the event based on the event reading mode. The event ID must point to valid memory.
* and event reading mode, and process the event based on the event reading mode. The event ID must point to
* valid memory.
* @attention
* <ul>
* <li>When the mode is LOS_WAITMODE_CLR, the eventID is passed-out.</li>
......@@ -225,7 +226,8 @@ extern UINT32 LOS_EventPoll(UINT32 *eventID, UINT32 eventMask, UINT32 mode);
* @brief Read an event.
*
* @par Description:
* This API is used to block or schedule a task that reads an event of which the event control block, event mask, reading mode,
* This API is used to block or schedule a task that reads an event of which the event control block, event mask,
* reading mode,
* and timeout information are specified.
* </ul>
* @attention
......@@ -234,13 +236,15 @@ extern UINT32 LOS_EventPoll(UINT32 *eventID, UINT32 eventMask, UINT32 mode);
* the event mask is forbidden to be used.</li>
* </ul>
*
* @param eventCB [IN/OUT] Pointer to the event control block to be checked. This parameter must point to valid memory.
* @param eventCB [IN/OUT] Pointer to the event control block to be checked. This parameter must point to
* valid memory.
* @param eventMask [IN] Mask of the event expected to occur by the user, indicating the event obtained after
* it is logically processed that matches the ID pointed to by eventID.
* @param mode [IN] Event reading mode.
* @param timeOut [IN] Timeout interval of event reading (unit: Tick).
*
* @retval #LOS_ERRNO_EVENT_SETBIT_INVALID Bit 25 of the event mask cannot be set because it is set to an error number.
* @retval #LOS_ERRNO_EVENT_SETBIT_INVALID Bit 25 of the event mask cannot be set because
* it is set to an error number.
* @retval #LOS_ERRNO_EVENT_EVENTMASK_INVALID The passed-in event reading mode is incorrect.
* @retval #LOS_ERRNO_EVENT_READ_IN_INTERRUPT The event is being read during an interrupt.
* @retval #LOS_ERRNO_EVENT_FLAGS_INVALID The event mode is invalid.
......
......@@ -156,9 +156,9 @@ typedef struct {
*
* @par Description:
* <ul>
* <li>This API is used to initialize multiple non-continuous memory regions. If the starting address of a pool is specified,
* the memory regions will be linked to the pool as free nodes. Otherwise, the first memory region will be initialized as a
* new pool, and the rest regions will be linked as free nodes to the new pool.</li>
* <li>This API is used to initialize multiple non-continuous memory regions. If the starting address of a pool is
* specified, the memory regions will be linked to the pool as free nodes. Otherwise, the first memory region will
* be initialized as a * new pool, and the rest regions will be linked as free nodes to the new pool.</li>
* </ul>
*
* @attention
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -344,7 +344,8 @@ extern "C" {
/**
* @ingroup los_queue
* In struct QueueInfo, the length of each waitReadTask/waitWriteTask/waitMemTask array depends on the value
* LOSCFG_BASE_CORE_TSK_LIMIT. The type of each array element is UINT32, which means that each element could mark 32(=2^5) tasks.
* LOSCFG_BASE_CORE_TSK_LIMIT. The type of each array element is UINT32, which means that each element could
* mark 32(=2^5) tasks.
* OS_WAIT_TASK_ARRAY_LEN is used to calculate the array length.
* OS_WAIT_TASK_ID_TO_ARRAY_IDX is used to transfer task ID to array index.
* OS_WAIT_TASK_ARRAY_ELEMENT_MASK is the mask for each element.
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -325,7 +325,6 @@ UINT32 OsQueueOperate(UINT32 queueID, UINT32 operateType, VOID *bufferAddr, UINT
OsQueueBufferOperate(queueCB, operateType, bufferAddr, bufferSize);
if (!LOS_ListEmpty(&queueCB->readWriteList[readWriteTmp])) {
resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&queueCB->readWriteList[readWriteTmp]));
OsSchedTaskWake(resumedTask);
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -101,7 +101,6 @@ LITE_OS_SEC_TEXT VOID OsSwtmrTask(VOID)
tick = LOS_TickCountGet();
swtmrHandle.handler(swtmrHandle.arg);
tick = LOS_TickCountGet() - tick;
if (tick >= SWTMR_MAX_RUNNING_TICKS) {
PRINT_WARN("timer_handler(%p) cost too many ms(%d)\n",
swtmrHandle.handler,
......
......@@ -29,7 +29,7 @@ g_row_num = 0
try:
from openpyxl import Workbook
except:
print ("excel output is not support, need install openpyxl")
print("excel output is not support, need install openpyxl")
else:
g_excel_support = True
......@@ -60,21 +60,21 @@ def store_static_excel():
wb = Workbook()
ws = wb.active
for base_address, values in static_map.items():
c = ws.cell(row = base_address + 1, column = 1)
c = ws.cell(row=base_address + 1, column=1)
c.value = values.get('offsets')
c = ws.cell(row = base_address + 1, column = 2)
c = ws.cell(row=base_address + 1, column=2)
c.value = values.get('section')
c = ws.cell(row = base_address + 1, column = 3)
c = ws.cell(row=base_address + 1, column=3)
c.value = values.get('sizeH')
c = ws.cell(row = base_address + 1, column = 4)
c = ws.cell(row=base_address + 1, column=4)
c.value = values.get('sizeD')
c = ws.cell(row = base_address + 1, column = 5)
c = ws.cell(row=base_address + 1, column=5)
c.value = values.get('symbol')
c = ws.cell(row = base_address + 1, column = 6)
c = ws.cell(row=base_address + 1, column=6)
c.value = values.get('lib')
c = ws.cell(row = base_address + 1, column = 7)
c = ws.cell(row=base_address + 1, column=7)
c.value = values.get('obj')
wb.save('static_symbol-%s.xlsx' %datetime.datetime.now().strftime('%Y-%m-%d %H_%M_%S'))
wb.save('static_symbol-%s.xlsx' % datetime.datetime.now().strftime('%Y-%m-%d %H_%M_%S'))
return
def format_store_static():
......@@ -152,7 +152,7 @@ def store_dync_excel():
c = ws.cell(row, column + 3)
c.value = values.get('lib')
column = column + 3
wb.save('dync_mem-%s.xlsx' %datetime.datetime.now().strftime('%Y-%m-%d %H_%M_%S'))
wb.save('dync_mem-%s.xlsx' % datetime.datetime.now().strftime('%Y-%m-%d %H_%M_%S'))
return
def format_store_dync():
......@@ -296,7 +296,7 @@ def parse_log(log_path):
get_valid_log = False
for index, line in enumerate(logline):
char_list = line.split()
if len (char_list) < 3:
if len(char_list) < 3:
continue
if ("node" == char_list[0]) & ("LR[0]" == char_list[2]):
storage_dync_head(len(char_list) - 2)
......@@ -318,34 +318,34 @@ def parse_log(log_path):
continue
def main():
print ("memory parses tool ver.%2f\r\n" %g_version)
print("memory parses tool ver.%2f\r\n" % g_version)
parser = argparse.ArgumentParser()
parser.add_argument('--m', help = 'map path.')
parser.add_argument('--l', help = 'dynamic mem log path.')
parser.add_argument('--d', help = 'objdump path.')
parser.add_argument('--m', help='map path.')
parser.add_argument('--l', help='dynamic mem log path.')
parser.add_argument('--d', help='objdump path.')
args = parser.parse_args()
print ("map path: %s\r\n" %args.m)
print("map path: %s\r\n" % args.m)
if args.m == None :
print ("arg error, input -h get the help list\r\n")
print("arg error, input -h get the help list\r\n")
return
parse_map(args.m)
print ("dump path: %s" %args.d)
print("dump path: %s" % args.d)
if args.d != None :
parse_dump(args.d)
format_store_static()
else:
print ("dump path unspecified, will not be static parser")
print ("you can enter the objdump -t command under the linux shell to obtain dump information\r\n")
print("dump path unspecified, will not be static parser")
print("you can enter the objdump -t command under the linux shell to obtain dump information\r\n")
print ("log path: %s" %args.l)
print("log path: %s" % args.l)
if args.l != None :
parse_log(args.l)
format_store_dync()
else:
print ("log path unspecified, will not be dynamic parser\r\n")
print("log path unspecified, will not be dynamic parser\r\n")
return
......
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
......@@ -102,9 +102,6 @@ extern "C" {
#define LOS_ERRNO_OS_NORMAL(moduleID, errno) \
(LOS_ERRTYPE_NORMAL | LOS_ERRNO_OS_ID | ((UINT32)(moduleID) << 8) | (errno))
/**
* @ingroup los_err
* @brief Define the pointer to the error handling function.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册