From 1702eb3ab011b354ae914e60386ea85903257a23 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 31 Jan 2013 10:34:41 +1100 Subject: 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 Signed-off-by: Dirk Hohndel --- profile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'profile.c') 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); } -- cgit v1.2.3-70-g09d2