• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/tools/perf/util/

Lines Matching refs:self

19 u16 hists__col_len(struct hists *self, enum hist_column col)
21 return self->col_len[col];
24 void hists__set_col_len(struct hists *self, enum hist_column col, u16 len)
26 self->col_len[col] = len;
29 bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len)
31 if (len > hists__col_len(self, col)) {
32 hists__set_col_len(self, col, len);
38 static void hists__reset_col_len(struct hists *self)
43 hists__set_col_len(self, col, 0);
46 static void hists__calc_col_len(struct hists *self, struct hist_entry *h)
51 hists__new_col_len(self, HISTC_SYMBOL, h->ms.sym->namelen);
54 if (hists__new_col_len(self, HISTC_COMM, len))
55 hists__set_col_len(self, HISTC_THREAD, len + 6);
59 hists__new_col_len(self, HISTC_DSO, len);
63 static void hist_entry__add_cpumode_period(struct hist_entry *self,
68 self->period_sys += period;
71 self->period_us += period;
74 self->period_guest_sys += period;
77 self->period_guest_us += period;
91 struct hist_entry *self = malloc(sizeof(*self) + callchain_size);
93 if (self != NULL) {
94 *self = *template;
95 self->nr_events = 1;
96 if (self->ms.map)
97 self->ms.map->referenced = true;
99 callchain_init(self->callchain);
102 return self;
105 static void hists__inc_nr_entries(struct hists *self, struct hist_entry *h)
108 hists__calc_col_len(self, h);
109 ++self->nr_entries;
120 struct hist_entry *__hists__add_entry(struct hists *self,
124 struct rb_node **p = &self->entries.rb_node;
164 rb_insert_color(&he->rb_node, &self->entries);
165 hists__inc_nr_entries(self, he);
244 void hists__collapse_resort(struct hists *self)
254 next = rb_first(&self->entries);
255 self->nr_entries = 0;
256 hists__reset_col_len(self);
262 rb_erase(&n->rb_node, &self->entries);
264 hists__inc_nr_entries(self, n);
267 self->entries = tmp;
300 void hists__output_resort(struct hists *self)
307 min_callchain_hits = self->stats.total_period * (callchain_param.min_percent / 100);
310 next = rb_first(&self->entries);
312 self->nr_entries = 0;
313 hists__reset_col_len(self);
319 rb_erase(&n->rb_node, &self->entries);
321 hists__inc_nr_entries(self, n);
324 self->entries = tmp;
400 static size_t __callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
415 new_total = self->children_hit;
421 node = rb_first(&self->rb_root);
479 static size_t callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
488 list_for_each_entry(chain, &self->val, list) {
512 ret += __callchain__fprintf_graph(fp, self, total_samples, 1, 1, left_margin);
517 static size_t callchain__fprintf_flat(FILE *fp, struct callchain_node *self,
523 if (!self)
526 ret += callchain__fprintf_flat(fp, self->parent, total_samples);
529 list_for_each_entry(chain, &self->val, list) {
542 static size_t hist_entry_callchain__fprintf(FILE *fp, struct hist_entry *self,
550 rb_node = rb_first(&self->sorted_chain);
579 int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size,
589 if (symbol_conf.exclude_other && !self->parent)
593 period = self->pair ? self->pair->period : 0;
595 period_sys = self->pair ? self->pair->period_sys : 0;
596 period_us = self->pair ? self->pair->period_us : 0;
597 period_guest_sys = self->pair ? self->pair->period_guest_sys : 0;
598 period_guest_us = self->pair ? self->pair->period_guest_us : 0;
600 period = self->period;
602 period_sys = self->period_sys;
603 period_us = self->period_us;
604 period_guest_sys = self->period_guest_sys;
605 period_guest_us = self->period_guest_us;
653 new_percent = (self->period * 100.0) / session_total;
685 ret += se->se_snprintf(self, s + ret, size - ret,
692 int hist_entry__fprintf(struct hist_entry *self, struct hists *hists,
697 hist_entry__snprintf(self, bf, sizeof(bf), hists, pair_hists,
703 static size_t hist_entry__fprintf_callchain(struct hist_entry *self,
713 left_margin -= thread__comm_len(self->thread);
716 return hist_entry_callchain__fprintf(fp, self, session_total,
720 size_t hists__fprintf(struct hists *self, struct hists *pair,
785 hists__set_col_len(self, se->se_width_idx,
792 if (!hists__new_col_len(self, se->se_width_idx, width))
793 width = hists__col_len(self, se->se_width_idx);
816 width = hists__col_len(self, se->se_width_idx);
826 for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) {
837 ret += hist_entry__fprintf(h, self, pair, show_displacement,
838 displacement, fp, self->stats.total_period);
841 ret += hist_entry__fprintf_callchain(h, self, fp,
842 self->stats.total_period);
858 unsigned int hists__sort_list_width(struct hists *self)
877 ret += 2 + hists__col_len(self, se->se_width_idx);
885 static void hists__remove_entry_filter(struct hists *self, struct hist_entry *h,
892 ++self->nr_entries;
894 self->nr_entries += h->nr_rows;
896 self->stats.total_period += h->period;
897 self->stats.nr_events[PERF_RECORD_SAMPLE] += h->nr_events;
899 hists__calc_col_len(self, h);
902 void hists__filter_by_dso(struct hists *self, const struct dso *dso)
906 self->nr_entries = self->stats.total_period = 0;
907 self->stats.nr_events[PERF_RECORD_SAMPLE] = 0;
908 hists__reset_col_len(self);
910 for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) {
921 hists__remove_entry_filter(self, h, HIST_FILTER__DSO);
925 void hists__filter_by_thread(struct hists *self, const struct thread *thread)
929 self->nr_entries = self->stats.total_period = 0;
930 self->stats.nr_events[PERF_RECORD_SAMPLE] = 0;
931 hists__reset_col_len(self);
933 for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) {
941 hists__remove_entry_filter(self, h, HIST_FILTER__THREAD);
945 static int symbol__alloc_hist(struct symbol *self)
947 struct sym_priv *priv = symbol__priv(self);
949 (self->end - self->start) * sizeof(u64));
955 int hist_entry__inc_addr_samples(struct hist_entry *self, u64 ip)
958 struct symbol *sym = self->ms.sym;
962 if (!sym || !self->ms.map)
972 pr_debug3("%s: ip=%#Lx\n", __func__, self->ms.map->unmap_ip(self->ms.map, ip));
981 pr_debug3("%#Lx %s: period++ [ip: %#Lx, %#Lx] => %Ld\n", self->ms.sym->start,
982 self->ms.sym->name, ip, ip - self->ms.sym->start, h->ip[offset]);
988 struct objdump_line *self = malloc(sizeof(*self) + privsize);
990 if (self != NULL) {
991 self->offset = offset;
992 self->line = line;
995 return self;
998 void objdump_line__free(struct objdump_line *self)
1000 free(self->line);
1001 free(self);
1019 static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
1022 struct symbol *sym = self->ms.sym;
1063 u64 start = map__rip_2objdump(self->ms.map, sym->start),
1064 end = map__rip_2objdump(self->ms.map, sym->end);
1081 int hist_entry__annotate(struct hist_entry *self, struct list_head *head,
1084 struct symbol *sym = self->ms.sym;
1085 struct map *map = self->ms.map;
1147 if (hist_entry__parse_objdump_line(self, file, head, privsize) < 0)
1157 void hists__inc_nr_events(struct hists *self, u32 type)
1159 ++self->stats.nr_events[0];
1160 ++self->stats.nr_events[type];
1163 size_t hists__fprintf_nr_events(struct hists *self, FILE *fp)
1172 event__name[i], self->stats.nr_events[i]);