summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-01-31 10:34:41 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 11:11:30 +1100
commit1702eb3ab011b354ae914e60386ea85903257a23 (patch)
tree53911c24daec306dc49a7977c10f6094c2311491 /profile.c
parent9099972c20a49a96a0abac2ff2c4b163b59c6883 (diff)
downloadsubsurface-1702eb3ab011b354ae914e60386ea85903257a23.tar.gz
Add the begin/end markers to events with the proper flags
When we create the event names, the name itself does not include the information about whether the event is the beginning or end of some state, so we end up having things like events named "deco" and then in the event flags it says whether this is the *beginning* of deco, or the end. And when we show the event, we only used to show the name. This patch makes us show whether it's the begin or end event for events that have those flags. So now you see "deco begin" and "deco end" instead of just two events both called "deco". It would perhaps be nice if we somehow showed the range between the events too, and paired them up visually some way, but that's a separate and much more difficult thing to do. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index ce3dd81e3..bb55f5b15 100644
--- a/profile.c
+++ b/profile.c
@@ -400,7 +400,9 @@ static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, st
snprintf(buffer, sizeof(buffer), "%s: %d", _(event->name), event->value);
}
} else {
- snprintf(buffer, sizeof(buffer), "%s", _(event->name));
+ snprintf(buffer, sizeof(buffer), "%s%s", _(event->name),
+ event->flags == SAMPLE_FLAGS_BEGIN ? " begin" :
+ event->flags == SAMPLE_FLAGS_END ? " end" : "");
}
attach_tooltip(x-15, y-6, 12, 12, buffer);
}