• 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/ui/browsers/

Lines Matching refs:self

27 static void hist_browser__refresh_dimensions(struct hist_browser *self)
30 self->b.width = 3 + (hists__sort_list_width(self->hists) +
34 static void hist_browser__reset(struct hist_browser *self)
36 self->b.nr_entries = self->hists->nr_entries;
37 hist_browser__refresh_dimensions(self);
38 ui_browser__reset_index(&self->b);
46 static char map_symbol__folded(const struct map_symbol *self)
48 return self->has_children ? tree__folded_sign(self->unfolded) : ' ';
51 static char hist_entry__folded(const struct hist_entry *self)
53 return map_symbol__folded(&self->ms);
56 static char callchain_list__folded(const struct callchain_list *self)
58 return map_symbol__folded(&self->ms);
61 static int callchain_node__count_rows_rb_tree(struct callchain_node *self)
66 for (nd = rb_first(&self->rb_root); nd; nd = rb_next(nd)) {
116 static bool map_symbol__toggle_fold(struct map_symbol *self)
118 if (!self->has_children)
121 self->unfolded = !self->unfolded;
125 static void callchain_node__init_have_children_rb_tree(struct callchain_node *self)
127 struct rb_node *nd = rb_first(&self->rb_root);
129 for (nd = rb_first(&self->rb_root); nd; nd = rb_next(nd)) {
148 static void callchain_node__init_have_children(struct callchain_node *self)
152 list_for_each_entry(chain, &self->val, list)
153 chain->ms.has_children = rb_first(&self->rb_root) != NULL;
155 callchain_node__init_have_children_rb_tree(self);
158 static void callchain__init_have_children(struct rb_root *self)
162 for (nd = rb_first(self); nd; nd = rb_next(nd)) {
168 static void hist_entry__init_have_children(struct hist_entry *self)
170 if (!self->init_have_children) {
171 callchain__init_have_children(&self->sorted_chain);
172 self->init_have_children = true;
176 static bool hist_browser__toggle_fold(struct hist_browser *self)
178 if (map_symbol__toggle_fold(self->selection)) {
179 struct hist_entry *he = self->he_selection;
182 self->hists->nr_entries -= he->nr_rows;
188 self->hists->nr_entries += he->nr_rows;
189 self->b.nr_entries = self->hists->nr_entries;
198 static int hist_browser__run(struct hist_browser *self, const char *title,
202 unsigned long nr_events = self->hists->stats.nr_events[PERF_RECORD_SAMPLE];
204 self->b.entries = &self->hists->entries;
205 self->b.nr_entries = self->hists->nr_entries;
207 hist_browser__refresh_dimensions(self);
214 if (ui_browser__show(&self->b, title,
218 newtFormAddHotKey(self->b.form, 'a');
219 newtFormAddHotKey(self->b.form, '?');
220 newtFormAddHotKey(self->b.form, 'h');
221 newtFormAddHotKey(self->b.form, 'd');
222 newtFormAddHotKey(self->b.form, 'D');
223 newtFormAddHotKey(self->b.form, 't');
225 newtFormAddHotKey(self->b.form, NEWT_KEY_LEFT);
226 newtFormAddHotKey(self->b.form, NEWT_KEY_RIGHT);
227 newtFormAddHotKey(self->b.form, NEWT_KEY_ENTER);
230 ui_browser__run(&self->b, es);
237 struct hist_entry *h = rb_entry(self->b.top,
241 seq++, self->b.nr_entries,
242 self->hists->nr_entries,
243 self->b.height,
244 self->b.index,
245 self->b.top_idx,
250 if (hist_browser__toggle_fold(self))
258 ui_browser__hide(&self->b);
262 static char *callchain_list__sym_name(struct callchain_list *self,
265 if (self->ms.sym)
266 return self->ms.sym->name;
268 snprintf(bf, bfsize, "%#Lx", self->ip);
274 static int hist_browser__show_callchain_node_rb_tree(struct hist_browser *self,
337 width = self->b.width - (offset + extra_offset + 2);
338 if (ui_browser__is_current_entry(&self->b, row)) {
339 self->selection = &chain->ms;
345 SLsmg_gotorc(self->b.y + row, self->b.x);
351 if (++row == self->b.height)
360 row += hist_browser__show_callchain_node_rb_tree(self, child, new_total,
364 if (row == self->b.height)
372 static int hist_browser__show_callchain_node(struct hist_browser *self,
381 width = self->b.width - offset;
396 if (ui_browser__is_current_entry(&self->b, row)) {
397 self->selection = &chain->ms;
403 SLsmg_gotorc(self->b.y + row, self->b.x);
409 if (++row == self->b.height)
414 row += hist_browser__show_callchain_node_rb_tree(self, node,
415 self->hists->stats.total_period,
423 static int hist_browser__show_callchain(struct hist_browser *self,
435 row += hist_browser__show_callchain_node(self, node, level,
438 if (row == self->b.height)
445 static int hist_browser__show_entry(struct hist_browser *self,
452 int color, width = self->b.width;
454 bool current_entry = ui_browser__is_current_entry(&self->b, row);
458 self->he_selection = entry;
459 self->selection = &entry->ms;
468 hist_entry__snprintf(entry, s, sizeof(s), self->hists, NULL, false,
469 0, false, self->hists->stats.total_period);
470 percent = (entry->period * 100.0) / self->hists->stats.total_period;
483 SLsmg_gotorc(self->b.y + row, self->b.x);
494 if (folded_sign == '-' && row != self->b.height) {
495 printed += hist_browser__show_callchain(self, &entry->sorted_chain,
499 self->he_selection = entry;
505 static unsigned int hist_browser__refresh(struct ui_browser *self)
509 struct hist_browser *hb = container_of(self, struct hist_browser, b);
511 if (self->top == NULL)
512 self->top = rb_first(&hb->hists->entries);
514 for (nd = self->top; nd; nd = rb_next(nd)) {
521 if (row == self->height)
554 static void ui_browser__hists_seek(struct ui_browser *self,
563 nd = hists__filter_entries(rb_first(self->entries));
566 nd = self->top;
569 nd = hists__filter_prev_entries(rb_last(self->entries));
580 h = rb_entry(self->top, struct hist_entry, rb_node);
608 self->top = nd;
616 self->top = nd;
629 self->top = nd;
639 self->top = nd;
649 self->top = nd;
664 self->top = nd;
672 struct hist_browser *self = zalloc(sizeof(*self));
674 if (self) {
675 self->hists = hists;
676 self->b.refresh = hist_browser__refresh;
677 self->b.seek = ui_browser__hists_seek;
680 return self;
683 static void hist_browser__delete(struct hist_browser *self)
685 newtFormDestroy(self->b.form);
687 free(self);
690 static struct hist_entry *hist_browser__selected_entry(struct hist_browser *self)
692 return self->he_selection;
695 static struct thread *hist_browser__selected_thread(struct hist_browser *self)
697 return self->he_selection->thread;
717 int hists__browse(struct hists *self, const char *helpline, const char *ev_name)
719 struct hist_browser *browser = hist_browser__new(self);
882 hists__filter_by_dso(self, dso_filter);
900 hists__filter_by_thread(self, thread_filter);
913 int hists__tui_browse_tree(struct rb_root *self, const char *help)
915 struct rb_node *first = rb_first(self), *nd = first, *next;