החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
בדיקות מדדים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בדרך כלל משתמשים בבדיקות מדדים כדי לבדוק שכבות הפשטה של חומרה (HAL) או כדי ליצור אינטראקציה ישירה עם שירותי מערכת ברמה נמוכה יותר. כדי להשתמש בשירות של בדיקות רציפות, צריך ליצור בדיקות של מדדים באמצעות המסגרת google-benchmark.
דוגמה
הגדרה לדוגמה של מודול בדיקת מדדים זמינה בכתובת:
bionic/benchmarks/bionic-benchmarks
סיכום השלבים
- קובץ התצורה של מודול הבדיקה צריך להשתמש בכלל ה-build
BUILD_NATIVE_BENCHMARK
כדי שיחסי התלות של google-benchmark ייכללו באופן אוטומטי.
יוצרים את מודול הבדיקה באמצעות make:
make -j40 bionic-benchmarks
התקנה והפעלה אוטומטיות באמצעות ערכת הבדיקות של Trade Federation:
make tradefed-all -j
tradefed.sh run template/local_min --template:map test=bionic-benchmarks
כדי להתקין ולהפעיל את הקוד באופן ידני:
מעבירים את קובץ ה-binary של הבדיקה שנוצר למכשיר:
adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \
/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
מריצים את הבדיקה על ידי הפעלת קובץ ה-binary של הבדיקה במכשיר:
adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# Metric tests are typically used for exercising hardware abstraction\nlayers (HALs) or interacting directly with lower-level system services. To\nleverage continuous testing service, metric tests should be built with\nthe [google-benchmark](https://github.com/google/benchmark)\nframework.\n\nExample\n-------\n\nSee a sample metric test module setup at:\n[bionic/benchmarks/bionic-benchmarks](https://android.googlesource.com/platform/bionic/+/android16-release/benchmarks/bionic_benchmarks.cpp)\n\nSummary of steps\n----------------\n\n1. Test module configuration file should use the `BUILD_NATIVE_BENCHMARK` build rule so that google-benchmark dependencies are included automatically.\n2. Build the test module with make:\n\n make -j40 bionic-benchmarks\n\n3. Automatic installation and run with the Trade Federation test harness:\n\n make tradefed-all -j\n tradefed.sh run template/local_min --template:map test=bionic-benchmarks\n\n4. Manually install and run like so:\n\n 1. Push the generated test binary onto device:\n\n adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \\\n /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32\n\n 2. Execute the test by invoking test binary on device:\n\n adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32"]]