-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common power-libperfmgr bringup #1
base: fourteen-v3
Are you sure you want to change the base?
Changes from all commits
a3c821b
469b151
9c2bef5
5779574
99b2806
23cd78f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../build/soong/scripts/system-clang-format |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Copyright (C) 2021-2024 The LineageOS Project | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
soong_namespace { | ||
} | ||
|
||
cc_library_shared { | ||
name: "libqti-perfd-client", | ||
srcs: ["client.c"], | ||
shared_libs: [ | ||
"liblog", | ||
"libutils", | ||
], | ||
vendor: true, | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,29 @@ | ||||||||||||||
/* | ||||||||||||||
* Copyright (C) 2021-2024 The LineageOS Project | ||||||||||||||
* | ||||||||||||||
* SPDX-License-Identifier: Apache-2.0 | ||||||||||||||
*/ | ||||||||||||||
|
||||||||||||||
#define LOG_TAG "libqti-perfd-client" | ||||||||||||||
|
||||||||||||||
#include <log/log.h> | ||||||||||||||
#include <stdint.h> | ||||||||||||||
|
||||||||||||||
void perf_get_feedback() {} | ||||||||||||||
|
||||||||||||||
void perf_hint() {} | ||||||||||||||
|
||||||||||||||
int perf_lock_acq(int handle, int duration, int arg3[], int arg4) { | ||||||||||||||
ALOGI("perf_lock_acq: handle: %d, duration: %d, arg3[0]: %d, arg4: %d", handle, duration, | ||||||||||||||
arg3[0], arg4); | ||||||||||||||
return handle ?: 233; | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
void perf_lock_cmd() {} | ||||||||||||||
|
||||||||||||||
int perf_lock_rel(int handle) { | ||||||||||||||
ALOGI("perf_lock_rel: handle: %d", handle); | ||||||||||||||
return handle ?: 233; | ||||||||||||||
Comment on lines
+24
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential portability issue with GCC extension. The use of the - return handle ?: 233;
+ return handle ? handle : 233; Committable suggestion
Suggested change
|
||||||||||||||
} | ||||||||||||||
|
||||||||||||||
void perf_lock_use_profile() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential portability issue with GCC extension.
The use of the
?:
ternary operator is a GCC extension and may not be portable. Consider using a standard ternary operator for better portability.Committable suggestion