Lines Matching refs:src
800 struct annotated_source *src = zalloc(sizeof(*src));
802 if (src != NULL)
803 INIT_LIST_HEAD(&src->source);
805 return src;
808 static __maybe_unused void annotated_source__delete(struct annotated_source *src)
810 if (src == NULL)
812 zfree(&src->histograms);
813 zfree(&src->cycles_hist);
814 free(src);
817 static int annotated_source__alloc_histograms(struct annotated_source *src,
842 src->sizeof_sym_hist = sizeof_sym_hist;
843 src->nr_histograms = nr_hists;
844 src->histograms = calloc(nr_hists, sizeof_sym_hist) ;
845 return src->histograms ? 0 : -1;
854 notes->src->cycles_hist = calloc(size, sizeof(struct cyc_hist));
855 if (notes->src->cycles_hist == NULL)
865 if (notes->src != NULL) {
866 memset(notes->src->histograms, 0,
867 notes->src->nr_histograms * notes->src->sizeof_sym_hist);
868 if (notes->src->cycles_hist)
869 memset(notes->src->cycles_hist, 0,
926 struct annotated_source *src, int evidx, u64 addr,
943 h = annotated_source__histogram(src, evidx);
965 if (notes->src == NULL) {
966 notes->src = annotated_source__new();
967 if (notes->src == NULL)
972 if (!notes->src->cycles_hist) {
977 return notes->src->cycles_hist;
984 if (notes->src == NULL) {
985 notes->src = annotated_source__new();
986 if (notes->src == NULL)
991 if (notes->src->histograms == NULL) {
993 annotated_source__alloc_histograms(notes->src, symbol__size(sym),
997 return notes->src;
1005 struct annotated_source *src;
1009 src = symbol__hists(sym, evsel->evlist->core.nr_entries);
1010 return src ? __symbol__inc_addr_samples(ms, src, evsel->core.idx, addr, sample) : 0;
1121 if (!notes->src || !notes->src->cycles_hist)
1133 ch = ¬es->src->cycles_hist[offset];
1301 annotated_source__delete(notes->src);
1502 list_for_each_entry_from(queue, ¬es->src->source, node) {
1649 annotation_line__add(&dl->al, ¬es->src->source);
1661 struct list_head *list = ¬es->src->source;
1939 ¬es->src->source);
1950 annotation_line__add(&dl->al, ¬es->src->source);
1984 annotation_line__add(&dl->al, ¬es->src->source);
1997 size_t i, src, dst, len, new_storage_len, num_tabs;
2021 * Copy regions starting at src and expand tabs. If there are two
2022 * adjacent tabs then 'src == i', the memcpy is of size 0 and the spaces
2025 for (i = 0, src = 0, dst = 0; i < line_len && num_tabs; i++) {
2027 len = i - src;
2028 memcpy(&new_line[dst], &line[src], len);
2033 src = i + 1;
2039 len = line_len - src;
2040 memcpy(&new_line[dst], &line[src], len);
2270 list_for_each_entry(al, ¬es->src->source, node) {
2277 next = annotation_line__next(al, ¬es->src->source);
2547 addr_fmt_width = annotated_source__addr_fmt_width(¬es->src->source, start);
2549 list_for_each_entry(pos, ¬es->src->source, node) {
2651 list_for_each_entry(al, ¬es->src->source, node) {
2699 memset(h, 0, notes->src->sizeof_sym_hist);
2802 list_for_each_entry(al, ¬es->src->source, node) {
2838 list_for_each_entry(al, ¬es->src->source, node) {
2893 list_for_each_entry(al, ¬es->src->source, node) {
2957 annotated_source__purge(symbol__annotation(sym)->src);
2990 annotated_source__purge(symbol__annotation(sym)->src);