diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-05-04 12:31:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-05-04 12:31:47 -0400 |
commit | c4f3b5a2d70eae4abb8bcaaf8dc3f067ff1714e8 (patch) | |
tree | 54b857fc96f423ee3fcd4b8752169024ad8ebdb1 /tools/perf/util | |
parent | 777d0411cd1e384115985dac5ccd42031e3eee2b (diff) | |
parent | 02bf60aad7d5912dfcdbe0154f1bd67ea7a8301e (diff) |
Merge branch 'perf' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/event.c | 1 | ||||
-rw-r--r-- | tools/perf/util/header.c | 9 | ||||
-rw-r--r-- | tools/perf/util/parse-events.h | 1 | ||||
-rw-r--r-- | tools/perf/util/trace-event-info.c | 5 |
4 files changed, 15 insertions, 1 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 1757b0ffeaa9..2477270c1d3f 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -713,6 +713,7 @@ int event__parse_sample(event_t *event, u64 type, struct sample_data *data) | |||
713 | array++; | 713 | array++; |
714 | } | 714 | } |
715 | 715 | ||
716 | data->id = -1ULL; | ||
716 | if (type & PERF_SAMPLE_ID) { | 717 | if (type & PERF_SAMPLE_ID) { |
717 | data->id = *array; | 718 | data->id = *array; |
718 | array++; | 719 | array++; |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 79da0e50ef8f..8847bec64c54 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -436,7 +436,6 @@ static int perf_header__adds_write(struct perf_header *self, int fd) | |||
436 | trace_sec->size = lseek(fd, 0, SEEK_CUR) - trace_sec->offset; | 436 | trace_sec->size = lseek(fd, 0, SEEK_CUR) - trace_sec->offset; |
437 | } | 437 | } |
438 | 438 | ||
439 | |||
440 | if (perf_header__has_feat(self, HEADER_BUILD_ID)) { | 439 | if (perf_header__has_feat(self, HEADER_BUILD_ID)) { |
441 | struct perf_file_section *buildid_sec; | 440 | struct perf_file_section *buildid_sec; |
442 | 441 | ||
@@ -923,6 +922,14 @@ perf_header__find_attr(u64 id, struct perf_header *header) | |||
923 | { | 922 | { |
924 | int i; | 923 | int i; |
925 | 924 | ||
925 | /* | ||
926 | * We set id to -1 if the data file doesn't contain sample | ||
927 | * ids. Check for this and avoid walking through the entire | ||
928 | * list of ids which may be large. | ||
929 | */ | ||
930 | if (id == -1ULL) | ||
931 | return NULL; | ||
932 | |||
926 | for (i = 0; i < header->attrs; i++) { | 933 | for (i = 0; i < header->attrs; i++) { |
927 | struct perf_header_attr *attr = header->attr[i]; | 934 | struct perf_header_attr *attr = header->attr[i]; |
928 | int j; | 935 | int j; |
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index b8c1f64bc935..fc4ab3fe877a 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h | |||
@@ -13,6 +13,7 @@ struct tracepoint_path { | |||
13 | }; | 13 | }; |
14 | 14 | ||
15 | extern struct tracepoint_path *tracepoint_id_to_path(u64 config); | 15 | extern struct tracepoint_path *tracepoint_id_to_path(u64 config); |
16 | extern bool have_tracepoints(struct perf_event_attr *pattrs, int nb_events); | ||
16 | 17 | ||
17 | extern int nr_counters; | 18 | extern int nr_counters; |
18 | 19 | ||
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c index 30cd9b575953..0a1fb9d4f3b6 100644 --- a/tools/perf/util/trace-event-info.c +++ b/tools/perf/util/trace-event-info.c | |||
@@ -487,6 +487,11 @@ get_tracepoints_path(struct perf_event_attr *pattrs, int nb_events) | |||
487 | return nr_tracepoints > 0 ? path.next : NULL; | 487 | return nr_tracepoints > 0 ? path.next : NULL; |
488 | } | 488 | } |
489 | 489 | ||
490 | bool have_tracepoints(struct perf_event_attr *pattrs, int nb_events) | ||
491 | { | ||
492 | return get_tracepoints_path(pattrs, nb_events) ? true : false; | ||
493 | } | ||
494 | |||
490 | int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events) | 495 | int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events) |
491 | { | 496 | { |
492 | char buf[BUFSIZ]; | 497 | char buf[BUFSIZ]; |