|
@@ -308,6 +308,47 @@ static size_t hist_entry__callchain_fprintf(struct hist_entry *he,
|
|
|
return hist_entry_callchain__fprintf(he, total_period, left_margin, fp);
|
|
|
}
|
|
|
|
|
|
+static inline void advance_hpp(struct perf_hpp *hpp, int inc)
|
|
|
+{
|
|
|
+ hpp->buf += inc;
|
|
|
+ hpp->size -= inc;
|
|
|
+}
|
|
|
+
|
|
|
+static int hist_entry__period_snprintf(struct perf_hpp *hpp,
|
|
|
+ struct hist_entry *he,
|
|
|
+ bool color)
|
|
|
+{
|
|
|
+ const char *sep = symbol_conf.field_sep;
|
|
|
+ struct perf_hpp_fmt *fmt;
|
|
|
+ char *start = hpp->buf;
|
|
|
+ int ret;
|
|
|
+ bool first = true;
|
|
|
+
|
|
|
+ if (symbol_conf.exclude_other && !he->parent)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ perf_hpp__for_each_format(fmt) {
|
|
|
+ /*
|
|
|
+ * If there's no field_sep, we still need
|
|
|
+ * to display initial ' '.
|
|
|
+ */
|
|
|
+ if (!sep || !first) {
|
|
|
+ ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " ");
|
|
|
+ advance_hpp(hpp, ret);
|
|
|
+ } else
|
|
|
+ first = false;
|
|
|
+
|
|
|
+ if (color && fmt->color)
|
|
|
+ ret = fmt->color(fmt, hpp, he);
|
|
|
+ else
|
|
|
+ ret = fmt->entry(fmt, hpp, he);
|
|
|
+
|
|
|
+ advance_hpp(hpp, ret);
|
|
|
+ }
|
|
|
+
|
|
|
+ return hpp->buf - start;
|
|
|
+}
|
|
|
+
|
|
|
static int hist_entry__fprintf(struct hist_entry *he, size_t size,
|
|
|
struct hists *hists, FILE *fp)
|
|
|
{
|