No description. Add one?
  • Java 78%
  • Kotlin 11.8%
  • AIDL 4.4%
  • C++ 3.7%
  • C 1.5%
  • Other 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Maciej Żenczykowski 2afef5070a Optimize BpfMap JNI calls with FastNative/CriticalNative annotations
Convert BpfMap native methods to use @FastNative to reduce JNI overhead.

Refactor synchronizeKernelRCU() to be @CriticalNative for maximum
performance by changing its error handling to return an error code
instead of throwing directly from native code.
(In practice we don't expect it to *ever* fail)

FYI:

@FastNative and @CriticalNative are Android-specific annotations
that signal to the ART runtime to use a lower-overhead JNI transition,
resulting in better performance.

A standard JNI call tells the Garbage Collector (GC) that the thread
is transitioning to a 'Native' state. This is a signal to the GC that
the thread might be busy for a while and shouldn't be suspended arbitrarily.

@FastNative is for short, quick functions:
  This provides a moderately faster JNI call (thread is still 'Runnable').
  The native function signature remains the same as a standard JNI method,
  and it can still access the JNIEnv* to interact with Java objects
  or throw exceptions.

@CriticalNative is for short, quick & trivial functions:
  This provides the fastest possible JNI transition and is intended
  for simple, performance-critical leaf functions.
  It comes with strict requirements:
    - The native method cannot throw exceptions, create Java objects,
      or make any other JNI calls.
    - All arguments and the return type must be primitive, ie:
        jboolean [bool]
        jbyte [s8]
        jchar [u16]
        jshort [s16]
        jint [s32]
        jlong [s64]
        jfloat [32-bit]
        jdouble [64-bit]
        void
      Java objects like String or byte[] are not allowed.
  Because of these restrictions, the native C++ function signature
  must not include JNIEnv* or jobject/jclass parameters.
  (This likely also means it must be 'static')

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9b6107b26086df2e87218ff9274593e9f2eb6b0b
2025-08-12 15:28:05 -07:00
bpf KernelUtils: make failure to call & parse uname abort 2025-08-11 21:27:04 -07:00
clatd clatd: remove DEVICEPREFIX single use define 2025-08-05 12:15:16 -07:00
common replace CookieTagMapKey with S64 2025-08-07 15:52:35 -07:00
framework Include NET_CAPABILITY_NOT_VCN_MANAGED for tethering local network agent 2025-08-06 11:24:33 +08:00
framework-t Merge changes I12e4d492,I4c787e9c,I52a36ebb into main 2025-07-23 14:16:42 -07:00
nearby Revert "Introduce BLE advertiser wrapper for unit tests." 2025-07-31 14:49:58 -07:00
networksecurity Propagate system broadcast after log list install 2025-07-24 11:14:28 +00:00
remoteauth [owners] Remove derekjedral@google.com from remoteauth/OWNERS 2025-05-25 09:49:50 -07:00
service replace CookieTagMapKey with S64 2025-08-07 15:52:35 -07:00
service-b Conditionally include VCN in Tethering module 2024-12-09 12:04:12 -08:00
service-t BpfInterfaceMapHelper - flag map use as readonly. 2025-08-11 23:44:42 -07:00
staticlibs Optimize BpfMap JNI calls with FastNative/CriticalNative annotations 2025-08-12 15:28:05 -07:00
tests Merge "Add CDD annotation to APFv6 multi-device tests" into main 2025-08-10 18:40:25 -07:00
Tethering replace CookieTagMapKey with S64 2025-08-07 15:52:35 -07:00
thread Move #nativeWaitForService into CommonConnectivityJni 2025-08-06 10:44:39 -07:00
tools Add a tool to generate hidden module API lists 2025-04-24 09:05:08 +09:00
.clang-format Add .clang-format 2025-03-23 19:59:10 -07:00
.gitignore Ignores vim temporary files from git 2023-12-23 17:45:32 +08:00
OWNERS Move the owner of xfrm netlink source code to its own directory. 2023-11-22 18:50:00 +09:00
OWNERS_core_networking OWNERS: satk -> larsberg 2025-08-04 11:26:01 -07:00
OWNERS_core_networking_xts OWNERS: satk -> larsberg 2025-08-04 11:26:02 -07:00
PREUPLOAD.cfg Add alint hook to Connectivity repo 2025-05-30 11:36:49 +00:00
preupload_hook_script.py Refactor: apply pyformat for coding style consistency 2025-05-28 12:44:57 +00:00
rustfmt.toml Add rustfmt to p/m/C 2025-03-28 10:06:13 -07:00
TEST_MAPPING Add Wear TEST_MAPPING for Connectivity module 2025-07-15 23:05:13 -07:00