mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
Merge main (67b82ad9) into feat/bionic-runtime
No conflicts. EnhancedSessionLogShare.kt keeps main's RPCS3 log entries (#3130) next to this branch's bionic ones; SessionService.kt changes are apart. (The previous sync,cc5de0ba, merged main at7c8f5c27, notc298da6fas its message says.)
This commit is contained in:
commit
fbed69cef9
57 files changed
+1054
-99
No files matched your search
@@ -0,0 +1,39 @@
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
PRELOAD = Path(__file__).resolve().parents[1] / "linuxfs/preload"
|
||||
LIMIT = 1024
|
||||
WRAPPERS = {
|
||||
"descriptor.c": ("dd_descriptor_unlink", "dd_descriptor_rmdir", "dd_descriptor_remove", "dd_descriptor_rename"),
|
||||
"tracer.c": ("dd_status_without_tracer",),
|
||||
}
|
||||
|
||||
|
||||
def frames(source, build):
|
||||
obj = build / (source + ".o")
|
||||
subprocess.run(["cc", "-c", "-fPIC", "-O2", "-Wall", "-fstack-usage", "-o", str(obj), str(PRELOAD / source)],
|
||||
check=True)
|
||||
sizes = {}
|
||||
for line in obj.with_suffix(".su").read_text().splitlines():
|
||||
place, size, _ = line.split("\t")
|
||||
sizes[place.rsplit(":", 1)[-1]] = int(size)
|
||||
return sizes
|
||||
|
||||
|
||||
@unittest.skipUnless(shutil.which("cc"), "needs a C compiler")
|
||||
class PreloadWrapperStackTest(unittest.TestCase):
|
||||
def test_wrappers_keep_path_buffers_off_their_frames(self):
|
||||
with tempfile.TemporaryDirectory() as build:
|
||||
for source, names in WRAPPERS.items():
|
||||
sizes = frames(source, Path(build))
|
||||
for name in names:
|
||||
with self.subTest(function=name):
|
||||
self.assertIn(name, sizes)
|
||||
self.assertLess(sizes[name], LIMIT)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user