aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r--tools/perf/util/hist.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 6f505d1abac7..e11e482bd185 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -768,7 +768,7 @@ static int hist_entry__pcnt_snprintf(struct hist_entry *he, char *s,
768 sep ? "%.2f" : " %6.2f%%", 768 sep ? "%.2f" : " %6.2f%%",
769 (period * 100.0) / total); 769 (period * 100.0) / total);
770 else 770 else
771 ret = snprintf(s, size, sep ? "%.2f" : " %6.2f%%", 771 ret = scnprintf(s, size, sep ? "%.2f" : " %6.2f%%",
772 (period * 100.0) / total); 772 (period * 100.0) / total);
773 if (symbol_conf.show_cpu_utilization) { 773 if (symbol_conf.show_cpu_utilization) {
774 ret += percent_color_snprintf(s + ret, size - ret, 774 ret += percent_color_snprintf(s + ret, size - ret,
@@ -791,20 +791,20 @@ static int hist_entry__pcnt_snprintf(struct hist_entry *he, char *s,
791 } 791 }
792 } 792 }
793 } else 793 } else
794 ret = snprintf(s, size, sep ? "%" PRIu64 : "%12" PRIu64 " ", period); 794 ret = scnprintf(s, size, sep ? "%" PRIu64 : "%12" PRIu64 " ", period);
795 795
796 if (symbol_conf.show_nr_samples) { 796 if (symbol_conf.show_nr_samples) {
797 if (sep) 797 if (sep)
798 ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, nr_events); 798 ret += scnprintf(s + ret, size - ret, "%c%" PRIu64, *sep, nr_events);
799 else 799 else
800 ret += snprintf(s + ret, size - ret, "%11" PRIu64, nr_events); 800 ret += scnprintf(s + ret, size - ret, "%11" PRIu64, nr_events);
801 } 801 }
802 802
803 if (symbol_conf.show_total_period) { 803 if (symbol_conf.show_total_period) {
804 if (sep) 804 if (sep)
805 ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period); 805 ret += scnprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period);
806 else 806 else
807 ret += snprintf(s + ret, size - ret, " %12" PRIu64, period); 807 ret += scnprintf(s + ret, size - ret, " %12" PRIu64, period);
808 } 808 }
809 809
810 if (pair_hists) { 810 if (pair_hists) {
@@ -819,25 +819,25 @@ static int hist_entry__pcnt_snprintf(struct hist_entry *he, char *s,
819 diff = new_percent - old_percent; 819 diff = new_percent - old_percent;
820 820
821 if (fabs(diff) >= 0.01) 821 if (fabs(diff) >= 0.01)
822 snprintf(bf, sizeof(bf), "%+4.2F%%", diff); 822 ret += scnprintf(bf, sizeof(bf), "%+4.2F%%", diff);
823 else 823 else
824 snprintf(bf, sizeof(bf), " "); 824 ret += scnprintf(bf, sizeof(bf), " ");
825 825
826 if (sep) 826 if (sep)
827 ret += snprintf(s + ret, size - ret, "%c%s", *sep, bf); 827 ret += scnprintf(s + ret, size - ret, "%c%s", *sep, bf);
828 else 828 else
829 ret += snprintf(s + ret, size - ret, "%11.11s", bf); 829 ret += scnprintf(s + ret, size - ret, "%11.11s", bf);
830 830
831 if (show_displacement) { 831 if (show_displacement) {
832 if (displacement) 832 if (displacement)
833 snprintf(bf, sizeof(bf), "%+4ld", displacement); 833 ret += scnprintf(bf, sizeof(bf), "%+4ld", displacement);
834 else 834 else
835 snprintf(bf, sizeof(bf), " "); 835 ret += scnprintf(bf, sizeof(bf), " ");
836 836
837 if (sep) 837 if (sep)
838 ret += snprintf(s + ret, size - ret, "%c%s", *sep, bf); 838 ret += scnprintf(s + ret, size - ret, "%c%s", *sep, bf);
839 else 839 else
840 ret += snprintf(s + ret, size - ret, "%6.6s", bf); 840 ret += scnprintf(s + ret, size - ret, "%6.6s", bf);
841 } 841 }
842 } 842 }
843 843
@@ -855,7 +855,7 @@ int hist_entry__snprintf(struct hist_entry *he, char *s, size_t size,
855 if (se->elide) 855 if (se->elide)
856 continue; 856 continue;
857 857
858 ret += snprintf(s + ret, size - ret, "%s", sep ?: " "); 858 ret += scnprintf(s + ret, size - ret, "%s", sep ?: " ");
859 ret += se->se_snprintf(he, s + ret, size - ret, 859 ret += se->se_snprintf(he, s + ret, size - ret,
860 hists__col_len(hists, se->se_width_idx)); 860 hists__col_len(hists, se->se_width_idx));
861 } 861 }