6b1ca21
From 755b5f5715c117f4723ec04a81a46da85c9179a3 Mon Sep 17 00:00:00 2001
6b1ca21
From: Jiri Olsa <jolsa@redhat.com>
6b1ca21
Date: Sat, 20 Oct 2012 22:14:10 +0200
6b1ca21
Subject: [PATCH] perf hists: Fix period symbol_conf.field_sep display
6b1ca21
6b1ca21
Upstream commit c0d246b85fc7d42688d7a5d999ea671777caf65b
6b1ca21
6b1ca21
Currently we don't properly display hist data with symbol_conf.field_sep
6b1ca21
separator. We need to display either space or separator.
6b1ca21
6b1ca21
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
6b1ca21
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
6b1ca21
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
6b1ca21
Cc: Ingo Molnar <mingo@elte.hu>
6b1ca21
Cc: Paul Mackerras <paulus@samba.org>
6b1ca21
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
6b1ca21
Cc: Frederic Weisbecker <fweisbec@gmail.com>
6b1ca21
Cc: Namhyung Kim <namhyung@kernel.org>
6b1ca21
Link: http://lkml.kernel.org/n/tip-cyggwys0bz5kqdowwvfd8h72@git.kernel.org
6b1ca21
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
6b1ca21
---
6b1ca21
 tools/perf/ui/hist.c | 6 +++++-
6b1ca21
 1 file changed, 5 insertions(+), 1 deletion(-)
6b1ca21
6b1ca21
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
6b1ca21
index f5a1e4f..947e20a 100644
6b1ca21
--- a/tools/perf/ui/hist.c
6b1ca21
+++ b/tools/perf/ui/hist.c
6b1ca21
@@ -363,11 +363,15 @@ int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he,
6b1ca21
 		if (!perf_hpp__format[i].cond)
6b1ca21
 			continue;
6b1ca21
 
6b1ca21
+		/*
6b1ca21
+		 * If there's no field_sep, we still need
6b1ca21
+		 * to display initial '  '.
6b1ca21
+		 */
6b1ca21
 		if (!sep || !first) {
6b1ca21
 			ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: "  ");
6b1ca21
 			advance_hpp(hpp, ret);
6b1ca21
+		} else
6b1ca21
 			first = false;
6b1ca21
-		}
6b1ca21
 
6b1ca21
 		if (color && perf_hpp__format[i].color)
6b1ca21
 			ret = perf_hpp__format[i].color(hpp, he);
6b1ca21
-- 
6b1ca21
1.8.1.2
6b1ca21