Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169646
b: refs/heads/master
c: 51a472d
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Nov 19, 2009
1 parent 66bf37c commit 54a73d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1a105f743d9fa5f7b8eeeca0afb789951164a361
refs/heads/master: 51a472decb845e920137284a5cfef51fb7d61206
17 changes: 11 additions & 6 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ struct sym_entry {
* Source functions
*/

static inline struct symbol *sym_entry__symbol(struct sym_entry *self)
{
return (struct symbol *)(self + 1);
}

static void get_term_dimensions(struct winsize *ws)
{
char *s = getenv("LINES");
Expand Down Expand Up @@ -181,7 +186,7 @@ static void parse_source(struct sym_entry *syme)
goto out_assign;
}

sym = (struct symbol *)(syme + 1);
sym = sym_entry__symbol(syme);
map = syme->map;
path = map->dso->long_name;

Expand Down Expand Up @@ -276,7 +281,7 @@ static void record_precise_ip(struct sym_entry *syme, int counter, u64 ip)

static void lookup_sym_source(struct sym_entry *syme)
{
struct symbol *symbol = (struct symbol *)(syme + 1);
struct symbol *symbol = sym_entry__symbol(syme);
struct source_line *line;
char pattern[PATH_MAX];

Expand Down Expand Up @@ -325,7 +330,7 @@ static void show_details(struct sym_entry *syme)
if (!syme->source)
return;

symbol = (struct symbol *)(syme + 1);
symbol = sym_entry__symbol(syme);
printf("Showing %s for %s\n", event_name(sym_counter), symbol->name);
printf(" Events Pcnt (>=%d%%)\n", sym_pcnt_filter);

Expand Down Expand Up @@ -573,7 +578,7 @@ static void print_sym_table(void)
double pcnt;

syme = rb_entry(nd, struct sym_entry, rb_node);
sym = (struct symbol *)(syme + 1);
sym = sym_entry__symbol(syme);

if (++printed > print_entries || (int)syme->snap_count < count_filter)
continue;
Expand Down Expand Up @@ -661,7 +666,7 @@ static void prompt_symbol(struct sym_entry **target, const char *msg)
pthread_mutex_unlock(&active_symbols_lock);

list_for_each_entry_safe_from(syme, n, &active_symbols, node) {
struct symbol *sym = (struct symbol *)(syme + 1);
struct symbol *sym = sym_entry__symbol(syme);

if (!strcmp(buf, sym->name)) {
found = syme;
Expand All @@ -685,7 +690,7 @@ static void print_mapped_keys(void)
char *name = NULL;

if (sym_filter_entry) {
struct symbol *sym = (struct symbol *)(sym_filter_entry+1);
struct symbol *sym = sym_entry__symbol(sym_filter_entry);
name = sym->name;
}

Expand Down

0 comments on commit 54a73d0

Please sign in to comment.