summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2023-12-12 15:43:54 +0000
committer Roland Levillain <rpl@google.com> 2024-01-03 19:08:27 +0000
commit65e2d80c24f414de646b0cab430139da0171af97 (patch)
tree2644a640d3bd35ab732cf9d23601150b767efb30
parent7e0689862ab045327374985711f8d43cffdee271 (diff)
Update version information in `art/libartpalette`.
Test: m Change-Id: I15173c0e9b5cfa6749d2bf79b85cd89aefdcca2a
-rw-r--r--libartpalette/apex/palette.cc9
-rw-r--r--libartpalette/include/palette/palette_method_list.h8
-rw-r--r--libartpalette/libartpalette.map2
-rw-r--r--libartpalette/system/palette_fake.cc11
4 files changed, 14 insertions, 16 deletions
diff --git a/libartpalette/apex/palette.cc b/libartpalette/apex/palette.cc
index dadb4702b6..346cd184ff 100644
--- a/libartpalette/apex/palette.cc
+++ b/libartpalette/apex/palette.cc
@@ -110,7 +110,8 @@ PaletteLoader::PaletteLoader() :
extern "C" {
-// Methods in version 1 API, corresponding to SDK level 31.
+// Unless explicitly mentioned otherwise, the following methods have been
+// introduced in version 1 API, corresponding to SDK level 31.
palette_status_t PaletteSchedSetPriority(int32_t tid, int32_t java_priority) {
PaletteSchedSetPriorityMethod m = PaletteLoader::Instance().GetPaletteSchedSetPriorityMethod();
@@ -220,8 +221,7 @@ palette_status_t PaletteNotifyEndJniInvocation(JNIEnv* env) {
return m(env);
}
-// Methods in version 2 API, corresponding to SDK level 33.
-
+// Introduced in version 2 API, corresponding to SDK level 33.
palette_status_t PaletteReportLockContention(JNIEnv* env,
int32_t wait_ms,
const char* filename,
@@ -246,8 +246,7 @@ palette_status_t PaletteReportLockContention(JNIEnv* env,
thread_name);
}
-// Methods in version 3 API, corresponding to SDK level 34.
-
+// Introduced in version 3 API, corresponding to SDK level 34.
palette_status_t PaletteSetTaskProfiles(int32_t tid,
const char* const profiles[],
size_t profiles_len) {
diff --git a/libartpalette/include/palette/palette_method_list.h b/libartpalette/include/palette/palette_method_list.h
index e22e828a60..e5437cb33a 100644
--- a/libartpalette/include/palette/palette_method_list.h
+++ b/libartpalette/include/palette/palette_method_list.h
@@ -23,8 +23,9 @@
#include "jni.h"
+// Unless explicitly mentioned otherwise, the following methods have been
+// introduced in version 1 API, corresponding to SDK level 31.
#define PALETTE_METHOD_LIST(M) \
- /* Methods in version 1 API, corresponding to SDK level 31. */ \
M(PaletteSchedSetPriority, int32_t tid, int32_t java_priority) \
M(PaletteSchedGetPriority, int32_t tid, /*out*/ int32_t* java_priority) \
M(PaletteWriteCrashThreadStacks, const char* stacks, size_t stacks_len) \
@@ -48,7 +49,7 @@
M(PaletteNotifyBeginJniInvocation, JNIEnv* env) \
M(PaletteNotifyEndJniInvocation, JNIEnv* env) \
\
- /* Methods in version 2 API, corresponding to SDK level 33. */ \
+ /* Introduced in version 2 API, corresponding to SDK level 33. */ \
M(PaletteReportLockContention, \
JNIEnv* env, \
int32_t wait_ms, \
@@ -61,8 +62,7 @@
const char* proc_name, \
const char* thread_name) \
\
- /* Methods in version 3 API, corresponding to SDK level 34. */ \
- \
+ /* Introduced in version 3 API, corresponding to SDK level 34. */ \
/* Calls through to SetTaskProfiles in libprocessgroup to set the */ \
/* [task profile](https:/-/source.android.com/docs/core/perf/cgroups#task-profiles-file) */ \
/* for the given thread id. */ \
diff --git a/libartpalette/libartpalette.map b/libartpalette/libartpalette.map
index 11824cb46d..6172a21427 100644
--- a/libartpalette/libartpalette.map
+++ b/libartpalette/libartpalette.map
@@ -46,7 +46,7 @@ LIBARTPALETTE_2 { # introduced=33
PaletteReportLockContention; # apex
} LIBARTPALETTE_1;
-LIBARTPALETTE_3 { # introduced=UpsideDownCake
+LIBARTPALETTE_3 { # introduced=34
global:
# --- VERSION 03 API ---
PaletteSetTaskProfiles; # apex
diff --git a/libartpalette/system/palette_fake.cc b/libartpalette/system/palette_fake.cc
index accdc4ceb4..e698267d10 100644
--- a/libartpalette/system/palette_fake.cc
+++ b/libartpalette/system/palette_fake.cc
@@ -23,12 +23,13 @@
#include "palette/palette.h"
#include "palette_system.h"
-// Methods in version 1 API, corresponding to SDK level 31.
-
// Cached thread priority for testing. No thread priorities are ever affected.
static std::mutex g_tid_priority_map_mutex;
static std::map<int32_t, int32_t> g_tid_priority_map;
+// Unless explicitly mentioned otherwise, the following methods have been
+// introduced in version 1 API, corresponding to SDK level 31.
+
palette_status_t PaletteSchedSetPriority(int32_t tid, int32_t priority) {
if (priority < art::palette::kMinManagedThreadPriority ||
priority > art::palette::kMaxManagedThreadPriority) {
@@ -126,8 +127,7 @@ palette_status_t PaletteNotifyEndJniInvocation([[maybe_unused]] JNIEnv* env) {
return PALETTE_STATUS_OK;
}
-// Methods in version 2 API, corresponding to SDK level 33.
-
+// Introduced in version 2 API, corresponding to SDK level 33.
palette_status_t PaletteReportLockContention([[maybe_unused]] JNIEnv* env,
[[maybe_unused]] int32_t wait_ms,
[[maybe_unused]] const char* filename,
@@ -141,8 +141,7 @@ palette_status_t PaletteReportLockContention([[maybe_unused]] JNIEnv* env,
return PALETTE_STATUS_OK;
}
-// Methods in version 3 API, corresponding to SDK level 34.
-
+// Introduced in version 3 API, corresponding to SDK level 34.
palette_status_t PaletteSetTaskProfiles([[maybe_unused]] int32_t tid,
[[maybe_unused]] const char* const profiles[],
[[maybe_unused]] size_t profiles_len) {