Userspace Resource Manager
Loading...
Searching...
No Matches
UrmSettings.h
1// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef URM_SETTINGS_H
5#define URM_SETTINGS_H
6
7#include <unordered_map>
8
9#include "ErrCodes.h"
10#include "Utils.h"
11
12#define URM_IDENTIFIER "urm"
13#define REQ_BUFFER_SIZE 580
14
15// Operational Tunable Parameters for Resource Tuner
16typedef struct {
17 uint32_t mMaxConcurrentRequests;
18 uint32_t mMaxResourcesPerRequest;
19 uint32_t mDesiredThreadCount;
20 uint32_t mMaxScalingCapacity;
21 uint32_t mListeningPort;
22 uint32_t mPulseDuration;
23 uint32_t mClientGarbageCollectorDuration;
24 uint32_t mDelta;
25 uint32_t mCleanupBatchSize;
26 double mPenaltyFactor;
27 double mRewardFactor;
28 uint32_t mPluginCount;
29 uint32_t mAcceptMode;
30} MetaConfigs;
31
32typedef struct {
33 std::string targetName;
34 int32_t mTotalCoreCount;
35 int32_t mTotalClusterCount;
36 // Determine whether the system is in Display On or Off / Doze Mode
37 // This needs to be tracked, so that only those Requests for which background Processing
38 // is Enabled can be processed during Display Off / Doze.
39 int8_t currMode;
40} TargetConfigs;
41
42class UrmSettings {
43private:
44 static int32_t serverOnlineStatus;
45
46public:
47
48 static const std::string mTargetConfDir;
49
50 // Support both versions: Common and Custom
51 static const std::string mCommonResourcesPath;
52 static const std::string mCustomResourcesPath;
53 static const std::string mDevIndexedResourcesPath;
54
55 static const std::string mCommonSignalsPath;
56 static const std::string mCustomSignalsPath;
57 static const std::string mDevIndexedSignalsPath;
58
59 static const std::string mCommonPropertiesPath;
60 static const std::string mCustomPropertiesPath;
61 static const std::string mDevIndexedPropertiesPath;
62
63 static const std::string mCommonInitPath;
64 static const std::string mCustomInitPath;
65 static const std::string mDevIndexedInitPath;
66
67 // Only Custom Config is supported for Target, Ext Features and App Configs
68 static const std::string mCustomTargetPath;
69 static const std::string mDevIndexedTargetPath;
70
71 static const std::string mCustomExtFeaturesPath;
72 static const std::string mDevIndexedExtFeatPath;
73
74 static const std::string mCustomAppConfigPath;
75 static const std::string mDevIndexedAppPath;
76
77 static const std::string focusedCgroup;
78 static const std::string mDeviceNamePath;
79 static const std::string mBaseCGroupPath;
80 static const std::string mPersistenceFile;
81
82 // Target Information Stores
83 static MetaConfigs metaConfigs;
84 static TargetConfigs targetConfigs;
85
86 static int32_t isServerOnline();
87 static void setServerOnlineStatus(int32_t isOnline);
88};
89
90#endif