summaryrefslogtreecommitdiff
path: root/Documentation/perf_counter/builtin-stat.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-06-02 17:38:21 +0200
committerIngo Molnar <mingo@elte.hu>2009-06-02 21:45:34 +0200
commitc70975bc8d5bac487616785f5d5bc7b090dfa2d9 (patch)
treedfbbd1e7af293dc41732fda240476598057df5ec /Documentation/perf_counter/builtin-stat.c
parent0d48696f87e3618b0d35bd3e4e9d7c188d51e7de (diff)
downloadlwn-c70975bc8d5bac487616785f5d5bc7b090dfa2d9.tar.gz
lwn-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/perf_counter/builtin-stat.c')
-rw-r--r--Documentation/perf_counter/builtin-stat.c22
1 files changed, 11 insertions, 11 deletions
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));