annotate.c (68aac855b643e1540012cbefa0dee06207c3dc64) | annotate.c (46ccb44269665bba6a9bf0f77fe776421fc2304c) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 4 * 5 * Parts came from builtin-annotate.c, see those files for further 6 * copyright notes. 7 */ 8 --- 2903 unchanged lines hidden (view full) --- 2912 for (i = 0; i < notes->nr_events; i++) { 2913 double percent; 2914 2915 percent = annotation_data__percent(&al->data[i], percent_type); 2916 2917 obj__set_percent_color(obj, percent, current_entry); 2918 if (symbol_conf.show_total_period) { 2919 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period); | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 4 * 5 * Parts came from builtin-annotate.c, see those files for further 6 * copyright notes. 7 */ 8 --- 2903 unchanged lines hidden (view full) --- 2912 for (i = 0; i < notes->nr_events; i++) { 2913 double percent; 2914 2915 percent = annotation_data__percent(&al->data[i], percent_type); 2916 2917 obj__set_percent_color(obj, percent, current_entry); 2918 if (symbol_conf.show_total_period) { 2919 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period); |
2920 } else if (notes->options->show_nr_samples) { | 2920 } else if (symbol_conf.show_nr_samples) { |
2921 obj__printf(obj, "%6" PRIu64 " ", 2922 al->data[i].he.nr_samples); 2923 } else { 2924 obj__printf(obj, "%6.2f ", percent); 2925 } 2926 } 2927 } else { 2928 obj__set_percent_color(obj, 0, current_entry); 2929 2930 if (!show_title) 2931 obj__printf(obj, "%-*s", pcnt_width, " "); 2932 else { 2933 obj__printf(obj, "%-*s", pcnt_width, 2934 symbol_conf.show_total_period ? "Period" : | 2921 obj__printf(obj, "%6" PRIu64 " ", 2922 al->data[i].he.nr_samples); 2923 } else { 2924 obj__printf(obj, "%6.2f ", percent); 2925 } 2926 } 2927 } else { 2928 obj__set_percent_color(obj, 0, current_entry); 2929 2930 if (!show_title) 2931 obj__printf(obj, "%-*s", pcnt_width, " "); 2932 else { 2933 obj__printf(obj, "%-*s", pcnt_width, 2934 symbol_conf.show_total_period ? "Period" : |
2935 notes->options->show_nr_samples ? "Samples" : "Percent"); | 2935 symbol_conf.show_nr_samples ? "Samples" : "Percent"); |
2936 } 2937 } 2938 2939 if (notes->have_cycles) { 2940 if (al->ipc) 2941 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->ipc); 2942 else if (!show_title) 2943 obj__printf(obj, "%*s", ANNOTATION__IPC_WIDTH, " "); --- 205 unchanged lines hidden (view full) --- 3149 *(bool *)cfg->value = perf_config_bool(name, value); 3150 } 3151 return 0; 3152} 3153 3154void annotation_config__init(void) 3155{ 3156 perf_config(annotation__config, NULL); | 2936 } 2937 } 2938 2939 if (notes->have_cycles) { 2940 if (al->ipc) 2941 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->ipc); 2942 else if (!show_title) 2943 obj__printf(obj, "%*s", ANNOTATION__IPC_WIDTH, " "); --- 205 unchanged lines hidden (view full) --- 3149 *(bool *)cfg->value = perf_config_bool(name, value); 3150 } 3151 return 0; 3152} 3153 3154void annotation_config__init(void) 3155{ 3156 perf_config(annotation__config, NULL); |
3157 3158 annotation__default_options.show_nr_samples = symbol_conf.show_nr_samples; | |
3159} 3160 3161static unsigned int parse_percent_type(char *str1, char *str2) 3162{ 3163 unsigned int type = (unsigned int) -1; 3164 3165 if (!strcmp("period", str1)) { 3166 if (!strcmp("local", str2)) --- 54 unchanged lines hidden --- | 3157} 3158 3159static unsigned int parse_percent_type(char *str1, char *str2) 3160{ 3161 unsigned int type = (unsigned int) -1; 3162 3163 if (!strcmp("period", str1)) { 3164 if (!strcmp("local", str2)) --- 54 unchanged lines hidden --- |