[gimp/gimp-2-10] app: a few fixes to performance-log backtrace output
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: a few fixes to performance-log backtrace output
- Date: Wed, 7 Nov 2018 19:27:02 +0000 (UTC)
commit 645e30e641b3b5361a68b079cacc7a4d6a136161
Author: Ell <ell_se yahoo com>
Date: Wed Nov 7 13:55:19 2018 -0500
app: a few fixes to performance-log backtrace output
Fix delta-encoding of performance-log backtraces in certain cases,
and distinguish between empty call-stacks and removed threads.
(cherry picked from commit eec1e1f189af93154207b20fa258d8f155aa9099)
app/widgets/gimpdashboard.c | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
---
diff --git a/app/widgets/gimpdashboard.c b/app/widgets/gimpdashboard.c
index 031adce063..677e2ea014 100644
--- a/app/widgets/gimpdashboard.c
+++ b/app/widgets/gimpdashboard.c
@@ -3617,17 +3617,19 @@ gimp_dashboard_log_sample (GimpDashboard *dashboard,
{
guintptr thread_id;
const gchar *thread_name;
- gint last_running = -1;
+ gint last_running = -1;
gint running;
+ gint last_n_frames = -1;
gint n_frames;
- gint n_head = 0;
- gint n_tail = 0;
+ gint n_head = 0;
+ gint n_tail = 0;
gint frame;
- thread_id = gimp_backtrace_get_thread_id (backtrace, thread);
- thread_name = gimp_backtrace_get_thread_name (backtrace, thread);
+ thread_id = gimp_backtrace_get_thread_id (backtrace, thread);
+ thread_name = gimp_backtrace_get_thread_name (backtrace, thread);
- n_frames = gimp_backtrace_get_n_frames (backtrace, thread);
+ running = gimp_backtrace_is_thread_running (backtrace, thread);
+ n_frames = gimp_backtrace_get_n_frames (backtrace, thread);
if (priv->log_backtrace)
{
@@ -3639,12 +3641,12 @@ gimp_dashboard_log_sample (GimpDashboard *dashboard,
gint n;
gint i;
- last_running = gimp_backtrace_is_thread_running (
+ last_running = gimp_backtrace_is_thread_running (
+ priv->log_backtrace, other_thread);
+ last_n_frames = gimp_backtrace_get_n_frames (
priv->log_backtrace, other_thread);
- n = gimp_backtrace_get_n_frames (priv->log_backtrace,
- other_thread);
- n = MIN (n, n_frames);
+ n = MIN (n_frames, last_n_frames);
for (i = 0; i < n; i++)
{
@@ -3675,10 +3677,12 @@ gimp_dashboard_log_sample (GimpDashboard *dashboard,
}
}
- running = gimp_backtrace_is_thread_running (backtrace, thread);
-
- if (running == last_running && n_head + n_tail == n_frames)
- continue;
+ if (running == last_running &&
+ n_frames == last_n_frames &&
+ n_head + n_tail == n_frames)
+ {
+ continue;
+ }
BACKTRACE_NONEMPTY ();
@@ -3713,7 +3717,7 @@ gimp_dashboard_log_sample (GimpDashboard *dashboard,
n_tail);
}
- if (n_head + n_tail < n_frames)
+ if (n_frames == 0 || n_head + n_tail < n_frames)
{
gimp_dashboard_log_printf (dashboard,
">\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]