diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-14 11:23:00 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-12-14 11:34:56 -0500 |
| commit | c019879bcc5692ec9267c1cedad91f1794d0b693 (patch) | |
| tree | ec499400b1ee0b1d93e961cc67b9dead9cd8c9a9 /tools/perf/builtin-sched.c | |
| parent | a328626b61aeda1a7d00a80c475c76ca1b815e0d (diff) | |
perf session: Adopt the sample_type variable
All tools had copies, and perf diff would have to specify a
sample_type_check method just for copying it.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260807780-19377-2-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-sched.c')
| -rw-r--r-- | tools/perf/builtin-sched.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 412ae924640a..d67f274adba0 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | 21 | ||
| 22 | static char const *input_name = "perf.data"; | 22 | static char const *input_name = "perf.data"; |
| 23 | 23 | ||
| 24 | static u64 sample_type; | ||
| 25 | |||
| 26 | static char default_sort_order[] = "avg, max, switch, runtime"; | 24 | static char default_sort_order[] = "avg, max, switch, runtime"; |
| 27 | static char *sort_order = default_sort_order; | 25 | static char *sort_order = default_sort_order; |
| 28 | 26 | ||
| @@ -1613,7 +1611,7 @@ static int process_sample_event(event_t *event, struct perf_session *session) | |||
| 1613 | struct sample_data data; | 1611 | struct sample_data data; |
| 1614 | struct thread *thread; | 1612 | struct thread *thread; |
| 1615 | 1613 | ||
| 1616 | if (!(sample_type & PERF_SAMPLE_RAW)) | 1614 | if (!(session->sample_type & PERF_SAMPLE_RAW)) |
| 1617 | return 0; | 1615 | return 0; |
| 1618 | 1616 | ||
| 1619 | memset(&data, 0, sizeof(data)); | 1617 | memset(&data, 0, sizeof(data)); |
| @@ -1621,7 +1619,7 @@ static int process_sample_event(event_t *event, struct perf_session *session) | |||
| 1621 | data.cpu = -1; | 1619 | data.cpu = -1; |
| 1622 | data.period = -1; | 1620 | data.period = -1; |
| 1623 | 1621 | ||
| 1624 | event__parse_sample(event, sample_type, &data); | 1622 | event__parse_sample(event, session->sample_type, &data); |
| 1625 | 1623 | ||
| 1626 | dump_printf("(IP, %d): %d/%d: %p period: %Ld\n", | 1624 | dump_printf("(IP, %d): %d/%d: %p period: %Ld\n", |
| 1627 | event->header.misc, | 1625 | event->header.misc, |
| @@ -1655,11 +1653,9 @@ static int process_lost_event(event_t *event __used, | |||
| 1655 | return 0; | 1653 | return 0; |
| 1656 | } | 1654 | } |
| 1657 | 1655 | ||
| 1658 | static int sample_type_check(u64 type, struct perf_session *session __used) | 1656 | static int sample_type_check(struct perf_session *session __used) |
| 1659 | { | 1657 | { |
| 1660 | sample_type = type; | 1658 | if (!(session->sample_type & PERF_SAMPLE_RAW)) { |
| 1661 | |||
| 1662 | if (!(sample_type & PERF_SAMPLE_RAW)) { | ||
| 1663 | fprintf(stderr, | 1659 | fprintf(stderr, |
| 1664 | "No trace sample to read. Did you call perf record " | 1660 | "No trace sample to read. Did you call perf record " |
| 1665 | "without -R?"); | 1661 | "without -R?"); |
