aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/hist.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-02-04 10:33:19 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-07-12 12:54:18 -0400
commitbe0e6d105d31a5818608ae243411aef5c976147a (patch)
tree75fab8aaefdb07c5ff464daa1f966bdd97a96135 /tools/perf/ui/hist.c
parent5f3f8d3b1207cba3664d57a33de43f5ee11c8a06 (diff)
perf tools: Move hist_entry__period_snprintf into stdio code
Moving hist_entry__period_snprintf function into stdio code and making it static, as it's no longer used anywhere else. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-ah8ms343h8xygt20iqz91kz4@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/hist.c')
-rw-r--r--tools/perf/ui/hist.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index dc900d7a190e..0a193281eba8 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -236,46 +236,6 @@ void perf_hpp__column_enable(unsigned col)
236 perf_hpp__column_register(&perf_hpp__format[col]); 236 perf_hpp__column_register(&perf_hpp__format[col]);
237} 237}
238 238
239static inline void advance_hpp(struct perf_hpp *hpp, int inc)
240{
241 hpp->buf += inc;
242 hpp->size -= inc;
243}
244
245int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he,
246 bool color)
247{
248 const char *sep = symbol_conf.field_sep;
249 struct perf_hpp_fmt *fmt;
250 char *start = hpp->buf;
251 int ret;
252 bool first = true;
253
254 if (symbol_conf.exclude_other && !he->parent)
255 return 0;
256
257 perf_hpp__for_each_format(fmt) {
258 /*
259 * If there's no field_sep, we still need
260 * to display initial ' '.
261 */
262 if (!sep || !first) {
263 ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " ");
264 advance_hpp(hpp, ret);
265 } else
266 first = false;
267
268 if (color && fmt->color)
269 ret = fmt->color(fmt, hpp, he);
270 else
271 ret = fmt->entry(fmt, hpp, he);
272
273 advance_hpp(hpp, ret);
274 }
275
276 return hpp->buf - start;
277}
278
279int hist_entry__sort_snprintf(struct hist_entry *he, char *s, size_t size, 239int hist_entry__sort_snprintf(struct hist_entry *he, char *s, size_t size,
280 struct hists *hists) 240 struct hists *hists)
281{ 241{