/base/startup/init/services/param/base/ |
D | param_trie.c | 26 static uint32_t AllocateParamTrieNode(WorkSpace *workSpace, const char *key, uint32_t keyLen); 28 static int GetRealFileName(WorkSpace *workSpace, char *buffer, uint32_t size) in GetRealFileName() argument 30 int ret = PARAM_SPRINTF(buffer, size, "%s/%s", PARAM_STORAGE_PATH, workSpace->fileName); in GetRealFileName() 31 PARAM_CHECK(ret > 0, return -1, "Failed to copy file name %s", workSpace->fileName); in GetRealFileName() 36 static int InitWorkSpace_(WorkSpace *workSpace, uint32_t spaceSize, int readOnly) in InitWorkSpace_() argument 38 PARAM_CHECK(workSpace != NULL, return PARAM_CODE_INVALID_PARAM, "Invalid workSpace"); in InitWorkSpace_() 43 int ret = GetRealFileName(workSpace, buffer, sizeof(buffer)); in InitWorkSpace_() 44 PARAM_CHECK(ret == 0, return -1, "Failed to get file name %s", workSpace->fileName); in InitWorkSpace_() 45 void *areaAddr = GetSharedMem(buffer, &workSpace->memHandle, spaceSize, readOnly); in InitWorkSpace_() 48 workSpace->area = (ParamTrieHeader *)areaAddr; in InitWorkSpace_() [all …]
|
D | param_comm.c | 32 return paramSpace->workSpace[labelIndex]; in GetWorkSpaceByName() 36 return paramSpace->workSpace[WORKSPACE_INDEX_DAC]; in GetWorkSpaceByName() 44 PARAM_CHECK(paramSpace->workSpace != NULL, return NULL, "Invalid paramSpace->workSpace"); in GetWorkSpace() 48 return paramSpace->workSpace[0]; in GetWorkSpace() 50 WorkSpace *workSpace = NULL; in GetWorkSpace() local 52 workSpace = paramSpace->workSpace[labelIndex]; in GetWorkSpace() 54 if (workSpace == NULL) { in GetWorkSpace() 57 uint32_t rwSpaceLock = ATOMIC_LOAD_EXPLICIT(&workSpace->rwSpaceLock, MEMORY_ORDER_ACQUIRE); in GetWorkSpace() 61 if (workSpace->area != NULL) { in GetWorkSpace() 62 return workSpace; in GetWorkSpace() [all …]
|
D | param_base.c | 36 STATIC_INLINE int CheckAndExtendSpace(ParamWorkSpace *workSpace, const char *name, uint32_t labelIn… 37 STATIC_INLINE ParamTrieNode *BaseFindTrieNode(WorkSpace *workSpace, 41 static int InitParamSecurity(ParamWorkSpace *workSpace, in InitParamSecurity() argument 44 PARAM_CHECK(workSpace != NULL && type < PARAM_SECURITY_MAX, return -1, "Invalid param"); in InitParamSecurity() 45 registerOps(&workSpace->paramSecurityOps[type], isInit); in InitParamSecurity() 46 PARAM_CHECK(workSpace->paramSecurityOps[type].securityInitLabel != NULL, in InitParamSecurity() 48 … int ret = workSpace->paramSecurityOps[type].securityInitLabel(&workSpace->securityLabel, isInit); in InitParamSecurity() 58 …ret = paramSecurityOps->securityCheckFilePermission(&workSpace->securityLabel, PARAM_STORAGE_PATH,… in InitParamSecurity() 134 …g_paramWorkSpace.workSpace = (WorkSpace **)calloc(g_paramWorkSpace.maxLabelIndex, sizeof(WorkSpace… in InitParamWorkSpace() 135 …PARAM_CHECK(g_paramWorkSpace.workSpace != NULL, return -1, "Failed to alloc memory for workSpace"); in InitParamWorkSpace() [all …]
|
D | param_include.h | 38 STATIC_INLINE ParamTrieNode *FindSubTrie(const WorkSpace *workSpace, in FindSubTrie() argument 62 if (offset == 0 || offset > workSpace->area->dataSize) { in FindSubTrie() 65 subTrie = (ParamTrieNode *)(workSpace->area->data + offset); in FindSubTrie() 71 const WorkSpace *workSpace, const char *key, uint32_t keyLen, uint32_t *matchLabel) in FindTrieNode_() argument 74 ParamTrieNode *current = GetTrieRoot(workSpace); in FindTrieNode_() 86 ParamTrieNode *next = GetTrieNode(workSpace, current->child); in FindTrieNode_() 87 current = FindSubTrie(workSpace, next, remainingKey, subKeyLen, matchLabel); in FindTrieNode_() 89 current = FindSubTrie(workSpace, current, remainingKey, subKeyLen, matchLabel); in FindTrieNode_()
|
/base/startup/init/services/param/include/ |
D | param_trie.h | 33 INIT_LOCAL_API int InitWorkSpace(WorkSpace *workSpace, int onlyRead, uint32_t spaceSize); 34 INIT_LOCAL_API void CloseWorkSpace(WorkSpace *workSpace); 36 #define GetTrieNode(workSpace, offset) (ParamTrieNode *)(((offset) == 0 || (offset) > (workSpace)->… argument 37 NULL : (workSpace)->area->data + (offset)) 39 #define GetTrieRoot(workSpace) \ argument 40 …(ParamTrieNode *)(((workSpace)->area == NULL) ? NULL : (workSpace)->area->data + (workSpace)->area… 44 INIT_LOCAL_API ParamTrieNode *AddTrieNode(WorkSpace *workSpace, const char *key, uint32_t keyLen); 46 WorkSpace *workSpace, const char *key, uint32_t keyLen, uint32_t *matchLabel); 48 typedef int (*TraversalTrieNodePtr)(const WorkSpace *workSpace, const ParamTrieNode *node, const vo… 49 INIT_LOCAL_API int TraversalTrieNode(const WorkSpace *workSpace, [all …]
|
D | trigger_manager.h | 90 struct tagTriggerNode_ *(*addTrigger)(const struct TriggerWorkSpace_ *workSpace, 95 …int32_t (*checkAndMarkTrigger)(const struct TriggerWorkSpace_ *workSpace, int type, const char *na… 96 int32_t (*checkTriggerMatch)(const struct TriggerWorkSpace_ *workSpace, int type, 103 void (*delTrigger)(const struct TriggerWorkSpace_ *workSpace, struct tagTriggerNode_ *trigger); 104 void (*dumpTrigger)(const struct TriggerWorkSpace_ *workSpace, 173 TriggerHeader *GetTriggerHeader(const TriggerWorkSpace *workSpace, int type); 174 void InitTriggerHead(const TriggerWorkSpace *workSpace); 176 int CheckTrigger(TriggerWorkSpace *workSpace, int type, 180 TriggerNode *ExecuteQueuePop(TriggerWorkSpace *workSpace); 181 int ExecuteQueuePush(TriggerWorkSpace *workSpace, const TriggerNode *trigger); [all …]
|
D | param_manager.h | 75 WorkSpace **workSpace; member 106 #define PARAM_HANDLE(workSpace, index) (ParamHandle)((workSpace)->spaceIndex << 24 | (index)) argument
|
/base/startup/init/services/param/trigger/ |
D | trigger_manager.c | 114 static TriggerNode *AddJobTrigger_(const TriggerWorkSpace *workSpace, in AddJobTrigger_() argument 117 PARAM_CHECK(workSpace != NULL, return NULL, "workSpace is null"); in AddJobTrigger_() 120 TriggerHeader *triggerHead = GetTriggerHeader(workSpace, extInfo->type); in AddJobTrigger_() 127 PARAM_CHECK(ret == 0, FreeTrigger(workSpace, node); in AddJobTrigger_() 138 static void DelJobTrigger_(const TriggerWorkSpace *workSpace, TriggerNode *trigger) in DelJobTrigger_() argument 140 PARAM_CHECK(workSpace != NULL, return, "Param is null"); in DelJobTrigger_() 143 TriggerHeader *triggerHead = GetTriggerHeader(workSpace, trigger->type); in DelJobTrigger_() 160 OH_HashMapRemove(workSpace->hashMap, jobNode->name); in DelJobTrigger_() 166 TriggerExecuteQueue *executeQueue = (TriggerExecuteQueue *)&workSpace->executeQueue; in DelJobTrigger_() 176 static TriggerNode *AddWatchTrigger_(const TriggerWorkSpace *workSpace, in AddWatchTrigger_() argument [all …]
|
D | trigger_processor.c | 227 static int ParseTrigger_(const TriggerWorkSpace *workSpace, in ParseTrigger_() argument 231 PARAM_CHECK(workSpace != NULL, return -1, "Failed to create trigger list"); in ParseTrigger_() 242 TriggerHeader *header = GetTriggerHeader(workSpace, type); in ParseTrigger_() 244 JobNode *trigger = UpdateJobTrigger(workSpace, type, condition, name); in ParseTrigger_()
|
/base/startup/init/services/param/manager/ |
D | param_manager.c | 64 static int ProcessParamTraversal(const WorkSpace *workSpace, const ParamTrieNode *node, const void … in ProcessParamTraversal() argument 74 ParamNode *entry = (ParamNode *)GetTrieNode(workSpace, current->dataIndex); in ProcessParamTraversal() 81 uint32_t index = PARAM_HANDLE(workSpace, current->dataIndex); in ProcessParamTraversal() 106 WorkSpace *workSpace = GetNextWorkSpace(NULL); in SystemTraversalParameter() local 107 if (workSpace != NULL && strcmp(workSpace->fileName, WORKSPACE_NAME_DAC) == 0) { in SystemTraversalParameter() 108 workSpace = GetNextWorkSpace(workSpace); in SystemTraversalParameter() 110 while (workSpace != NULL) { in SystemTraversalParameter() 111 … PARAM_LOGV("SystemTraversalParameter prefix %s in space %s", context.prefix, workSpace->fileName); in SystemTraversalParameter() 112 WorkSpace *next = GetNextWorkSpace(workSpace); in SystemTraversalParameter() 115 root = FindTrieNode(workSpace, prefix, strlen(prefix), NULL); in SystemTraversalParameter() [all …]
|
D | param_persist.c | 65 static int SavePersistParam(const WorkSpace *workSpace, const ParamTrieNode *node, const void *cook… in SavePersistParam() argument 71 ParamNode *entry = (ParamNode *)GetTrieNode(workSpace, current->dataIndex); in SavePersistParam() 107 WorkSpace *workSpace = GetNextWorkSpace(NULL); in BatchSavePersistParam() local 108 while (workSpace != NULL) { in BatchSavePersistParam() 109 WorkSpace *next = GetNextWorkSpace(workSpace); in BatchSavePersistParam() 110 ParamTrieNode *root = FindTrieNode(workSpace, prefix, strlen(prefix), NULL); in BatchSavePersistParam() 111 PARAMSPACE_AREA_RD_LOCK(workSpace); in BatchSavePersistParam() 112 TraversalTrieNode(workSpace, root, SavePersistParam, (void *)handle); in BatchSavePersistParam() 113 PARAMSPACE_AREA_RW_UNLOCK(workSpace); in BatchSavePersistParam() 114 workSpace = next; in BatchSavePersistParam()
|
/base/startup/init/test/unittest/param/ |
D | param_unittest.cpp | 457 WorkSpace *workSpace = (WorkSpace *)malloc(sizeof(WorkSpace) + size); variable 458 if (workSpace == nullptr) { 459 EXPECT_NE(workSpace, nullptr); 462 workSpace->flags = 0; 463 workSpace->area = nullptr; 464 int ret = PARAM_STRCPY(workSpace->fileName, size, spaceName); 466 CloseWorkSpace(workSpace); 467 free(workSpace);
|
D | param_stub.cpp | 760 labelIndex.workspace = paramWorkspace->workSpace[index]; in TestGetParamLabelIndex() 763 (void)FindTrieNode(paramWorkspace->workSpace[0], name, strlen(name), &labelIndex.dacLabelIndex); in TestGetParamLabelIndex()
|
/base/startup/init/services/param/adapter/ |
D | param_selinux.c | 221 …PARAM_CHECK(paramWorkspace != NULL && paramWorkspace->workSpace != NULL, return, "Invalid workspac… in HandleSelinuxLabelForPermission() 222 WorkSpace *space = paramWorkspace->workSpace[WORKSPACE_INDEX_DAC]; in HandleSelinuxLabelForPermission()
|
/base/startup/init/services/param/linux/ |
D | param_service.c | 203 TriggerWorkSpace *workSpace = GetTriggerWorkSpace(); in AddWatcherTrigger() local 204 TriggerHeader *header = (TriggerHeader *)&workSpace->triggerHead[extData->type]; in AddWatcherTrigger() 205 return header->addTrigger(workSpace, condition, extData); in AddWatcherTrigger()
|
/base/hiviewdfx/hiview/utility/smart_parser/test/resource/SmartParserTest004/ |
D | last_kmsg | 46 <11>[ 3.832323] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for musl.log.enable 48 <11>[ 3.832350] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for musl.ld.debug.dlclo… 50 <11>[ 3.832376] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for debug.hitrace.tags.…
|
/base/hiviewdfx/hiview/utility/smart_parser/test/resource/SmartParserTest008/ |
D | last_kmsg | 46 <11>[ 3.832323] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for musl.log.enable 48 <11>[ 3.832350] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for musl.ld.debug.dlclo… 50 <11>[ 3.832376] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for debug.hitrace.tags.…
|
/base/hiviewdfx/hiview/utility/smart_parser/test/resource/SmartParserTest005/ |
D | last_kmsg | 46 <11>[ 3.832323] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for musl.log.enable 48 <11>[ 3.832350] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for musl.ld.debug.dlclo… 50 <11>[ 3.832376] [pid=1][PARAM][ERROR][param_base.c:344]Invalid workSpace for debug.hitrace.tags.…
|