summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-record.c3
-rw-r--r--tools/perf/builtin-report.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index deaee42d5eb0..a5698add2fcb 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -347,6 +347,7 @@ static void create_counter(int counter, int cpu, pid_t pid)
attr->mmap = track;
attr->comm = track;
attr->inherit = (cpu < 0) && inherit;
+ attr->disabled = 1;
track = 0; /* only the first counter needs these */
@@ -402,6 +403,8 @@ try_again:
error("failed to mmap with %d (%s)\n", errno, strerror(errno));
exit(-1);
}
+
+ ioctl(fd[nr_cpu][counter], PERF_COUNTER_IOC_ENABLE);
}
static void open_counters(int cpu, pid_t pid)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0b18cb99a858..9a0e31e79e9d 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -47,6 +47,7 @@ struct ip_event {
struct perf_event_header header;
__u64 ip;
__u32 pid, tid;
+ __u64 period;
};
struct mmap_event {
@@ -943,12 +944,13 @@ process_overflow_event(event_t *event, unsigned long offset, unsigned long head)
uint64_t ip = event->ip.ip;
struct map *map = NULL;
- dprintf("%p [%p]: PERF_EVENT (IP, %d): %d: %p\n",
+ dprintf("%p [%p]: PERF_EVENT (IP, %d): %d: %p period: %Ld\n",
(void *)(offset + head),
(void *)(long)(event->header.size),
event->header.misc,
event->ip.pid,
- (void *)(long)ip);
+ (void *)(long)ip,
+ (long long)event->ip.period);
dprintf(" ... thread: %s:%d\n", thread->comm, thread->pid);