diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-08 12:14:46 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-08 12:14:46 -0400 |
| commit | 106544d81d88069c2df66ebdee42a4ba8fcd25e9 (patch) | |
| tree | 9a6233100699c28fafde9eaa1751de7ddc173f58 /tools | |
| parent | 03d8f5408235bfd2781142458e0c0671530e74e7 (diff) | |
| parent | db0dc75d6403b6663c0eab4c6ccb672eb9b2ed72 (diff) | |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"A bit larger than what I'd wish for - half of it is due to hw driver
updates to Intel Ivy-Bridge which info got recently released,
cycles:pp should work there now too, amongst other things. (but we
are generally making exceptions for hardware enablement of this type.)
There are also callchain fixes in it - responding to mostly
theoretical (but valid) concerns. The tooling side sports perf.data
endianness/portability fixes which did not make it for the merge
window - and various other fixes as well."
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
perf/x86: Check user address explicitly in copy_from_user_nmi()
perf/x86: Check if user fp is valid
perf: Limit callchains to 127
perf/x86: Allow multiple stacks
perf/x86: Update SNB PEBS constraints
perf/x86: Enable/Add IvyBridge hardware support
perf/x86: Implement cycles:p for SNB/IVB
perf/x86: Fix Intel shared extra MSR allocation
x86/decoder: Fix bsr/bsf/jmpe decoding with operand-size prefix
perf: Remove duplicate invocation on perf_event_for_each
perf uprobes: Remove unnecessary check before strlist__delete
perf symbols: Check for valid dso before creating map
perf evsel: Fix 32 bit values endianity swap for sample_id_all header
perf session: Handle endianity swap on sample_id_all header data
perf symbols: Handle different endians properly during symbol load
perf evlist: Pass third argument to ioctl explicitly
perf tools: Update ioctl documentation for PERF_IOC_FLAG_GROUP
perf tools: Make --version show kernel version instead of pull req tag
perf tools: Check if callchain is corrupted
perf callchain: Make callchain cursors TLS
...
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/MANIFEST | 2 | ||||
| -rw-r--r-- | tools/perf/builtin-report.c | 4 | ||||
| -rw-r--r-- | tools/perf/builtin-stat.c | 8 | ||||
| -rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
| -rw-r--r-- | tools/perf/design.txt | 7 | ||||
| -rw-r--r-- | tools/perf/ui/browsers/annotate.c | 2 | ||||
| -rwxr-xr-x | tools/perf/util/PERF-VERSION-GEN | 2 | ||||
| -rw-r--r-- | tools/perf/util/callchain.c | 2 | ||||
| -rw-r--r-- | tools/perf/util/callchain.h | 2 | ||||
| -rw-r--r-- | tools/perf/util/evlist.c | 17 | ||||
| -rw-r--r-- | tools/perf/util/evlist.h | 4 | ||||
| -rw-r--r-- | tools/perf/util/evsel.c | 29 | ||||
| -rw-r--r-- | tools/perf/util/hist.c | 7 | ||||
| -rw-r--r-- | tools/perf/util/hist.h | 2 | ||||
| -rw-r--r-- | tools/perf/util/pager.c | 4 | ||||
| -rw-r--r-- | tools/perf/util/probe-event.c | 8 | ||||
| -rw-r--r-- | tools/perf/util/session.c | 97 | ||||
| -rw-r--r-- | tools/perf/util/symbol.c | 38 | ||||
| -rw-r--r-- | tools/perf/util/symbol.h | 30 |
19 files changed, 212 insertions, 55 deletions
diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST index 5476bc0a1eac..b4b572e8c100 100644 --- a/tools/perf/MANIFEST +++ b/tools/perf/MANIFEST | |||
| @@ -1,4 +1,6 @@ | |||
| 1 | tools/perf | 1 | tools/perf |
| 2 | tools/scripts | ||
| 3 | tools/lib/traceevent | ||
| 2 | include/linux/const.h | 4 | include/linux/const.h |
| 3 | include/linux/perf_event.h | 5 | include/linux/perf_event.h |
| 4 | include/linux/rbtree.h | 6 | include/linux/rbtree.h |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 8c767c6bca91..25249f76329d 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
| @@ -152,7 +152,7 @@ static int perf_evsel__add_hist_entry(struct perf_evsel *evsel, | |||
| 152 | 152 | ||
| 153 | if (symbol_conf.use_callchain) { | 153 | if (symbol_conf.use_callchain) { |
| 154 | err = callchain_append(he->callchain, | 154 | err = callchain_append(he->callchain, |
| 155 | &evsel->hists.callchain_cursor, | 155 | &callchain_cursor, |
| 156 | sample->period); | 156 | sample->period); |
| 157 | if (err) | 157 | if (err) |
| 158 | return err; | 158 | return err; |
| @@ -162,7 +162,7 @@ static int perf_evsel__add_hist_entry(struct perf_evsel *evsel, | |||
| 162 | * so we don't allocated the extra space needed because the stdio | 162 | * so we don't allocated the extra space needed because the stdio |
| 163 | * code will not use it. | 163 | * code will not use it. |
| 164 | */ | 164 | */ |
| 165 | if (al->sym != NULL && use_browser > 0) { | 165 | if (he->ms.sym != NULL && use_browser > 0) { |
| 166 | struct annotation *notes = symbol__annotation(he->ms.sym); | 166 | struct annotation *notes = symbol__annotation(he->ms.sym); |
| 167 | 167 | ||
| 168 | assert(evsel != NULL); | 168 | assert(evsel != NULL); |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 62ae30d34fa6..262589991ea4 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
| @@ -1129,7 +1129,7 @@ static int add_default_attributes(void) | |||
| 1129 | return 0; | 1129 | return 0; |
| 1130 | 1130 | ||
| 1131 | if (!evsel_list->nr_entries) { | 1131 | if (!evsel_list->nr_entries) { |
| 1132 | if (perf_evlist__add_attrs_array(evsel_list, default_attrs) < 0) | 1132 | if (perf_evlist__add_default_attrs(evsel_list, default_attrs) < 0) |
| 1133 | return -1; | 1133 | return -1; |
| 1134 | } | 1134 | } |
| 1135 | 1135 | ||
| @@ -1139,21 +1139,21 @@ static int add_default_attributes(void) | |||
| 1139 | return 0; | 1139 | return 0; |
| 1140 | 1140 | ||
| 1141 | /* Append detailed run extra attributes: */ | 1141 | /* Append detailed run extra attributes: */ |
| 1142 | if (perf_evlist__add_attrs_array(evsel_list, detailed_attrs) < 0) | 1142 | if (perf_evlist__add_default_attrs(evsel_list, detailed_attrs) < 0) |
| 1143 | return -1; | 1143 | return -1; |
| 1144 | 1144 | ||
| 1145 | if (detailed_run < 2) | 1145 | if (detailed_run < 2) |
| 1146 | return 0; | 1146 | return 0; |
| 1147 | 1147 | ||
| 1148 | /* Append very detailed run extra attributes: */ | 1148 | /* Append very detailed run extra attributes: */ |
| 1149 | if (perf_evlist__add_attrs_array(evsel_list, very_detailed_attrs) < 0) | 1149 | if (perf_evlist__add_default_attrs(evsel_list, very_detailed_attrs) < 0) |
| 1150 | return -1; | 1150 | return -1; |
| 1151 | 1151 | ||
| 1152 | if (detailed_run < 3) | 1152 | if (detailed_run < 3) |
| 1153 | return 0; | 1153 | return 0; |
| 1154 | 1154 | ||
| 1155 | /* Append very, very detailed run extra attributes: */ | 1155 | /* Append very, very detailed run extra attributes: */ |
| 1156 | return perf_evlist__add_attrs_array(evsel_list, very_very_detailed_attrs); | 1156 | return perf_evlist__add_default_attrs(evsel_list, very_very_detailed_attrs); |
| 1157 | } | 1157 | } |
| 1158 | 1158 | ||
| 1159 | int cmd_stat(int argc, const char **argv, const char *prefix __used) | 1159 | int cmd_stat(int argc, const char **argv, const char *prefix __used) |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 871b540293e1..6bb0277b7dfe 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
| @@ -787,7 +787,7 @@ static void perf_event__process_sample(struct perf_tool *tool, | |||
| 787 | } | 787 | } |
| 788 | 788 | ||
| 789 | if (symbol_conf.use_callchain) { | 789 | if (symbol_conf.use_callchain) { |
| 790 | err = callchain_append(he->callchain, &evsel->hists.callchain_cursor, | 790 | err = callchain_append(he->callchain, &callchain_cursor, |
| 791 | sample->period); | 791 | sample->period); |
| 792 | if (err) | 792 | if (err) |
| 793 | return; | 793 | return; |
diff --git a/tools/perf/design.txt b/tools/perf/design.txt index bd0bb1b1279b..67e5d0cace85 100644 --- a/tools/perf/design.txt +++ b/tools/perf/design.txt | |||
| @@ -409,14 +409,15 @@ Counters can be enabled and disabled in two ways: via ioctl and via | |||
| 409 | prctl. When a counter is disabled, it doesn't count or generate | 409 | prctl. When a counter is disabled, it doesn't count or generate |
| 410 | events but does continue to exist and maintain its count value. | 410 | events but does continue to exist and maintain its count value. |
| 411 | 411 | ||
| 412 | An individual counter or counter group can be enabled with | 412 | An individual counter can be enabled with |
| 413 | 413 | ||
| 414 | ioctl(fd, PERF_EVENT_IOC_ENABLE); | 414 | ioctl(fd, PERF_EVENT_IOC_ENABLE, 0); |
| 415 | 415 | ||
| 416 | or disabled with | 416 | or disabled with |
| 417 | 417 | ||
| 418 | ioctl(fd, PERF_EVENT_IOC_DISABLE); | 418 | ioctl(fd, PERF_EVENT_IOC_DISABLE, 0); |
| 419 | 419 | ||
| 420 | For a counter group, pass PERF_IOC_FLAG_GROUP as the third argument. | ||
| 420 | Enabling or disabling the leader of a group enables or disables the | 421 | Enabling or disabling the leader of a group enables or disables the |
| 421 | whole group; that is, while the group leader is disabled, none of the | 422 | whole group; that is, while the group leader is disabled, none of the |
| 422 | counters in the group will count. Enabling or disabling a member of a | 423 | counters in the group will count. Enabling or disabling a member of a |
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 4deea6aaf927..34b1c46eaf42 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
| @@ -668,7 +668,7 @@ static int annotate_browser__run(struct annotate_browser *browser, int evidx, | |||
| 668 | "q/ESC/CTRL+C Exit\n\n" | 668 | "q/ESC/CTRL+C Exit\n\n" |
| 669 | "-> Go to target\n" | 669 | "-> Go to target\n" |
| 670 | "<- Exit\n" | 670 | "<- Exit\n" |
| 671 | "h Cycle thru hottest instructions\n" | 671 | "H Cycle thru hottest instructions\n" |
| 672 | "j Toggle showing jump to target arrows\n" | 672 | "j Toggle showing jump to target arrows\n" |
| 673 | "J Toggle showing number of jump sources on targets\n" | 673 | "J Toggle showing number of jump sources on targets\n" |
| 674 | "n Search next string\n" | 674 | "n Search next string\n" |
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN index ad73300f7bac..95264f304179 100755 --- a/tools/perf/util/PERF-VERSION-GEN +++ b/tools/perf/util/PERF-VERSION-GEN | |||
| @@ -12,7 +12,7 @@ LF=' | |||
| 12 | # First check if there is a .git to get the version from git describe | 12 | # First check if there is a .git to get the version from git describe |
| 13 | # otherwise try to get the version from the kernel makefile | 13 | # otherwise try to get the version from the kernel makefile |
| 14 | if test -d ../../.git -o -f ../../.git && | 14 | if test -d ../../.git -o -f ../../.git && |
| 15 | VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && | 15 | VN=$(git describe --match 'v[0-9].[0-9]*' --abbrev=4 HEAD 2>/dev/null) && |
| 16 | case "$VN" in | 16 | case "$VN" in |
| 17 | *$LF*) (exit 1) ;; | 17 | *$LF*) (exit 1) ;; |
| 18 | v[0-9]*) | 18 | v[0-9]*) |
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 9f7106a8d9a4..3a6bff47614f 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c | |||
| @@ -18,6 +18,8 @@ | |||
| 18 | #include "util.h" | 18 | #include "util.h" |
| 19 | #include "callchain.h" | 19 | #include "callchain.h" |
| 20 | 20 | ||
| 21 | __thread struct callchain_cursor callchain_cursor; | ||
| 22 | |||
| 21 | bool ip_callchain__valid(struct ip_callchain *chain, | 23 | bool ip_callchain__valid(struct ip_callchain *chain, |
| 22 | const union perf_event *event) | 24 | const union perf_event *event) |
| 23 | { | 25 | { |
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h index 7f9c0f1ae3a9..3bdb407f9cd9 100644 --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h | |||
| @@ -76,6 +76,8 @@ struct callchain_cursor { | |||
| 76 | struct callchain_cursor_node *curr; | 76 | struct callchain_cursor_node *curr; |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | |||
