diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-02-23 09:50:13 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-02-23 09:50:13 -0500 |
commit | 9848caf26dafefcec7881f0e3c35fc81c454ba59 (patch) | |
tree | d95d95326b5d20de6525fee644fc5ce2f70b7d19 | |
parent | 768a06e2ca49cdf72389208cfc056a36cf8bc5e3 (diff) | |
parent | 9826e8329bc160e4cc58b83019f3f056965e42d0 (diff) |
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
-rw-r--r-- | tools/perf/Documentation/perf-lock.txt | 12 | ||||
-rw-r--r-- | tools/perf/builtin-lock.c | 2 | ||||
-rw-r--r-- | tools/perf/util/ui/browsers/top.c | 23 |
3 files changed, 34 insertions, 3 deletions
diff --git a/tools/perf/Documentation/perf-lock.txt b/tools/perf/Documentation/perf-lock.txt index 921de259ea10..4a26a2f3a6a3 100644 --- a/tools/perf/Documentation/perf-lock.txt +++ b/tools/perf/Documentation/perf-lock.txt | |||
@@ -24,8 +24,8 @@ and statistics with this 'perf lock' command. | |||
24 | 24 | ||
25 | 'perf lock report' reports statistical data. | 25 | 'perf lock report' reports statistical data. |
26 | 26 | ||
27 | OPTIONS | 27 | COMMON OPTIONS |
28 | ------- | 28 | -------------- |
29 | 29 | ||
30 | -i:: | 30 | -i:: |
31 | --input=<file>:: | 31 | --input=<file>:: |
@@ -39,6 +39,14 @@ OPTIONS | |||
39 | --dump-raw-trace:: | 39 | --dump-raw-trace:: |
40 | Dump raw trace in ASCII. | 40 | Dump raw trace in ASCII. |
41 | 41 | ||
42 | REPORT OPTIONS | ||
43 | -------------- | ||
44 | |||
45 | -k:: | ||
46 | --key=<value>:: | ||
47 | Sorting key. Possible values: acquired (default), contended, | ||
48 | wait_total, wait_max, wait_min. | ||
49 | |||
42 | SEE ALSO | 50 | SEE ALSO |
43 | -------- | 51 | -------- |
44 | linkperf:perf[1] | 52 | linkperf:perf[1] |
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index e00d93847c44..2e93f99b1480 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c | |||
@@ -893,7 +893,7 @@ static const char * const report_usage[] = { | |||
893 | 893 | ||
894 | static const struct option report_options[] = { | 894 | static const struct option report_options[] = { |
895 | OPT_STRING('k', "key", &sort_key, "acquired", | 895 | OPT_STRING('k', "key", &sort_key, "acquired", |
896 | "key for sorting"), | 896 | "key for sorting (acquired / contended / wait_total / wait_max / wait_min)"), |
897 | /* TODO: type */ | 897 | /* TODO: type */ |
898 | OPT_END() | 898 | OPT_END() |
899 | }; | 899 | }; |
diff --git a/tools/perf/util/ui/browsers/top.c b/tools/perf/util/ui/browsers/top.c index 377ff58c9ae9..2f47224426b6 100644 --- a/tools/perf/util/ui/browsers/top.c +++ b/tools/perf/util/ui/browsers/top.c | |||
@@ -70,6 +70,7 @@ static void perf_top_browser__write(struct ui_browser *browser, void *entry, int | |||
70 | static void perf_top_browser__update_rb_tree(struct perf_top_browser *browser) | 70 | static void perf_top_browser__update_rb_tree(struct perf_top_browser *browser) |
71 | { | 71 | { |
72 | struct perf_top *top = browser->b.priv; | 72 | struct perf_top *top = browser->b.priv; |
73 | u64 top_idx = browser->b.top_idx; | ||
73 | 74 | ||
74 | browser->root = RB_ROOT; | 75 | browser->root = RB_ROOT; |
75 | browser->b.top = NULL; | 76 | browser->b.top = NULL; |
@@ -82,7 +83,29 @@ static void perf_top_browser__update_rb_tree(struct perf_top_browser *browser) | |||
82 | if (browser->sym_width + browser->dso_width > browser->b.width - 29) | 83 | if (browser->sym_width + browser->dso_width > browser->b.width - 29) |
83 | browser->sym_width = browser->b.width - browser->dso_width - 29; | 84 | browser->sym_width = browser->b.width - browser->dso_width - 29; |
84 | } | 85 | } |
86 | |||
87 | /* | ||
88 | * Adjust the ui_browser indexes since the entries in the browser->root | ||
89 | * rb_tree may have changed, then seek it from start, so that we get a | ||
90 | * possible new top of the screen. | ||
91 | */ | ||
85 | browser->b.nr_entries = top->rb_entries; | 92 | browser->b.nr_entries = top->rb_entries; |
93 | |||
94 | if (top_idx >= browser->b.nr_entries) { | ||
95 | if (browser->b.height >= browser->b.nr_entries) | ||
96 | top_idx = browser->b.nr_entries - browser->b.height; | ||
97 | else | ||
98 | top_idx = 0; | ||
99 | } | ||
100 | |||
101 | if (browser->b.index >= top_idx + browser->b.height) | ||
102 | browser->b.index = top_idx + browser->b.index - browser->b.top_idx; | ||
103 | |||
104 | if (browser->b.index >= browser->b.nr_entries) | ||
105 | browser->b.index = browser->b.nr_entries - 1; | ||
106 | |||
107 | browser->b.top_idx = top_idx; | ||
108 | browser->b.seek(&browser->b, top_idx, SEEK_SET); | ||
86 | } | 109 | } |
87 | 110 | ||
88 | static void perf_top_browser__annotate(struct perf_top_browser *browser) | 111 | static void perf_top_browser__annotate(struct perf_top_browser *browser) |