diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:20:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:20:25 -0500 |
commit | 6556a6743549defc32e5f90ee2cb1ecd833a44c3 (patch) | |
tree | 622306583d4a3c13235a8bfc012854c125c597f1 /tools/perf/builtin-sched.c | |
parent | e0d272429a34ff143bfa04ee8e29dd4eed2964c7 (diff) | |
parent | 1dd2980d990068e20045b90c424518cc7f3657ff (diff) |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (172 commits)
perf_event, amd: Fix spinlock initialization
perf_event: Fix preempt warning in perf_clock()
perf tools: Flush maps on COMM events
perf_events, x86: Split PMU definitions into separate files
perf annotate: Handle samples not at objdump output addr boundaries
perf_events, x86: Remove superflous MSR writes
perf_events: Simplify code by removing cpu argument to hw_perf_group_sched_in()
perf_events, x86: AMD event scheduling
perf_events: Add new start/stop PMU callbacks
perf_events: Report the MMAP pgoff value in bytes
perf annotate: Defer allocating sym_priv->hist array
perf symbols: Improve debugging information about symtab origins
perf top: Use a macro instead of a constant variable
perf symbols: Check the right return variable
perf/scripts: Tag syscall_name helper as not yet available
perf/scripts: Add perf-trace-python Documentation
perf/scripts: Remove unnecessary PyTuple resizes
perf/scripts: Add syscall tracing scripts
perf/scripts: Add Python scripting engine
perf/scripts: Remove check-perf-trace from listed scripts
...
Fix trivial conflict in tools/perf/util/probe-event.c
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r-- | tools/perf/builtin-sched.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 80209df6cfe8..4f5a03e43444 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1621,11 +1621,8 @@ static int process_sample_event(event_t *event, struct perf_session *session) | |||
1621 | 1621 | ||
1622 | event__parse_sample(event, session->sample_type, &data); | 1622 | event__parse_sample(event, session->sample_type, &data); |
1623 | 1623 | ||
1624 | dump_printf("(IP, %d): %d/%d: %p period: %Ld\n", | 1624 | dump_printf("(IP, %d): %d/%d: %#Lx period: %Ld\n", event->header.misc, |
1625 | event->header.misc, | 1625 | data.pid, data.tid, data.ip, data.period); |
1626 | data.pid, data.tid, | ||
1627 | (void *)(long)data.ip, | ||
1628 | (long long)data.period); | ||
1629 | 1626 | ||
1630 | thread = perf_session__findnew(session, data.pid); | 1627 | thread = perf_session__findnew(session, data.pid); |
1631 | if (thread == NULL) { | 1628 | if (thread == NULL) { |
@@ -1653,33 +1650,22 @@ static int process_lost_event(event_t *event __used, | |||
1653 | return 0; | 1650 | return 0; |
1654 | } | 1651 | } |
1655 | 1652 | ||
1656 | static int sample_type_check(struct perf_session *session __used) | ||
1657 | { | ||
1658 | if (!(session->sample_type & PERF_SAMPLE_RAW)) { | ||
1659 | fprintf(stderr, | ||
1660 | "No trace sample to read. Did you call perf record " | ||
1661 | "without -R?"); | ||
1662 | return -1; | ||
1663 | } | ||
1664 | |||
1665 | return 0; | ||
1666 | } | ||
1667 | |||
1668 | static struct perf_event_ops event_ops = { | 1653 | static struct perf_event_ops event_ops = { |
1669 | .process_sample_event = process_sample_event, | 1654 | .sample = process_sample_event, |
1670 | .process_comm_event = event__process_comm, | 1655 | .comm = event__process_comm, |
1671 | .process_lost_event = process_lost_event, | 1656 | .lost = process_lost_event, |
1672 | .sample_type_check = sample_type_check, | ||
1673 | }; | 1657 | }; |
1674 | 1658 | ||
1675 | static int read_events(void) | 1659 | static int read_events(void) |
1676 | { | 1660 | { |
1677 | int err; | 1661 | int err = -EINVAL; |
1678 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, 0); | 1662 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, 0); |
1679 | if (session == NULL) | 1663 | if (session == NULL) |
1680 | return -ENOMEM; | 1664 | return -ENOMEM; |
1681 | 1665 | ||
1682 | err = perf_session__process_events(session, &event_ops); | 1666 | if (perf_session__has_traces(session, "record -R")) |
1667 | err = perf_session__process_events(session, &event_ops); | ||
1668 | |||
1683 | perf_session__delete(session); | 1669 | perf_session__delete(session); |
1684 | return err; | 1670 | return err; |
1685 | } | 1671 | } |