aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 2459e5a22ed8..a5a050af8e7d 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -77,7 +77,7 @@ static struct mmap_data mmap_array[MAX_NR_CPUS][MAX_COUNTERS];
77 77
78static unsigned long mmap_read_head(struct mmap_data *md) 78static unsigned long mmap_read_head(struct mmap_data *md)
79{ 79{
80 struct perf_counter_mmap_page *pc = md->base; 80 struct perf_event_mmap_page *pc = md->base;
81 long head; 81 long head;
82 82
83 head = pc->data_head; 83 head = pc->data_head;
@@ -88,7 +88,7 @@ static unsigned long mmap_read_head(struct mmap_data *md)
88 88
89static void mmap_write_tail(struct mmap_data *md, unsigned long tail) 89static void mmap_write_tail(struct mmap_data *md, unsigned long tail)
90{ 90{
91 struct perf_counter_mmap_page *pc = md->base; 91 struct perf_event_mmap_page *pc = md->base;
92 92
93 /* 93 /*
94 * ensure all reads are done before we write the tail out. 94 * ensure all reads are done before we write the tail out.
@@ -233,7 +233,7 @@ static pid_t pid_synthesize_comm_event(pid_t pid, int full)
233 } 233 }
234 } 234 }
235 235
236 comm_ev.header.type = PERF_EVENT_COMM; 236 comm_ev.header.type = PERF_RECORD_COMM;
237 size = ALIGN(size, sizeof(u64)); 237 size = ALIGN(size, sizeof(u64));
238 comm_ev.header.size = sizeof(comm_ev) - (sizeof(comm_ev.comm) - size); 238 comm_ev.header.size = sizeof(comm_ev) - (sizeof(comm_ev.comm) - size);
239 239
@@ -288,7 +288,7 @@ static void pid_synthesize_mmap_samples(pid_t pid, pid_t tgid)
288 while (1) { 288 while (1) {
289 char bf[BUFSIZ], *pbf = bf; 289 char bf[BUFSIZ], *pbf = bf;
290 struct mmap_event mmap_ev = { 290 struct mmap_event mmap_ev = {
291 .header = { .type = PERF_EVENT_MMAP }, 291 .header = { .type = PERF_RECORD_MMAP },
292 }; 292 };
293 int n; 293 int n;
294 size_t size; 294 size_t size;
@@ -355,7 +355,7 @@ static void synthesize_all(void)
355 355
356static int group_fd; 356static int group_fd;
357 357
358static struct perf_header_attr *get_header_attr(struct perf_counter_attr *a, int nr) 358static struct perf_header_attr *get_header_attr(struct perf_event_attr *a, int nr)
359{ 359{
360 struct perf_header_attr *h_attr; 360 struct perf_header_attr *h_attr;
361 361
@@ -371,7 +371,7 @@ static struct perf_header_attr *get_header_attr(struct perf_counter_attr *a, int
371 371
372static void create_counter(int counter, int cpu, pid_t pid) 372static void create_counter(int counter, int cpu, pid_t pid)
373{ 373{
374 struct perf_counter_attr *attr = attrs + counter; 374 struct perf_event_attr *attr = attrs + counter;
375 struct perf_header_attr *h_attr; 375 struct perf_header_attr *h_attr;
376 int track = !counter; /* only the first counter needs these */ 376 int track = !counter; /* only the first counter needs these */
377 struct { 377 struct {
@@ -417,7 +417,7 @@ static void create_counter(int counter, int cpu, pid_t pid)
417 attr->disabled = 1; 417 attr->disabled = 1;
418 418
419try_again: 419try_again:
420 fd[nr_cpu][counter] = sys_perf_counter_open(attr, pid, cpu, group_fd, 0); 420 fd[nr_cpu][counter] = sys_perf_event_open(attr, pid, cpu, group_fd, 0);
421 421
422 if (fd[nr_cpu][counter] < 0) { 422 if (fd[nr_cpu][counter] < 0) {
423 int err = errno; 423 int err = errno;
@@ -444,7 +444,7 @@ try_again:
444 printf("\n"); 444 printf("\n");
445 error("perfcounter syscall returned with %d (%s)\n", 445 error("perfcounter syscall returned with %d (%s)\n",
446 fd[nr_cpu][counter], strerror(err)); 446 fd[nr_cpu][counter], strerror(err));
447 die("No CONFIG_PERF_COUNTERS=y kernel support configured?\n"); 447 die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
448 exit(-1); 448 exit(-1);
449 } 449 }
450 450
@@ -478,7 +478,7 @@ try_again:
478 if (multiplex && fd[nr_cpu][counter] != multiplex_fd) { 478 if (multiplex && fd[nr_cpu][counter] != multiplex_fd) {
479 int ret; 479 int ret;
480 480
481 ret = ioctl(fd[nr_cpu][counter], PERF_COUNTER_IOC_SET_OUTPUT, multiplex_fd); 481 ret = ioctl(fd[nr_cpu][counter], PERF_EVENT_IOC_SET_OUTPUT, multiplex_fd);
482 assert(ret != -1); 482 assert(ret != -1);
483 } else { 483 } else {
484 event_array[nr_poll].fd = fd[nr_cpu][counter]; 484 event_array[nr_poll].fd = fd[nr_cpu][counter];
@@ -496,7 +496,7 @@ try_again:
496 } 496 }
497 } 497 }
498 498
499 ioctl(fd[nr_cpu][counter], PERF_COUNTER_IOC_ENABLE); 499 ioctl(fd[nr_cpu][counter], PERF_EVENT_IOC_ENABLE);
500} 500}
501 501
502static void open_counters(int cpu, pid_t pid) 502static void open_counters(int cpu, pid_t pid)
@@ -642,7 +642,7 @@ static int __cmd_record(int argc, const char **argv)
642 if (done) { 642 if (done) {
643 for (i = 0; i < nr_cpu; i++) { 643 for (i = 0; i < nr_cpu; i++) {
644 for (counter = 0; counter < nr_counters; counter++) 644 for (counter = 0; counter < nr_counters; counter++)
645 ioctl(fd[i][counter], PERF_COUNTER_IOC_DISABLE); 645 ioctl(fd[i][counter], PERF_EVENT_IOC_DISABLE);
646 } 646 }
647 } 647 }
648 } 648 }