blob: e22e828a60c9e1a439fa5a8542356c2a01c3139e [file] [log] [blame]
Martin Stjernholmc15e7e42020-12-02 22:50:53 +00001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ART_LIBARTPALETTE_INCLUDE_PALETTE_PALETTE_METHOD_LIST_H_
18#define ART_LIBARTPALETTE_INCLUDE_PALETTE_PALETTE_METHOD_LIST_H_
19
Martin Stjernholme3da7192021-06-29 02:23:58 +010020#include <stdbool.h>
Martin Stjernholmc15e7e42020-12-02 22:50:53 +000021#include <stddef.h>
22#include <stdint.h>
23
Martin Stjernholme3da7192021-06-29 02:23:58 +010024#include "jni.h"
25
Fairphone ODM25c12f52023-12-15 17:24:06 +080026#define PALETTE_METHOD_LIST(M) \
27 /* Methods in version 1 API, corresponding to SDK level 31. */ \
28 M(PaletteSchedSetPriority, int32_t tid, int32_t java_priority) \
29 M(PaletteSchedGetPriority, int32_t tid, /*out*/ int32_t* java_priority) \
30 M(PaletteWriteCrashThreadStacks, const char* stacks, size_t stacks_len) \
31 M(PaletteTraceEnabled, /*out*/ bool* enabled) \
32 M(PaletteTraceBegin, const char* name) \
33 M(PaletteTraceEnd) \
34 M(PaletteTraceIntegerValue, const char* name, int32_t value) \
35 M(PaletteAshmemCreateRegion, const char* name, size_t size, int* fd) \
36 M(PaletteAshmemSetProtRegion, int, int) \
37 /* Create the staging directory for on-device signing. */ \
38 /* `staging_dir` is updated to point to a constant string in the */ \
39 /* palette implementation. */ \
40 /* This method is not thread-safe. */ \
41 M(PaletteCreateOdrefreshStagingDirectory, /*out*/ const char** staging_dir) \
42 M(PaletteShouldReportDex2oatCompilation, bool*) \
43 M(PaletteNotifyStartDex2oatCompilation, int source_fd, int art_fd, int oat_fd, int vdex_fd) \
44 M(PaletteNotifyEndDex2oatCompilation, int source_fd, int art_fd, int oat_fd, int vdex_fd) \
45 M(PaletteNotifyDexFileLoaded, const char* path) \
46 M(PaletteNotifyOatFileLoaded, const char* path) \
47 M(PaletteShouldReportJniInvocations, bool*) \
48 M(PaletteNotifyBeginJniInvocation, JNIEnv* env) \
49 M(PaletteNotifyEndJniInvocation, JNIEnv* env) \
50 \
51 /* Methods in version 2 API, corresponding to SDK level 33. */ \
52 M(PaletteReportLockContention, \
53 JNIEnv* env, \
54 int32_t wait_ms, \
55 const char* filename, \
56 int32_t line_number, \
57 const char* method_name, \
58 const char* owner_filename, \
59 int32_t owner_line_number, \
60 const char* owner_method_name, \
61 const char* proc_name, \
62 const char* thread_name) \
63 \
64 /* Methods in version 3 API, corresponding to SDK level 34. */ \
65 \
66 /* Calls through to SetTaskProfiles in libprocessgroup to set the */ \
67 /* [task profile](https:/-/source.android.com/docs/core/perf/cgroups#task-profiles-file) */ \
68 /* for the given thread id. */ \
69 /* */ \
70 /* @param tid The thread id. */ \
71 /* @param profiles An array of pointers to C strings that list the task profiles to set. */ \
72 /* @param profiles_len The number of elements in profiles. */ \
73 /* @return PALETTE_STATUS_OK if the call succeeded. */ \
74 /* PALETTE_STATUS_FAILED_CHECK_LOG if it failed. */ \
75 /* PALETTE_STATUS_NOT_SUPPORTED if the implementation no longer supports this */ \
76 /* call. This can happen at any future SDK level since this function wraps an */ \
77 /* internal unstable API. */ \
78 M(PaletteSetTaskProfiles, int32_t tid, const char* const profiles[], size_t profiles_len)
Martin Stjernholmc15e7e42020-12-02 22:50:53 +000079
80#endif // ART_LIBARTPALETTE_INCLUDE_PALETTE_PALETTE_METHOD_LIST_H_