annotate.c (982d410bc6b405a75086236d3c1da1f18c40d6dd) | annotate.c (380195e2b07b123fb2cd701bd60e78a31fbf3b25) |
---|---|
1/* 2 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 3 * 4 * Parts came from builtin-annotate.c, see those files for further 5 * copyright notes. 6 * 7 * Released under the GPL v2. (and only v2, not any later version) 8 */ --- 1053 unchanged lines hidden (view full) --- 1062 return -1; 1063} 1064 1065struct annotate_args { 1066 size_t privsize; 1067 struct arch *arch; 1068 struct map_symbol ms; 1069 struct perf_evsel *evsel; | 1/* 2 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 3 * 4 * Parts came from builtin-annotate.c, see those files for further 5 * copyright notes. 6 * 7 * Released under the GPL v2. (and only v2, not any later version) 8 */ --- 1053 unchanged lines hidden (view full) --- 1062 return -1; 1063} 1064 1065struct annotate_args { 1066 size_t privsize; 1067 struct arch *arch; 1068 struct map_symbol ms; 1069 struct perf_evsel *evsel; |
1070 struct annotation_options *options; |
|
1070 s64 offset; 1071 char *line; 1072 int line_nr; 1073}; 1074 1075static void annotation_line__delete(struct annotation_line *al) 1076{ 1077 void *ptr = (void *) al - al->privsize; --- 720 unchanged lines hidden (view full) --- 1798{ 1799 struct annotation *notes = symbol__annotation(sym); 1800 1801 annotation__calc_percent(notes, evsel, symbol__size(sym)); 1802} 1803 1804int symbol__annotate(struct symbol *sym, struct map *map, 1805 struct perf_evsel *evsel, size_t privsize, | 1071 s64 offset; 1072 char *line; 1073 int line_nr; 1074}; 1075 1076static void annotation_line__delete(struct annotation_line *al) 1077{ 1078 void *ptr = (void *) al - al->privsize; --- 720 unchanged lines hidden (view full) --- 1799{ 1800 struct annotation *notes = symbol__annotation(sym); 1801 1802 annotation__calc_percent(notes, evsel, symbol__size(sym)); 1803} 1804 1805int symbol__annotate(struct symbol *sym, struct map *map, 1806 struct perf_evsel *evsel, size_t privsize, |
1807 struct annotation_options *options, |
|
1806 struct arch **parch) 1807{ 1808 struct annotate_args args = { 1809 .privsize = privsize, 1810 .evsel = evsel, | 1808 struct arch **parch) 1809{ 1810 struct annotate_args args = { 1811 .privsize = privsize, 1812 .evsel = evsel, |
1813 .options = options, |
|
1811 }; 1812 struct perf_env *env = perf_evsel__env(evsel); 1813 const char *arch_name = perf_env__arch(env); 1814 struct arch *arch; 1815 int err; 1816 1817 if (!arch_name) 1818 return -1; --- 585 unchanged lines hidden (view full) --- 2404 2405int symbol__tty_annotate(struct symbol *sym, struct map *map, 2406 struct perf_evsel *evsel, 2407 struct annotation_options *opts) 2408{ 2409 struct dso *dso = map->dso; 2410 struct rb_root source_line = RB_ROOT; 2411 | 1814 }; 1815 struct perf_env *env = perf_evsel__env(evsel); 1816 const char *arch_name = perf_env__arch(env); 1817 struct arch *arch; 1818 int err; 1819 1820 if (!arch_name) 1821 return -1; --- 585 unchanged lines hidden (view full) --- 2407 2408int symbol__tty_annotate(struct symbol *sym, struct map *map, 2409 struct perf_evsel *evsel, 2410 struct annotation_options *opts) 2411{ 2412 struct dso *dso = map->dso; 2413 struct rb_root source_line = RB_ROOT; 2414 |
2412 if (symbol__annotate(sym, map, evsel, 0, NULL) < 0) | 2415 if (symbol__annotate(sym, map, evsel, 0, opts, NULL) < 0) |
2413 return -1; 2414 2415 symbol__calc_percent(sym, evsel); 2416 2417 if (opts->print_lines) { 2418 srcline_full_filename = opts->full_path; 2419 symbol__calc_lines(sym, map, &source_line); 2420 print_summary(&source_line, dso->long_name); --- 229 unchanged lines hidden (view full) --- 2650 2651 notes->offsets = zalloc(size * sizeof(struct annotation_line *)); 2652 if (notes->offsets == NULL) 2653 return -1; 2654 2655 if (perf_evsel__is_group_event(evsel)) 2656 nr_pcnt = evsel->nr_members; 2657 | 2416 return -1; 2417 2418 symbol__calc_percent(sym, evsel); 2419 2420 if (opts->print_lines) { 2421 srcline_full_filename = opts->full_path; 2422 symbol__calc_lines(sym, map, &source_line); 2423 print_summary(&source_line, dso->long_name); --- 229 unchanged lines hidden (view full) --- 2653 2654 notes->offsets = zalloc(size * sizeof(struct annotation_line *)); 2655 if (notes->offsets == NULL) 2656 return -1; 2657 2658 if (perf_evsel__is_group_event(evsel)) 2659 nr_pcnt = evsel->nr_members; 2660 |
2658 err = symbol__annotate(sym, map, evsel, 0, parch); | 2661 err = symbol__annotate(sym, map, evsel, 0, options, parch); |
2659 if (err) 2660 goto out_free_offsets; 2661 2662 notes->options = options; 2663 2664 symbol__calc_percent(sym, evsel); 2665 2666 notes->start = map__rip_2objdump(map, sym->start); --- 120 unchanged lines hidden --- | 2662 if (err) 2663 goto out_free_offsets; 2664 2665 notes->options = options; 2666 2667 symbol__calc_percent(sym, evsel); 2668 2669 notes->start = map__rip_2objdump(map, sym->start); --- 120 unchanged lines hidden --- |