diff --git a/parse_peak_so.py b/parse_peak_so.py index 1480644a83b24700778665a06b78c3147416052c..e3b92db2a86aabb08e36fe8c26f80f50c67a7044 100644 --- a/parse_peak_so.py +++ b/parse_peak_so.py @@ -21,6 +21,7 @@ RELEASE = "0" ROW_KEY = "row" TOTAL_MEM_KEY = "total_mem" PROGRESS_BAR_CHUNK = 50000 +LIBJEMALLOC = "libjemalloc.so" def time_cost(func): """A decorator that calculates the time cost of a function.""" @@ -95,7 +96,7 @@ def extract_line_info(line): op_type = frame_arr[0].strip() addr = frame_arr[1].strip().replace("\n", "") size = int(frame_arr[2].strip()) - frames = [frame_arr[4]] + frames = frame_arr[4:] return op_type, addr, size, frames @@ -205,9 +206,10 @@ def convert_frame_to_so(lines, library_map_path, worker_number): continue so_path = frame_to_library[mem_range] - frame_to_so[frame] = so_path - last_frame_row.append(so_path) - break + if so_path and LIBJEMALLOC not in so_path: + frame_to_so[frame] = so_path + last_frame_row.append(so_path) + break first_frame_rows.append(tuple(last_frame_row)) return first_frame_rows