Skip to content

Commit 3b81bc7

Browse files
authored
Merge branch 'qualcomm:main' into main
2 parents 672727a + d0d1908 commit 3b81bc7

70 files changed

Lines changed: 1441 additions & 446 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Package Build PR Check
2+
description: |
3+
This workflow will execute when a PR is open against the configured branch.
4+
On top of whatever kind of CI/CD logic happens in this upstream repo, this
5+
workflow will make sure that what is attempted to be merged in the main release
6+
branch won't break the debian package. The variable PKG_REPO_GITHUB_NAME needs to
7+
be set in the repo where this file reside. This variable hold the packaging repo
8+
name on github associated to this upstream repo. What will happen is that the PR
9+
triggering this workflow will go knock on the packaging repo's door and trigger
10+
a full build of the package if it were to include these changes.
11+
12+
on:
13+
pull_request_target:
14+
branches: [ main, development ]
15+
types:
16+
- ready_for_review
17+
- synchronize
18+
paths-ignore:
19+
- '.github/**'
20+
21+
permissions:
22+
contents: read
23+
24+
concurrency:
25+
group: pr-${{ github.event.pull_request.number }}
26+
cancel-in-progress: true
27+
28+
jobs:
29+
package-build-pr-check:
30+
uses: qualcomm-linux/qcom-build-utils/.github/workflows/qcom-upstream-pr-pkg-build-reusable-workflow.yml@main
31+
with:
32+
qcom-build-utils-ref: main
33+
upstream-repo: ${{ github.event.pull_request.head.repo.full_name }}
34+
upstream-repo-ref: ${{ github.event.pull_request.head.ref }}
35+
pkg-repo: ${{vars.PKG_REPO_GITHUB_NAME}}
36+
pr-number: ${{github.event.pull_request.number}}
37+
secrets: inherit

.github/workflows/pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@ name: Build URM
22

33
on:
44
workflow_dispatch:
5-
pull_request_target: # requiring access to base repo
5+
pull_request:
66
types: [opened, synchronize, reopened]
77
branches:
88
- main
9-
# paths-ignore: #update if something has to be ignored.
109

1110
jobs:
1211
build:
1312
runs-on:
1413
group: GHA-CSEPerf-prd-SelfHosted-RG
1514
labels: [self-hosted, cseperf-prd-u2204-arm64-xlrg-od-ephem]
15+
1616
env:
1717
URM_BINS_DIR: urm-bins # base dir name
1818
URM_INSTALL_PREFIX: ./urm-bins/ # used by CMake
1919
TAR_NAME: urm-bins.tar.gz # output tarball name
2020

2121
steps:
22-
- uses: actions/checkout@v5
22+
- name: Checkout URM image repo
23+
uses: actions/checkout@v5
2324
with:
2425
repository: qualcomm/urm-image
25-
token: ${{ secrets.MY_PAT }}
2626

2727
- name: Set up Docker Buildx
2828
uses: docker/setup-buildx-action@v3

.github/workflows/qcom-preflight-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Qualcomm Preflight Checks
22
on:
3-
pull_request_target:
3+
pull_request:
44
branches: [ main ]
55
push:
66
branches: [ main ]

TODO.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

configs/InitConfig.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ InitConfigs:
1212
- Name: "user.slice"
1313
Create: false
1414
ID: 3
15-
- Name: "focused.slice/app.slice"
15+
- Name: "urm.slice/focused.apps"
1616
Create: true
1717
ID: 4
18-
- Name: "focused.slice"
19-
Create: false
20-
ID: 5

configs/PropertiesConfig.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ PropertyConfigs:
88
- Name: resource_tuner.maximum.resources.per.request
99
Value: "20"
1010

11+
- Name: resource_tuner.thread_pool.desired_capacity
12+
Value: "5"
13+
14+
- Name: resource_tuner.thread_pool.max_scaling_capacity
15+
Value: "10"
16+
1117
- Name: resource_tuner.pulse.duration
1218
Value: "23000"
1319

contextual-classifier/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ if(FLORET_FOUND)
5656

5757
target_link_libraries(ml_inference_lib PRIVATE ${FLORET_LIBRARIES})
5858
target_link_libraries(ContextualClassifier PRIVATE ml_inference_lib)
59+
target_link_libraries(ContextualClassifier PRIVATE RestuneCore)
5960

6061
target_include_directories(ml_inference_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Include)
6162
target_include_directories(ml_inference_lib PRIVATE ${FLORET_INCLUDE_DIRS})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ls,cp,sh,mv,rm,mkdir,touch,find,irqbalance,cpuUsage.sh,which,sudo,cpu.sh,ln,uname
1+
ls,cp,sh,mv,rm,mkdir,touch,find,irqbalance,cpuUsage.sh,which,sudo,cpu.sh,ln,uname,gst-plugin-scan
22
grep,sed,awk,cat,tail,head,less,more,sort,uniq,wc,cut,tr,tee
3-
ps,top,sleep,journalctl,xargs,logrotate
3+
ps,top,sleep,journalctl,xargs,logrotate,systemctl

contextual-classifier/ContextualClassifier.cpp

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ static ResIterable* createMovePidResource(int32_t cGroupdId, pid_t pid) {
100100
static Request* createTuneRequestFromSignal(uint32_t sigId,
101101
uint32_t sigType,
102102
pid_t incomingPID,
103-
pid_t incomingTID) {
103+
pid_t incomingTID,
104+
int32_t numArgs,
105+
int32_t* args) {
104106
try {
105107
std::shared_ptr<SignalRegistry> sigRegistry = SignalRegistry::getInstance();
106108

@@ -130,6 +132,18 @@ static Request* createTuneRequestFromSignal(uint32_t sigId,
130132
// Copy
131133
Resource* resource = MPLACEV(Resource, (*((*signalLocks)[i])));
132134

135+
// fill placeholders if any
136+
int32_t listIndex = 0;
137+
for(int32_t j = 0; j < resource->getValuesCount(); j++) {
138+
if(resource->getValueAt(j) == -1) {
139+
if(args == nullptr) return nullptr;
140+
if(listIndex >= 0 && listIndex < numArgs) {
141+
resource->setValueAt(j, args[listIndex]);
142+
listIndex++;
143+
}
144+
}
145+
}
146+
133147
ResIterable* resIterable = MPLACED(ResIterable);
134148
resIterable->mData = resource;
135149
request->addResource(resIterable);
@@ -228,6 +242,8 @@ void ContextualClassifier::ClassifierMain() {
228242
std::string comm;
229243
uint32_t sigId = URM_SIG_APP_OPEN;
230244
uint32_t sigType = DEFAULT_SIGNAL_TYPE;
245+
int32_t numArgs = 0;
246+
int32_t* args = nullptr;
231247
uint32_t ctxDetails = 0U;
232248

233249
if(ev.pid != -1) {
@@ -252,7 +268,7 @@ void ContextualClassifier::ClassifierMain() {
252268
// Untune any Configurations from the last proc-invocation
253269
for(int64_t handle: this->mCurrRestuneHandles) {
254270
if(handle > 0) {
255-
untuneRequestHelper(handle);
271+
this->untuneRequestHelper(handle);
256272
}
257273
}
258274
this->mCurrRestuneHandles.clear();
@@ -276,15 +292,19 @@ void ContextualClassifier::ClassifierMain() {
276292
.mPid = ev.pid,
277293
.mSigId = sigId,
278294
.mSigType = sigType,
295+
.mNumArgs = numArgs,
296+
.mArgs = args,
279297
};
280298
postCb((void*)&postProcessData);
281299

282300
sigId = postProcessData.mSigId;
283301
sigType = postProcessData.mSigType;
302+
numArgs = postProcessData.mNumArgs;
303+
args = postProcessData.mArgs;
284304
}
285305

286306
// Apply actions, call tuneSignal
287-
this->ApplyActions(sigId, sigType, ev.pid, ev.tgid);
307+
this->ApplyActions(sigId, sigType, ev.pid, ev.tgid, numArgs, args);
288308
}
289309
} else if(ev.type == CC_APP_CLOSE) {
290310
// No Action Needed, Pulse Monitor to take care of cleanup
@@ -388,16 +408,18 @@ int32_t ContextualClassifier::ClassifyProcess(pid_t processPid,
388408
void ContextualClassifier::ApplyActions(uint32_t sigId,
389409
uint32_t sigType,
390410
pid_t incomingPID,
391-
pid_t incomingTID) {
411+
pid_t incomingTID,
412+
int32_t numArgs,
413+
int32_t* args) {
392414
Request* request =
393-
createTuneRequestFromSignal(sigId, sigType, incomingPID, incomingTID);
415+
createTuneRequestFromSignal(sigId, sigType, incomingPID, incomingTID, numArgs, args);
394416
if(request != nullptr) {
395417
if(request->getResourcesCount() > 0) {
396418
// Record:
397419
this->mCurrRestuneHandles.push_back(request->getHandle());
398420

399421
// fast path to Request Queue
400-
submitResProvisionRequest(request, true);
422+
submitResProvisionRequest(request, false);
401423

402424
} else {
403425
Request::cleanUpRequest(request);
@@ -563,13 +585,15 @@ void ContextualClassifier::configureAppSignals(pid_t incomingPID,
563585
appConfig->mSignalCodes[i],
564586
0,
565587
incomingPID,
566-
incomingTID);
588+
incomingTID,
589+
0,
590+
nullptr);
567591

568592
if(request != nullptr) {
569593
if(request->getResourcesCount() > 0) {
570594
// fast path to Request Queue
571595
this->mCurrRestuneHandles.push_back(request->getHandle());
572-
submitResProvisionRequest(request, true);
596+
submitResProvisionRequest(request, false);
573597

574598
} else {
575599
Request::cleanUpRequest(request);

0 commit comments

Comments
 (0)