summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPeter Zijlstra2009-06-02 17:38:21 +0200
committerIngo Molnar2009-06-02 21:45:34 +0200
commitc70975bc8d5bac487616785f5d5bc7b090dfa2d9 (patch)
treedfbbd1e7af293dc41732fda240476598057df5ec /Documentation
parentperf_counter: Rename perf_counter_hw_event => perf_counter_attr (diff)
downloadkernel-qcow2-linux-c70975bc8d5bac487616785f5d5bc7b090dfa2d9.tar.gz
kernel-qcow2-linux-c70975bc8d5bac487616785f5d5bc7b090dfa2d9.tar.xz
kernel-qcow2-linux-c70975bc8d5bac487616785f5d5bc7b090dfa2d9.zip
perf_counter tools: Fix up the ABI shakeup
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: John Kacur <jkacur@redhat.com> Cc: Stephane Eranian <eranian@googlemail.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/perf_counter/builtin-record.c18
-rw-r--r--Documentation/perf_counter/builtin-stat.c22
-rw-r--r--Documentation/perf_counter/builtin-top.c20
-rw-r--r--Documentation/perf_counter/perf.h4
4 files changed, 32 insertions, 32 deletions
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index bace7a8edf80..c2fd04244972 100644
--- a/Documentation/perf_counter/builtin-record.c
+++ b/Documentation/perf_counter/builtin-record.c
@@ -322,7 +322,7 @@ static void synthesize_events(void)
static void open_counters(int cpu, pid_t pid)
{
- struct perf_counter_hw_event hw_event;
+ struct perf_counter_attr attr;
int counter, group_fd;
int track = 1;
@@ -334,18 +334,18 @@ static void open_counters(int cpu, pid_t pid)
group_fd = -1;
for (counter = 0; counter < nr_counters; counter++) {
- memset(&hw_event, 0, sizeof(hw_event));
- hw_event.config = event_id[counter];
- hw_event.irq_period = event_count[counter];
- hw_event.record_type = PERF_RECORD_IP | PERF_RECORD_TID;
- hw_event.mmap = track;
- hw_event.comm = track;
- hw_event.inherit = (cpu < 0) && inherit;
+ memset(&attr, 0, sizeof(attr));
+ attr.config = event_id[counter];
+ attr.sample_period = event_count[counter];
+ attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
+ attr.mmap = track;
+ attr.comm = track;
+ attr.inherit = (cpu < 0) && inherit;
track = 0; // only the first counter needs these
fd[nr_cpu][counter] =
- sys_perf_counter_open(&hw_event, pid, cpu, group_fd, 0);
+ sys_perf_counter_open(&attr, pid, cpu, group_fd, 0);
if (fd[nr_cpu][counter] < 0) {
int err = errno;
diff --git a/Documentation/perf_counter/builtin-stat.c b/Documentation/perf_counter/builtin-stat.c
index 644f850b7bde..27abe6a2db3b 100644
--- a/Documentation/perf_counter/builtin-stat.c
+++ b/Documentation/perf_counter/builtin-stat.c
@@ -79,22 +79,22 @@ static __u64 walltime_nsecs;
static void create_perfstat_counter(int counter)
{
- struct perf_counter_hw_event hw_event;
+ struct perf_counter_attr attr;
- memset(&hw_event, 0, sizeof(hw_event));
- hw_event.config = event_id[counter];
- hw_event.record_type = 0;
- hw_event.exclude_kernel = event_mask[counter] & EVENT_MASK_KERNEL;
- hw_event.exclude_user = event_mask[counter] & EVENT_MASK_USER;
+ memset(&attr, 0, sizeof(attr));
+ attr.config = event_id[counter];
+ attr.sample_type = 0;
+ attr.exclude_kernel = event_mask[counter] & EVENT_MASK_KERNEL;
+ attr.exclude_user = event_mask[counter] & EVENT_MASK_USER;
if (scale)
- hw_event.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
+ attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
PERF_FORMAT_TOTAL_TIME_RUNNING;
if (system_wide) {
int cpu;
for (cpu = 0; cpu < nr_cpus; cpu ++) {
- fd[cpu][counter] = sys_perf_counter_open(&hw_event, -1, cpu, -1, 0);
+ fd[cpu][counter] = sys_perf_counter_open(&attr, -1, cpu, -1, 0);
if (fd[cpu][counter] < 0) {
printf("perfstat error: syscall returned with %d (%s)\n",
fd[cpu][counter], strerror(errno));
@@ -102,10 +102,10 @@ static void create_perfstat_counter(int counter)
}
}
} else {
- hw_event.inherit = inherit;
- hw_event.disabled = 1;
+ attr.inherit = inherit;
+ attr.disabled = 1;
- fd[0][counter] = sys_perf_counter_open(&hw_event, 0, -1, -1, 0);
+ fd[0][counter] = sys_perf_counter_open(&attr, 0, -1, -1, 0);
if (fd[0][counter] < 0) {
printf("perfstat error: syscall returned with %d (%s)\n",
fd[0][counter], strerror(errno));
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c
index a2cff7b05276..5029d8e6cd9c 100644
--- a/Documentation/perf_counter/builtin-top.c
+++ b/Documentation/perf_counter/builtin-top.c
@@ -537,7 +537,7 @@ static void mmap_read(struct mmap_data *md)
old += size;
if (event->header.misc & PERF_EVENT_MISC_OVERFLOW) {
- if (event->header.type & PERF_RECORD_IP)
+ if (event->header.type & PERF_SAMPLE_IP)
process_event(event->ip.ip, md->counter);
} else {
switch (event->header.type) {
@@ -563,7 +563,7 @@ static struct mmap_data mmap_array[MAX_NR_CPUS][MAX_COUNTERS];
static int __cmd_top(void)
{
- struct perf_counter_hw_event hw_event;
+ struct perf_counter_attr attr;
pthread_t thread;
int i, counter, group_fd, nr_poll = 0;
unsigned int cpu;
@@ -577,15 +577,15 @@ static int __cmd_top(void)
if (target_pid == -1 && profile_cpu == -1)
cpu = i;
- memset(&hw_event, 0, sizeof(hw_event));
- hw_event.config = event_id[counter];
- hw_event.irq_period = event_count[counter];
- hw_event.record_type = PERF_RECORD_IP | PERF_RECORD_TID;
- hw_event.mmap = use_mmap;
- hw_event.munmap = use_munmap;
- hw_event.freq = freq;
+ memset(&attr, 0, sizeof(attr));
+ attr.config = event_id[counter];
+ attr.sample_period = event_count[counter];
+ attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
+ attr.mmap = use_mmap;
+ attr.munmap = use_munmap;
+ attr.freq = freq;
- fd[i][counter] = sys_perf_counter_open(&hw_event, target_pid, cpu, group_fd, 0);
+ fd[i][counter] = sys_perf_counter_open(&attr, target_pid, cpu, group_fd, 0);
if (fd[i][counter] < 0) {
int err = errno;
printf("kerneltop error: syscall returned with %d (%s)\n",
diff --git a/Documentation/perf_counter/perf.h b/Documentation/perf_counter/perf.h
index 5a2520bb7e55..10622a48b408 100644
--- a/Documentation/perf_counter/perf.h
+++ b/Documentation/perf_counter/perf.h
@@ -53,11 +53,11 @@ static inline unsigned long long rdclock(void)
_min1 < _min2 ? _min1 : _min2; })
static inline int
-sys_perf_counter_open(struct perf_counter_hw_event *hw_event_uptr,
+sys_perf_counter_open(struct perf_counter_attr *attr_uptr,
pid_t pid, int cpu, int group_fd,
unsigned long flags)
{
- return syscall(__NR_perf_counter_open, hw_event_uptr, pid, cpu,
+ return syscall(__NR_perf_counter_open, attr_uptr, pid, cpu,
group_fd, flags);
}