Skip to content

Commit 6d59e33

Browse files
Fix the bug to consistently spot indirect calls on x86 - VROOM-7765
1 parent 94080db commit 6d59e33

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

conf.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"Symbol":"__arm64_sys_getppid",
88
"Instance":1,
99
"Mode":4,
10-
"Excluded": [],
10+
"Excluded_before": [],
11+
"Excluded_after": [".*rcu.*"],
1112
"Target_sybsys":[],
1213
"MaxDepth":1,
1314
"Jout": "TextPlain"

psql.go

+10-5
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,13 @@ func removeDuplicate(list []Entry) []Entry {
203203

204204
// Given a function returns the lager subsystem it belongs
205205
func get_subsys_from_symbol_name(db *sql.DB, symbol string, instance int, subsytems_cache map[string]string)(string, error){
206-
var res string
206+
var ty,sub string
207207

208208
if res, ok := subsytems_cache[symbol]; ok {
209209
return res, nil
210210
}
211-
query:="select subsys_name from (select count(*)as cnt, subsys_name from tags where subsys_name in (select subsys_name from symbols, "+
211+
query:="select (select symbol_type from symbols where symbol_name=$1) as type, subsys_name from "+
212+
"(select count(*) as cnt, subsys_name from tags where subsys_name in (select subsys_name from symbols, "+
212213
"tags where symbols.symbol_file_ref_id=tags.tag_file_ref_id and symbols.symbol_name=$1 and symbols.symbol_instance_id_ref=$2) "+
213214
"group by subsys_name order by cnt desc) as tbl;"
214215

@@ -219,13 +220,17 @@ func get_subsys_from_symbol_name(db *sql.DB, symbol string, instance int, subsyt
219220
defer rows.Close()
220221

221222
for rows.Next() {
222-
if err := rows.Scan(&res); err != nil {
223+
if err := rows.Scan(&ty,&sub); err != nil {
223224
fmt.Println("this error hit1 ")
224225
return "", err
225226
}
226227
}
227-
subsytems_cache[symbol]=res
228-
return res, nil
228+
229+
if ty== "indirect" {
230+
sub=ty
231+
}
232+
subsytems_cache[symbol]=sub
233+
return sub, nil
229234
}
230235

231236
// Returns the id of a given function name

0 commit comments

Comments
 (0)