27 Mart 2025'ten itibaren AOSP'yi derlemek ve AOSP'ye katkıda bulunmak için aosp-main
yerine android-latest-release
kullanmanızı öneririz. Daha fazla bilgi için AOSP'de yapılan değişiklikler başlıklı makaleyi inceleyin.
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
memtrack_module Yapı Referansı
#include <
memtrack.h
>
Her donanım modülünde HAL_MODULE_INFO_SYM adlı bir veri yapısı olmalıdır ve bu veri yapısının alanları,
hw_module_t
ile başlamalı ve ardından modüle özgü bilgiler gelmelidir.
memtrack.h
dosyasının
120
satırı
(*getMemory)(), bir kayıt nesnesi dizisi bekler ve *num_record yapılarına bellek boyutlarının yanı sıra bu bellekle ilişkili işaretleri doldurur. Ayrıca, *num_records parametresi iletildiği sırada yeterince büyükse döndürebileceği toplam kayıt sayısıyla *num_records parametresini günceller. 0 boyutunda kayıt döndürülmesi beklenir. Kayıt sayısı, farklı pid'ler için bile aynı bellek türündeki getMemory çağrıları arasında değişmemelidir.
Arayan, ne kadar yer ayıracağını belirlemek için genellikle bir tür ve pid için *num_records == 0 ile getMemory'yi çağırır. Bu durum, HAL'de sabit bir değer döndüren ve herhangi bir çekirdek dosyası sorgulamayan hızlı bir yol olmalıdır. İletilen *num_records değeri 0 ise kayıtlar NULL olabilir.
Bu işlev, aynı anda birden fazla iş parçacığında çağrılabileceği için iş parçacığı güvenliğine sahip olmalıdır.
Başarılı olduğunda 0, tür desteklenmiyorsa -ENODEV, diğer hatalarda -errno döndürür.
memtrack.h
dosyasının
151. satırı
için tanımı
(*init)(), memtrack yönetim ayarlama işlemlerini gerçekleştirir ve
getMemory()
çağrılarından önce bir kez çağrılır. Başarılı olduğunda 0, hata olduğunda -errno değerini döndürür.
Tanımı,
memtrack.h
dosyasının
128
satırı
Bu yapının dokümanları aşağıdaki dosyadan oluşturulmuştur:
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-27 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-27 UTC."],[],[],null,["# Android Hardware Abstraction Layer: memtrack_module Struct Reference\n\nmemtrack_module Struct Reference\n================================\n\n[Data Fields](#pub-attribs) \nmemtrack_module Struct Reference \n\n`\n#include \u003c\n`[memtrack.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)`\n\u003e\n`\n\n|----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [hw_module_t](/reference/hal/structhw__module__t) | [common](/reference/hal/structmemtrack__module#a71ea01183b3998cad6a2301a37a42fc7) |\n| ||\n| int(\\* | [init](/reference/hal/structmemtrack__module#a44c48f5b685ba133e81237bf65fb77f3) )(const struct [memtrack_module](/reference/hal/structmemtrack__module) \\*module) |\n| ||\n| int(\\* | [getMemory](/reference/hal/structmemtrack__module#ad6da70db99b91b8e08eaff8f4500064a) )(const struct [memtrack_module](/reference/hal/structmemtrack__module) \\*module, pid_t pid, int type, struct [memtrack_record](/reference/hal/structmemtrack__record) \\*records, size_t \\*num_records) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nEvery hardware module must have a data structure named HAL_MODULE_INFO_SYM and the fields of this data structure must begin with\n[hw_module_t](/reference/hal/structhw__module__t)\nfollowed by module specific information.\n\n\nDefinition at line\n[120](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)\nof file\n[memtrack.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------------------------------------------------|\n| struct [hw_module_t](/reference/hal/structhw__module__t) common |\n\n\nDefinition at line\n[121](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)\nof file\n[memtrack.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)\n.\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* getMemory)(const struct [memtrack_module](/reference/hal/structmemtrack__module) \\*module, pid_t pid, int type, struct [memtrack_record](/reference/hal/structmemtrack__record) \\*records, size_t \\*num_records) |\n\n\n(\\*getMemory)() expects an array of record objects and populates up to \\*num_record structures with the sizes of memory plus associated flags for that memory. It also updates \\*num_records with the total number of records it could return if \\*num_records was large enough when passed in. Returning records with size 0 is expected, the number of records should not vary between calls to getMemory for the same memory type, even for different pids.\n\n\nThe caller will often call getMemory for a type and pid with \\*num_records == 0 to determine how many records to allocate room for, this case should be a fast-path in the HAL, returning a constant and not querying any kernel files. If \\*num_records passed in is 0, then records may be NULL.\n\n\nThis function must be thread-safe, it may get called from multiple threads at the same time.\n\n\nReturns 0 on success, -ENODEV if the type is not supported, -errno on other errors.\n\n\nDefinition at line\n[151](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)\nof file\n[memtrack.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)\n.\n\n|----------------------------------------------------------------------------------------------|\n| int(\\* init)(const struct [memtrack_module](/reference/hal/structmemtrack__module) \\*module) |\n\n\n(\\*init)() performs memtrack management setup actions and is called once before any calls to\n[getMemory()](/reference/hal/structmemtrack__module#ad6da70db99b91b8e08eaff8f4500064a)\n. Returns 0 on success, -errno on error.\n\n\nDefinition at line\n[128](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)\nof file\n[memtrack.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [memtrack.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/memtrack.h)"]]