Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269095
b: refs/heads/master
c: 9b5f8b3
h: refs/heads/master
i:
  269093: c082960
  269091: 5e865dd
  269087: 90edcbd
v: v3
  • Loading branch information
Geunsik Lim authored and Steven Rostedt committed Oct 14, 2011
1 parent 131588d commit c8fad62
Show file tree
Hide file tree
Showing 15 changed files with 168 additions and 378 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: c73a3cb356f94b443aa7624b539493191dbf44c1
refs/heads/master: 9b5f8b31af57a8ce9e9f77864d9143b5e3304815
4 changes: 2 additions & 2 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2720,9 +2720,9 @@ static const char readme_msg[] =
"# cat /sys/kernel/debug/tracing/trace_options\n"
"noprint-parent nosym-offset nosym-addr noverbose\n"
"# echo print-parent > /sys/kernel/debug/tracing/trace_options\n"
"# echo 1 > /sys/kernel/debug/tracing/tracing_enabled\n"
"# echo 1 > /sys/kernel/debug/tracing/tracing_on\n"
"# cat /sys/kernel/debug/tracing/trace > /tmp/trace.txt\n"
"# echo 0 > /sys/kernel/debug/tracing/tracing_enabled\n"
"# echo 0 > /sys/kernel/debug/tracing/tracing_on\n"
;

static ssize_t
Expand Down
25 changes: 5 additions & 20 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +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);
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 @@ -555,7 +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);
hists__decay_entries(&t->sym_evsel->hists);
hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3);
}

Expand Down Expand Up @@ -585,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
24 changes: 4 additions & 20 deletions trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +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 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 (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 @@ -133,16 +127,6 @@ static void __hists__decay_entries(struct hists *hists, bool threaded)
}
}

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

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

/*
* histogram, sorted on item, collects periods
*/
Expand Down
11 changes: 3 additions & 8 deletions trunk/tools/perf/util/hist.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ void hists__collapse_resort(struct hists *self);
void hists__collapse_resort_threaded(struct hists *hists);

void hists__decay_entries(struct hists *hists);
void hists__decay_entries_threaded(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 @@ -104,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 c8fad62

Please sign in to comment.