Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169647
b: refs/heads/master
c: 5a8e5a3
h: refs/heads/master
i:
  169645: 66bf37c
  169643: faef681
  169639: 61bd866
  169631: b5d4487
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Nov 19, 2009
1 parent 54a73d0 commit 4d74a38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: 51a472decb845e920137284a5cfef51fb7d61206
refs/heads/master: 5a8e5a3065bf04b7673262fd6c46123e4b888d2b
9 changes: 5 additions & 4 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ static int display_weighted = -1;
struct sym_entry {
struct rb_node rb_node;
struct list_head node;
unsigned long count[MAX_COUNTERS];
unsigned long snap_count;
double weight;
int skip;
Expand All @@ -122,6 +121,7 @@ struct sym_entry {
struct source_line *lines;
struct source_line **lines_tail;
pthread_mutex_t source_lock;
unsigned long count[0];
};

/*
Expand All @@ -130,7 +130,7 @@ struct sym_entry {

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

static void get_term_dimensions(struct winsize *ws)
Expand Down Expand Up @@ -1314,8 +1314,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
{
int counter;

symbol__init(sizeof(struct sym_entry));

page_size = sysconf(_SC_PAGE_SIZE);

argc = parse_options(argc, argv, options, top_usage, 0);
Expand All @@ -1332,6 +1330,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
if (!nr_counters)
nr_counters = 1;

symbol__init(sizeof(struct sym_entry) +
(nr_counters + 1) * sizeof(unsigned long));

if (delay_secs < 1)
delay_secs = 1;

Expand Down

0 comments on commit 4d74a38

Please sign in to comment.