Skip to content

Commit faeef3e

Browse files
committed
Bugfix for binder, page_owner and slub
Signed-off-by: quic_chahuan <[email protected]>
1 parent 04ed19c commit faeef3e

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

USAGE.md

+15
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,21 @@ PID Vss Rss Pss Uss Swap Comm
253253
2865 1021.14MB 34.44MB 1.68MB 0B 25.35MB com.qti.diagservices
254254
2292 1017.32MB 33.75MB 1.64MB 0B 25.34MB com.qualcomm.qti.aonutility
255255
```
256+
257+
### procrank -c
258+
```
259+
crash> mod -s zram ./lib/zram.ko
260+
MODULE NAME BASE SIZE OBJECT FILE
261+
ffffffd4d3758440 zram ffffffd4d3752000 49152 ./lib/zram.ko
262+
crash> mod -s zsmalloc ./lib/zsmalloc.ko
263+
MODULE NAME BASE SIZE OBJECT FILE
264+
ffffffd4d34c6200 zsmalloc ffffffd4d34bf000 57344 ./lib/zsmalloc.ko
265+
266+
crash> procrank -c
267+
PID Comm Cmdline
268+
1 init /system/bin/init
269+
```
270+
256271
## vmalloc
257272
This command dumps the vmalloc info.
258273

memory/slub.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,18 @@ void Slub::parser_slab_caches(){
351351
cache_list.clear();
352352
if (csymbol_exists("depot_index")){
353353
depot_index = read_int(csymbol_value("depot_index"),"depot_index");
354-
}else if (csymbol_exists("pool_index")){
354+
} else if (csymbol_exists("pool_index")){
355355
depot_index = read_int(csymbol_value("pool_index"),"pool_index");
356+
} else if(csymbol_exists("pools_num")){ /* 6.12 and later */
357+
depot_index = read_int(csymbol_value("pools_num"), "pools_num");
356358
}
357359
if (!depot_index){
358360
fprintf(fp, "cannot get depot_index\n");
359361
return;
360362
}
361363
if (csymbol_exists("stack_slabs")){
362364
stack_slabs = csymbol_value("stack_slabs");
363-
}else if (csymbol_exists("stack_pools")){/* 6.3 and later */
365+
} else if (csymbol_exists("stack_pools")){/* 6.3 and later */
364366
stack_slabs = csymbol_value("stack_pools");
365367
}
366368
if (!stack_slabs){

pageowner/pageowner.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ bool Pageowner::is_enable_pageowner(){
7575
return false;
7676
}
7777
int inited;
78+
// see set_page_owner in page_owner.h
7879
try_get_symbol_data(TO_CONST_STRING("page_owner_inited"), sizeof(int), &inited);
7980
if (inited != 1){
80-
fprintf(fp, "cannot find page_owner_inited\n");
81+
fprintf(fp, "page_owner is disabled, pls check the page_owner=on in cmdline\n");
8182
return false;
8283
}
8384
return true;
@@ -667,6 +668,8 @@ void Pageowner::parser_all_pageowners(){
667668
depot_index = read_int(csymbol_value("depot_index"),"depot_index");
668669
}else if (csymbol_exists("pool_index")){
669670
depot_index = read_int(csymbol_value("pool_index"),"pool_index");
671+
} else if(csymbol_exists("pools_num")){
672+
depot_index = read_int(csymbol_value("pools_num"), "pools_num");
670673
}
671674
if (csymbol_exists("stack_slabs")){
672675
stack_slabs = csymbol_value("stack_slabs");

plugin.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ std::vector<ulong> PaserPlugin::for_each_rbtree(ulong rb_root,int offset){
261261
retrieve_list(treeList, cnt);
262262
for (int i = 0; i < cnt; ++i) {
263263
if (!is_kvaddr(treeList[i]))continue;
264-
// LOGI("node addr:%lx\n",treeList[i]);
265264
treeList[i] -= td.node_member_offset;
266265
res.push_back(treeList[i]);
267266
}
@@ -284,6 +283,12 @@ std::vector<ulong> PaserPlugin::for_each_list(ulong list_head,int offset){
284283
struct list_data ld;
285284
BZERO(&ld, sizeof(struct list_data));
286285
ld.flags |= LIST_ALLOCATE;
286+
/*
287+
case : invalid list entry: 4000000000000000
288+
readflag = ld->flags & RETURN_ON_LIST_ERROR ? (RETURN_ON_ERROR|QUIET) : FAULT_ON_ERROR; in tools.c
289+
Even if the list is incomplete, we should ensure that the existing elements can be used normally.
290+
*/
291+
// ld.flags |= RETURN_ON_LIST_ERROR;
287292
readmem(list_head, KVADDR, &ld.start,sizeof(ulong), TO_CONST_STRING("for_each_list list_head"), FAULT_ON_ERROR);
288293
ld.end = list_head;
289294
// ld.member_offset = offset;

0 commit comments

Comments
 (0)