xref: /aosp_15_r20/system/extras/memory_replay/traces/README (revision 288bf5226967eb3dac5cce6c939ccc2a7f2b4fe5)
1*288bf522SAndroid Build Coastguard WorkerThe files in this directory are a collection of recordings of
2*288bf522SAndroid Build Coastguard Workerthe memory allocations of a set of apps.
3*288bf522SAndroid Build Coastguard Worker
4*288bf522SAndroid Build Coastguard WorkerIn order to run these files through the tool, they will need to be placed
5*288bf522SAndroid Build Coastguard Workerunzipped on the device.
6*288bf522SAndroid Build Coastguard Worker
7*288bf522SAndroid Build Coastguard WorkerFormat of dumps:
8*288bf522SAndroid Build Coastguard Worker
9*288bf522SAndroid Build Coastguard Worker<tid>: <action_name> <ptr> [<optional_arguments>]
10*288bf522SAndroid Build Coastguard Worker
11*288bf522SAndroid Build Coastguard Worker<tid>
12*288bf522SAndroid Build Coastguard Worker  The pid_t value that is the gettid() value recorded during the run.
13*288bf522SAndroid Build Coastguard Worker
14*288bf522SAndroid Build Coastguard Worker<action_name>
15*288bf522SAndroid Build Coastguard Worker  One of:
16*288bf522SAndroid Build Coastguard Worker    malloc - Allocate memory using the malloc function.
17*288bf522SAndroid Build Coastguard Worker    calloc - Allocate memory using the calloc function.
18*288bf522SAndroid Build Coastguard Worker    memalign - Allocate memory using the memalign function. This is used
19*288bf522SAndroid Build Coastguard Worker               during recording for either memalign or posix_memalign.
20*288bf522SAndroid Build Coastguard Worker    realloc - Allocate memory using the realloc function.
21*288bf522SAndroid Build Coastguard Worker    free - Free memory allocated using one of the above actions.
22*288bf522SAndroid Build Coastguard Worker    thread_done - Terminate the thread with the given tid.
23*288bf522SAndroid Build Coastguard Worker
24*288bf522SAndroid Build Coastguard WorkerFormat of each action:
25*288bf522SAndroid Build Coastguard Worker
26*288bf522SAndroid Build Coastguard Worker<tid>: malloc <ptr> <size>
27*288bf522SAndroid Build Coastguard Worker Allocation made by malloc(<size>).  <ptr> is the value returned by malloc.
28*288bf522SAndroid Build Coastguard Worker
29*288bf522SAndroid Build Coastguard WorkerExample:
30*288bf522SAndroid Build Coastguard Worker
31*288bf522SAndroid Build Coastguard Worker100: malloc 0xb48390a0 48
32*288bf522SAndroid Build Coastguard Worker
33*288bf522SAndroid Build Coastguard Worker<tid>: calloc <ptr> <nmemb> <size>
34*288bf522SAndroid Build Coastguard Worker  Allocation made by calloc(<nmemb>, <size>. <ptr> is the value returned
35*288bf522SAndroid Build Coastguard Worker  by calloc.
36*288bf522SAndroid Build Coastguard Worker
37*288bf522SAndroid Build Coastguard WorkerExample:
38*288bf522SAndroid Build Coastguard Worker
39*288bf522SAndroid Build Coastguard Worker200: calloc 0xb48c1100 32 8
40*288bf522SAndroid Build Coastguard Worker
41*288bf522SAndroid Build Coastguard Worker<tid>:realloc <new_ptr> <old_ptr> <size>
42*288bf522SAndroid Build Coastguard Worker  Allocation made by realloc(<old_ptr>, <size>). <old_ptr> can be 0x0
43*288bf522SAndroid Build Coastguard Worker  to indicate a realloc with a nullptr. <new_ptr> is the value returned
44*288bf522SAndroid Build Coastguard Worker  by realloc.
45*288bf522SAndroid Build Coastguard Worker
46*288bf522SAndroid Build Coastguard WorkerExample:
47*288bf522SAndroid Build Coastguard Worker
48*288bf522SAndroid Build Coastguard Worker300: realloc 0x96b90920 0x93605280 150
49*288bf522SAndroid Build Coastguard Worker
50*288bf522SAndroid Build Coastguard Worker<tid>:memalign <ptr> <alignment> <size>
51*288bf522SAndroid Build Coastguard Worker  Allocation made by memalign(<alignment>, <size>). <ptr> is the value
52*288bf522SAndroid Build Coastguard Worker  returned by memalign.
53*288bf522SAndroid Build Coastguard Worker
54*288bf522SAndroid Build Coastguard WorkerExample:
55*288bf522SAndroid Build Coastguard Worker
56*288bf522SAndroid Build Coastguard Worker400: memalign 0xae42d080 16 104
57*288bf522SAndroid Build Coastguard Worker
58*288bf522SAndroid Build Coastguard Worker<tid>: free <ptr>
59*288bf522SAndroid Build Coastguard Worker  Find a previously allocated pointer <ptr> and call free(<ptr>).
60*288bf522SAndroid Build Coastguard Worker  <ptr> can be 0x0 to indicate the freeing of a nullptr.
61*288bf522SAndroid Build Coastguard Worker
62*288bf522SAndroid Build Coastguard WorkerExample:
63*288bf522SAndroid Build Coastguard Worker
64*288bf522SAndroid Build Coastguard Worker500: free 0xb4827400
65*288bf522SAndroid Build Coastguard Worker
66*288bf522SAndroid Build Coastguard Worker<tid>: thread_done 0x0
67*288bf522SAndroid Build Coastguard Worker  Indicates that the thread <tid> has completed.
68*288bf522SAndroid Build Coastguard Worker
69*288bf522SAndroid Build Coastguard WorkerExample:
70*288bf522SAndroid Build Coastguard Worker
71*288bf522SAndroid Build Coastguard Worker600: thread_done 0x0
72