Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269102
b: refs/heads/master
c: abcefec
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt committed Oct 18, 2011
1 parent 37e813d commit 937b283
Show file tree
Hide file tree
Showing 15 changed files with 168 additions and 389 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: ee8f967b15179c34b923c9b87c06984e682b24cf
refs/heads/master: abcefec31e3dc46554ee9c04f70c6012b17e8dc5
1 change: 1 addition & 0 deletions trunk/arch/m32r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config M32R
select HAVE_GENERIC_HARDIRQS
select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW
select GENERIC_ATOMIC64

config SBUS
bool
Expand Down
30 changes: 5 additions & 25 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,7 @@ static void print_sym_table(void)

hists__collapse_resort_threaded(&top.sym_evsel->hists);
hists__output_resort_threaded(&top.sym_evsel->hists);
hists__decay_entries_threaded(&top.sym_evsel->hists,
top.hide_user_symbols,
top.hide_kernel_symbols);
hists__decay_entries(&top.sym_evsel->hists);
hists__output_recalc_col_len(&top.sym_evsel->hists, winsize.ws_row - 3);
putchar('\n');
hists__fprintf(&top.sym_evsel->hists, NULL, false, false,
Expand Down Expand Up @@ -438,7 +436,6 @@ static int key_mapped(int c)
case 'S':
return 1;
case 'E':
return top.evlist->nr_entries > 1 ? 1 : 0;
default:
break;
}
Expand Down Expand Up @@ -558,9 +555,7 @@ static void perf_top__sort_new_samples(void *arg)

hists__collapse_resort_threaded(&t->sym_evsel->hists);
hists__output_resort_threaded(&t->sym_evsel->hists);
hists__decay_entries_threaded(&t->sym_evsel->hists,
top.hide_user_symbols,
top.hide_kernel_symbols);
hists__decay_entries(&t->sym_evsel->hists);
hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3);
}

Expand Down Expand Up @@ -590,31 +585,16 @@ static void *display_thread(void *arg __used)
tc.c_cc[VMIN] = 0;
tc.c_cc[VTIME] = 0;

pthread__unblock_sigwinch();
repeat:
delay_msecs = top.delay_secs * 1000;
tcsetattr(0, TCSANOW, &tc);
/* trash return*/
getc(stdin);

while (1) {
do {
print_sym_table();
/*
* Either timeout expired or we got an EINTR due to SIGWINCH,
* refresh screen in both cases.
*/
switch (poll(&stdin_poll, 1, delay_msecs)) {
case 0:
continue;
case -1:
if (errno == EINTR)
continue;
/* Fall trhu */
default:
goto process_hotkey;
}
}
process_hotkey:
} while (!poll(&stdin_poll, 1, delay_msecs) == 1);

c = getc(stdin);
tcsetattr(0, TCSAFLUSH, &save);

Expand Down
24 changes: 0 additions & 24 deletions trunk/tools/perf/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,24 +427,6 @@ static void get_debugfs_mntpt(void)
debugfs_mntpt[0] = '\0';
}

static void pthread__block_sigwinch(void)
{
sigset_t set;

sigemptyset(&set);
sigaddset(&set, SIGWINCH);
pthread_sigmask(SIG_BLOCK, &set, NULL);
}

void pthread__unblock_sigwinch(void)
{
sigset_t set;

sigemptyset(&set);
sigaddset(&set, SIGWINCH);
pthread_sigmask(SIG_UNBLOCK, &set, NULL);
}

int main(int argc, const char **argv)
{
const char *cmd;
Expand Down Expand Up @@ -498,12 +480,6 @@ int main(int argc, const char **argv)
* time.
*/
setup_path();
/*
* Block SIGWINCH notifications so that the thread that wants it can
* unblock and get syscalls like select interrupted instead of waiting
* forever while the signal goes to some other non interested thread.
*/
pthread__block_sigwinch();

while (1) {
static int done_help;
Expand Down
2 changes: 0 additions & 2 deletions trunk/tools/perf/perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,4 @@ struct ip_callchain {
extern bool perf_host, perf_guest;
extern const char perf_version_string[];

void pthread__unblock_sigwinch(void);

#endif
2 changes: 1 addition & 1 deletion trunk/tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir)
if (access(linkname, F_OK))
goto out_free;

if (readlink(linkname, filename, size - 1) < 0)
if (readlink(linkname, filename, size) < 0)
goto out_free;

if (unlink(linkname))
Expand Down
29 changes: 4 additions & 25 deletions trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,35 +100,25 @@ static void hist_entry__decay(struct hist_entry *he)

static bool hists__decay_entry(struct hists *hists, struct hist_entry *he)
{
if (he->period == 0)
return true;
hists->stats.total_period -= he->period;
hist_entry__decay(he);
hists->stats.total_period += he->period;
return he->period == 0;
}

static void __hists__decay_entries(struct hists *hists, bool zap_user,
bool zap_kernel, bool threaded)
void hists__decay_entries(struct hists *hists)
{
struct rb_node *next = rb_first(&hists->entries);
struct hist_entry *n;

while (next) {
n = rb_entry(next, struct hist_entry, rb_node);
next = rb_next(&n->rb_node);
/*
* We may be annotating this, for instance, so keep it here in
* case some it gets new samples, we'll eventually free it when
* the user stops browsing and it agains gets fully decayed.
*/
if (((zap_user && n->level == '.') ||
(zap_kernel && n->level != '.') ||
hists__decay_entry(hists, n)) &&
!n->used) {

if (hists__decay_entry(hists, n)) {
rb_erase(&n->rb_node, &hists->entries);

if (sort__need_collapse || threaded)
if (sort__need_collapse)
rb_erase(&n->rb_node_in, &hists->entries_collapsed);

hist_entry__free(n);
Expand All @@ -137,17 +127,6 @@ static void __hists__decay_entries(struct hists *hists, bool zap_user,
}
}

void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel)
{
return __hists__decay_entries(hists, zap_user, zap_kernel, false);
}

void hists__decay_entries_threaded(struct hists *hists,
bool zap_user, bool zap_kernel)
{
return __hists__decay_entries(hists, zap_user, zap_kernel, true);
}

/*
* histogram, sorted on item, collects periods
*/
Expand Down
14 changes: 4 additions & 10 deletions trunk/tools/perf/util/hist.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ void hists__output_resort_threaded(struct hists *hists);
void hists__collapse_resort(struct hists *self);
void hists__collapse_resort_threaded(struct hists *hists);

void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel);
void hists__decay_entries_threaded(struct hists *hists, bool zap_user,
bool zap_kernel);
void hists__decay_entries(struct hists *hists);
void hists__output_recalc_col_len(struct hists *hists, int max_rows);

void hists__inc_nr_events(struct hists *self, u32 type);
Expand All @@ -105,20 +103,16 @@ struct perf_evlist;
#ifdef NO_NEWT_SUPPORT
static inline
int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __used,
const char *help __used,
void(*timer)(void *arg) __used,
void *arg __used,
const char *help __used, void(*timer)(void *arg) __used, void *arg,
int refresh __used)
{
return 0;
}

static inline int hist_entry__tui_annotate(struct hist_entry *self __used,
int evidx __used,
int nr_events __used,
int evidx __used, int nr_events __used,
void(*timer)(void *arg) __used,
void *arg __used,
int delay_secs __used)
void *arg __used, int delay_secs __used);
{
return 0;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/tools/perf/util/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ struct hist_entry {

bool init_have_children;
char level;
bool used;
u8 filtered;
struct symbol *parent;
union {
Expand Down
Loading

0 comments on commit 937b283

Please sign in to comment.