Skip to content

Commit 0e97898

Browse files
authored
Adjust Config processing logic and order (#178)
--- Signed-off-by: Kartik Nema <kartnema@qti.qualcomm.com>
1 parent e1368e1 commit 0e97898

7 files changed

Lines changed: 156 additions & 174 deletions

File tree

configs/PropertiesConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ PropertyConfigs:
3939
Value: "SYSLOG"
4040

4141
- Name: urm.extensions_lib.count
42-
Value: "3"
42+
Value: "6"

modula/Components/Include/Logger.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ enum CommonMessageTypes {
8787
NOTIFY_PARSING_START,
8888
NOTIFY_PARSING_SUCCESS,
8989
NOTIFY_PARSING_FAILURE,
90-
NOTIFY_CUSTOM_CONFIG_FILE,
9190
NOTIFY_PARSER_FILE_NOT_FOUND,
9291
LOGICAL_TO_PHYSICAL_MAPPING_GEN_FAILURE,
9392
LOGICAL_TO_PHYSICAL_MAPPING_GEN_SUCCESS,

modula/Components/Logger.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ void Logger::typeLog(CommonMessageTypes type, const std::string& funcName, ...)
572572

573573
case CommonMessageTypes::NOTIFY_PARSING_START:
574574
vsnprintf(buffer, sizeof(buffer),
575-
"Proceeding with [%s] Config Parsing", args);
575+
"Proceeding with [%s] Config Parsing, Path: [%s]", args);
576576

577577
Logger::log(LOG_INFO, "URM_SERVER_INIT", funcName, buffer);
578578
break;
@@ -591,13 +591,6 @@ void Logger::typeLog(CommonMessageTypes type, const std::string& funcName, ...)
591591
Logger::log(LOG_ERR, "URM_SERVER_INIT", funcName, buffer);
592592
break;
593593

594-
case CommonMessageTypes::NOTIFY_CUSTOM_CONFIG_FILE:
595-
vsnprintf(buffer, sizeof(buffer),
596-
"Custom [%s] Config file provided [path: %s]", args);
597-
598-
Logger::log(LOG_INFO, "URM_SERVER_INIT", funcName, buffer);
599-
break;
600-
601594
case CommonMessageTypes::NOTIFY_PARSER_FILE_NOT_FOUND:
602595
vsnprintf(buffer, sizeof(buffer),
603596
"[%s] Config Parsing Failed, Expected File: [%s] not found.", args);

modula/CoreModules/Include/UrmSettings.h

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,31 @@ class UrmSettings {
4949
static const std::string mTargetConfDir;
5050

5151
// Support both versions: Common and Custom
52-
static const std::string mCommonResourceFilePath;
53-
static const std::string mCustomResourceFilePath;
54-
static const std::string mCommonSignalFilePath;
55-
static const std::string mCustomSignalFilePath;
56-
static const std::string mCommonPropertiesFilePath;
57-
static const std::string mCustomPropertiesFilePath;
58-
static const std::string mCommonInitConfigFilePath;
59-
static const std::string mCustomInitConfigFilePath;
60-
61-
// Only Custom Config is supported for Target and Ext Features Config
62-
static const std::string mCustomTargetFilePath;
63-
static const std::string mCustomExtFeaturesFilePath;
64-
static const std::string mCustomAppConfigFilePath;
52+
static const std::string mCommonResourcesPath;
53+
static const std::string mCustomResourcesPath;
54+
static const std::string mDevIndexedResourcesPath;
55+
56+
static const std::string mCommonSignalsPath;
57+
static const std::string mCustomSignalsPath;
58+
static const std::string mDevIndexedSignalsPath;
59+
60+
static const std::string mCommonPropertiesPath;
61+
static const std::string mCustomPropertiesPath;
62+
static const std::string mDevIndexedPropertiesPath;
63+
64+
static const std::string mCommonInitPath;
65+
static const std::string mCustomInitPath;
66+
static const std::string mDevIndexedInitPath;
67+
68+
// Only Custom Config is supported for Target, Ext Features and App Configs
69+
static const std::string mCustomTargetPath;
70+
static const std::string mDevIndexedTargetPath;
71+
72+
static const std::string mCustomExtFeaturesPath;
73+
static const std::string mDevIndexedExtFeatPath;
74+
75+
static const std::string mCustomAppConfigPath;
76+
static const std::string mDevIndexedAppPath;
6577

6678
static const std::string focusedCgroup;
6779
static const std::string mDeviceNamePath;

modula/CoreModules/UrmSettings.cpp

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,48 @@ TargetConfigs UrmSettings::targetConfigs{};
99

1010
const std::string UrmSettings::mTargetConfDir = "/etc/urm/target/";
1111

12-
const std::string UrmSettings::mCommonResourceFilePath =
12+
const std::string UrmSettings::mCommonResourcesPath =
1313
"/etc/urm/common/ResourcesConfig.yaml";
14-
const std::string UrmSettings::mCustomResourceFilePath =
14+
const std::string UrmSettings::mCustomResourcesPath =
1515
"/etc/urm/custom/ResourcesConfig.yaml";
16+
const std::string UrmSettings::mDevIndexedResourcesPath =
17+
"/etc/urm/target/ResourcesConfig.yaml";
1618

17-
const std::string UrmSettings::mCommonSignalFilePath =
19+
const std::string UrmSettings::mCommonSignalsPath =
1820
"/etc/urm/common/SignalsConfig.yaml";
19-
const std::string UrmSettings::mCustomSignalFilePath =
21+
const std::string UrmSettings::mCustomSignalsPath =
2022
"/etc/urm/custom/SignalsConfig.yaml";
23+
const std::string UrmSettings::mDevIndexedSignalsPath =
24+
"/etc/urm/target/SignalsConfig.yaml";
2125

22-
const std::string UrmSettings::mCommonInitConfigFilePath =
26+
const std::string UrmSettings::mCommonInitPath =
2327
"/etc/urm/common/InitConfig.yaml";
24-
const std::string UrmSettings::mCustomInitConfigFilePath =
28+
const std::string UrmSettings::mCustomInitPath =
2529
"/etc/urm/custom/InitConfig.yaml";
30+
const std::string UrmSettings::mDevIndexedInitPath =
31+
"/etc/urm/target/InitConfig.yaml";
2632

27-
const std::string UrmSettings::mCommonPropertiesFilePath =
33+
const std::string UrmSettings::mCommonPropertiesPath =
2834
"/etc/urm/common/PropertiesConfig.yaml";
29-
const std::string UrmSettings::mCustomPropertiesFilePath =
35+
const std::string UrmSettings::mCustomPropertiesPath =
3036
"/etc/urm/custom/PropertiesConfig.yaml";
37+
const std::string UrmSettings::mDevIndexedPropertiesPath =
38+
"/etc/urm/target/PropertiesConfig.yaml";
3139

32-
const std::string UrmSettings::mCustomTargetFilePath =
40+
const std::string UrmSettings::mCustomTargetPath =
3341
"/etc/urm/custom/TargetConfig.yaml";
42+
const std::string UrmSettings::mDevIndexedTargetPath =
43+
"/etc/urm/target/TargetConfig.yaml";
3444

35-
const std::string UrmSettings::mCustomExtFeaturesFilePath =
45+
const std::string UrmSettings::mCustomExtFeaturesPath =
3646
"/etc/urm/custom/ExtFeaturesConfig.yaml";
47+
const std::string UrmSettings::mDevIndexedExtFeatPath =
48+
"/etc/urm/target/ExtFeaturesConfig.yaml";
3749

38-
const std::string UrmSettings::mCustomAppConfigFilePath =
50+
const std::string UrmSettings::mCustomAppConfigPath =
3951
"/etc/urm/custom/PerApp.yaml";
52+
const std::string UrmSettings::mDevIndexedAppPath =
53+
"/etc/urm/target/PerApp.yaml";
4054

4155
const std::string UrmSettings::mExtensionPluginsLibPath =
4256
"/usr/lib/urm/";

0 commit comments

Comments
 (0)