You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
# Release notes
2
2
3
+
## 2023.1.0 (2023-1-20)
4
+
5
+
### Bugfixes
6
+
7
+
- Fix regression where source code would sometimes be missing from flamegraphs, most notably in Jupyter profiling. ([#474](https://github.com/pythonspeed/filprofiler/issues/474))
// In order to render the flamegraph, we want to load source code using
210
+
// Python's linecache. That means calling into Python, which might release
211
+
// the GIL, allowing another thread to run, and it will try to allocation
212
+
// and hit the TRACKER_STATE mutex. And now we're deadlocked. So we make
213
+
// sure flamegraph rendering does not require TRACKER_STATE to be locked.
214
+
let(allocated_bytes, flamegraph_callstacks) = {
215
+
letmut tracker_state = TRACKER_STATE.lock();
216
+
let allocations = &mut tracker_state.allocations;
217
+
218
+
// Print warning if we're missing allocations.
219
+
allocations.warn_on_problems(peak);
220
+
let allocated_bytes = if peak {
221
+
allocations.get_peak_allocated_bytes()
222
+
}else{
223
+
allocations.get_current_allocated_bytes()
224
+
};
225
+
let flamegraph_callstacks = allocations.combine_callstacks(peak,IdentityCleaner);
226
+
(allocated_bytes, flamegraph_callstacks)
227
+
};
228
+
229
+
eprintln!("=fil-profile= Preparing to write to {}", path);
230
+
let directory_path = Path::new(path);
231
+
232
+
let title = format!(
233
+
"{} ({:.1} MiB)",
234
+
title,
235
+
allocated_bytes asf64 / (1024.0*1024.0)
236
+
);
237
+
let subtitle = r#"Made with the Fil profiler. <a href="https://pythonspeed.com/fil/" style="text-decoration: underline;" target="_parent">Try it on your code!</a>"#;
238
+
flamegraph_callstacks.write_flamegraphs(
239
+
directory_path,
240
+
base_filename,
241
+
&title,
242
+
subtitle,
243
+
"bytes",
244
+
to_be_post_processed,
245
+
)
246
+
}
247
+
183
248
/// Dump all callstacks in peak memory usage to format used by flamegraph.
0 commit comments