(pid uint32)
| 121 | } |
| 122 | |
| 123 | func FindLibPaths(pid uint32) ([]string, error) { |
| 124 | var search_paths []string |
| 125 | pid_maps, err := maps_helper.FindLib(pid) |
| 126 | if err != nil { |
| 127 | return search_paths, err |
| 128 | } |
| 129 | for seg_path, _ := range pid_maps { |
| 130 | if strings.HasPrefix(seg_path, "/") && strings.HasSuffix(seg_path, ".so") { |
| 131 | items := strings.Split(seg_path, "/") |
| 132 | lib_search_path := strings.Join(items[:len(items)-1], "/") |
| 133 | if !slices.Contains(search_paths, lib_search_path) { |
| 134 | search_paths = append(search_paths, lib_search_path) |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | return search_paths, nil |
| 139 | } |
| 140 | |
| 141 | func (this *MapsHelper) UpdateForkEvent(event *ForkEvent) { |
| 142 | // 根据日志实际的记录结果 fork 的 pid ppid 存在相同的情况 why |
no test coverage detected