blob: d7915d4e77cb629e4560d499ac2c1c902ecce5db [file] [log] [blame]
Arnaldo Carvalho de Melof8a95302011-01-30 10:46:46 -02001/*
2 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
3 *
4 * Parts came from builtin-{top,stat,record}.c, see those files for further
5 * copyright notes.
6 *
7 * Released under the GPL v2. (and only v2, not any later version)
8 */
9
David Ahern936be502011-09-06 09:12:26 -060010#include <byteswap.h>
11#include "asm/bug.h"
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020012#include "evsel.h"
Arnaldo Carvalho de Melo70082dd2011-01-12 17:03:24 -020013#include "evlist.h"
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020014#include "util.h"
Arnaldo Carvalho de Melo86bd5e82011-01-03 23:09:46 -020015#include "cpumap.h"
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -020016#include "thread_map.h"
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020017
Arnaldo Carvalho de Meloc52b12e2011-01-03 17:45:52 -020018#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -020019#define GROUP_FD(group_fd, cpu) (*(int *)xyarray__entry(group_fd, cpu, 0))
Arnaldo Carvalho de Meloc52b12e2011-01-03 17:45:52 -020020
Arnaldo Carvalho de Meloc2a70652011-06-02 11:04:54 -030021int __perf_evsel__sample_size(u64 sample_type)
22{
23 u64 mask = sample_type & PERF_SAMPLE_MASK;
24 int size = 0;
25 int i;
26
27 for (i = 0; i < 64; i++) {
28 if (mask & (1ULL << i))
29 size++;
30 }
31
32 size *= sizeof(u64);
33
34 return size;
35}
36
Arnaldo Carvalho de Melo0e2a5f12011-11-04 08:16:58 -020037static void hists__init(struct hists *hists)
38{
39 memset(hists, 0, sizeof(*hists));
40 hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT;
41 hists->entries_in = &hists->entries_in_array[0];
42 hists->entries_collapsed = RB_ROOT;
43 hists->entries = RB_ROOT;
44 pthread_mutex_init(&hists->lock, NULL);
45}
46
Arnaldo Carvalho de Meloef1d1af2011-01-18 21:41:45 -020047void perf_evsel__init(struct perf_evsel *evsel,
48 struct perf_event_attr *attr, int idx)
49{
50 evsel->idx = idx;
51 evsel->attr = *attr;
52 INIT_LIST_HEAD(&evsel->node);
Arnaldo Carvalho de Melo1980c2eb2011-10-05 17:50:23 -030053 hists__init(&evsel->hists);
Arnaldo Carvalho de Meloef1d1af2011-01-18 21:41:45 -020054}
55
Lin Ming23a2f3a2011-01-07 11:11:09 +080056struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx)
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020057{
58 struct perf_evsel *evsel = zalloc(sizeof(*evsel));
59
Arnaldo Carvalho de Meloef1d1af2011-01-18 21:41:45 -020060 if (evsel != NULL)
61 perf_evsel__init(evsel, attr, idx);
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020062
63 return evsel;
64}
65
66int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
67{
David Ahern4af4c952011-05-27 09:58:34 -060068 int cpu, thread;
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020069 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int));
David Ahern4af4c952011-05-27 09:58:34 -060070
71 if (evsel->fd) {
72 for (cpu = 0; cpu < ncpus; cpu++) {
73 for (thread = 0; thread < nthreads; thread++) {
74 FD(evsel, cpu, thread) = -1;
75 }
76 }
77 }
78
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020079 return evsel->fd != NULL ? 0 : -ENOMEM;
80}
81
Arnaldo Carvalho de Melo70db7532011-01-12 22:39:13 -020082int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads)
83{
Arnaldo Carvalho de Meloa91e5432011-03-10 11:15:54 -030084 evsel->sample_id = xyarray__new(ncpus, nthreads, sizeof(struct perf_sample_id));
85 if (evsel->sample_id == NULL)
86 return -ENOMEM;
87
88 evsel->id = zalloc(ncpus * nthreads * sizeof(u64));
89 if (evsel->id == NULL) {
90 xyarray__delete(evsel->sample_id);
91 evsel->sample_id = NULL;
92 return -ENOMEM;
93 }
94
95 return 0;
Arnaldo Carvalho de Melo70db7532011-01-12 22:39:13 -020096}
97
Arnaldo Carvalho de Meloc52b12e2011-01-03 17:45:52 -020098int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus)
99{
100 evsel->counts = zalloc((sizeof(*evsel->counts) +
101 (ncpus * sizeof(struct perf_counts_values))));
102 return evsel->counts != NULL ? 0 : -ENOMEM;
103}
104
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200105void perf_evsel__free_fd(struct perf_evsel *evsel)
106{
107 xyarray__delete(evsel->fd);
108 evsel->fd = NULL;
109}
110
Arnaldo Carvalho de Melo70db7532011-01-12 22:39:13 -0200111void perf_evsel__free_id(struct perf_evsel *evsel)
112{
Arnaldo Carvalho de Meloa91e5432011-03-10 11:15:54 -0300113 xyarray__delete(evsel->sample_id);
114 evsel->sample_id = NULL;
115 free(evsel->id);
Arnaldo Carvalho de Melo70db7532011-01-12 22:39:13 -0200116 evsel->id = NULL;
117}
118
Arnaldo Carvalho de Meloc52b12e2011-01-03 17:45:52 -0200119void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
120{
121 int cpu, thread;
122
123 for (cpu = 0; cpu < ncpus; cpu++)
124 for (thread = 0; thread < nthreads; ++thread) {
125 close(FD(evsel, cpu, thread));
126 FD(evsel, cpu, thread) = -1;
127 }
128}
129
Arnaldo Carvalho de Meloef1d1af2011-01-18 21:41:45 -0200130void perf_evsel__exit(struct perf_evsel *evsel)
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200131{
132 assert(list_empty(&evsel->node));
133 xyarray__delete(evsel->fd);
Arnaldo Carvalho de Meloa91e5432011-03-10 11:15:54 -0300134 xyarray__delete(evsel->sample_id);
135 free(evsel->id);
Arnaldo Carvalho de Meloef1d1af2011-01-18 21:41:45 -0200136}
137
138void perf_evsel__delete(struct perf_evsel *evsel)
139{
140 perf_evsel__exit(evsel);
Stephane Eranian023695d2011-02-14 11:20:01 +0200141 close_cgroup(evsel->cgrp);
Stephane Eranianf0c55bc2011-02-16 15:10:01 +0200142 free(evsel->name);
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200143 free(evsel);
144}
Arnaldo Carvalho de Meloc52b12e2011-01-03 17:45:52 -0200145
146int __perf_evsel__read_on_cpu(struct perf_evsel *evsel,
147 int cpu, int thread, bool scale)
148{
149 struct perf_counts_values count;
150 size_t nv = scale ? 3 : 1;
151
152 if (FD(evsel, cpu, thread) < 0)
153 return -EINVAL;
154
Arnaldo Carvalho de Melo4eed11d2011-01-04 00:13:17 -0200155 if (evsel->counts == NULL && perf_evsel__alloc_counts(evsel, cpu + 1) < 0)
156 return -ENOMEM;
157
Arnaldo Carvalho de Meloc52b12e2011-01-03 17:45:52 -0200158 if (readn(FD(evsel, cpu, thread), &count, nv * sizeof(u64)) < 0)
159 return -errno;
160
161 if (scale) {
162 if (count.run == 0)
163 count.val = 0;
164 else if (count.run < count.ena)
165 count.val = (u64)((double)count.val * count.ena / count.run + 0.5);
166 } else
167 count.ena = count.run = 0;
168
169 evsel->counts->cpu[cpu] = count;
170 return 0;
171}
172
173int __perf_evsel__read(struct perf_evsel *evsel,
174 int ncpus, int nthreads, bool scale)
175{
176 size_t nv = scale ? 3 : 1;
177 int cpu, thread;
178 struct perf_counts_values *aggr = &evsel->counts->aggr, count;
179
Arnaldo Carvalho de Melo52bcd9942011-02-03 17:26:06 -0200180 aggr->val = aggr->ena = aggr->run = 0;
Arnaldo Carvalho de Meloc52b12e2011-01-03 17:45:52 -0200181
182 for (cpu = 0; cpu < ncpus; cpu++) {
183 for (thread = 0; thread < nthreads; thread++) {
184 if (FD(evsel, cpu, thread) < 0)
185 continue;
186
187 if (readn(FD(evsel, cpu, thread),
188 &count, nv * sizeof(u64)) < 0)
189 return -errno;
190
191 aggr->val += count.val;
192 if (scale) {
193 aggr->ena += count.ena;
194 aggr->run += count.run;
195 }
196 }
197 }
198
199 evsel->counts->scaled = 0;
200 if (scale) {
201 if (aggr->run == 0) {
202 evsel->counts->scaled = -1;
203 aggr->val = 0;
204 return 0;
205 }
206
207 if (aggr->run < aggr->ena) {
208 evsel->counts->scaled = 1;
209 aggr->val = (u64)((double)aggr->val * aggr->ena / aggr->run + 0.5);
210 }
211 } else
212 aggr->ena = aggr->run = 0;
213
214 return 0;
215}
Arnaldo Carvalho de Melo48290602011-01-03 17:48:12 -0200216
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200217static int __perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus,
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200218 struct thread_map *threads, bool group,
219 struct xyarray *group_fds)
Arnaldo Carvalho de Melo48290602011-01-03 17:48:12 -0200220{
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200221 int cpu, thread;
Stephane Eranian023695d2011-02-14 11:20:01 +0200222 unsigned long flags = 0;
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200223 int pid = -1, err;
Arnaldo Carvalho de Melo48290602011-01-03 17:48:12 -0200224
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200225 if (evsel->fd == NULL &&
226 perf_evsel__alloc_fd(evsel, cpus->nr, threads->nr) < 0)
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200227 return -ENOMEM;
Arnaldo Carvalho de Melo4eed11d2011-01-04 00:13:17 -0200228
Stephane Eranian023695d2011-02-14 11:20:01 +0200229 if (evsel->cgrp) {
230 flags = PERF_FLAG_PID_CGROUP;
231 pid = evsel->cgrp->fd;
232 }
233
Arnaldo Carvalho de Melo86bd5e82011-01-03 23:09:46 -0200234 for (cpu = 0; cpu < cpus->nr; cpu++) {
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200235 int group_fd = group_fds ? GROUP_FD(group_fds, cpu) : -1;
Arnaldo Carvalho de Melo9d04f172011-01-12 00:08:18 -0200236
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200237 for (thread = 0; thread < threads->nr; thread++) {
Stephane Eranian023695d2011-02-14 11:20:01 +0200238
239 if (!evsel->cgrp)
240 pid = threads->map[thread];
241
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200242 FD(evsel, cpu, thread) = sys_perf_event_open(&evsel->attr,
Stephane Eranian023695d2011-02-14 11:20:01 +0200243 pid,
Arnaldo Carvalho de Melof08199d2011-01-11 23:42:19 -0200244 cpus->map[cpu],
Stephane Eranian023695d2011-02-14 11:20:01 +0200245 group_fd, flags);
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200246 if (FD(evsel, cpu, thread) < 0) {
247 err = -errno;
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200248 goto out_close;
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200249 }
Arnaldo Carvalho de Melof08199d2011-01-11 23:42:19 -0200250
251 if (group && group_fd == -1)
252 group_fd = FD(evsel, cpu, thread);
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200253 }
Arnaldo Carvalho de Melo48290602011-01-03 17:48:12 -0200254 }
255
256 return 0;
257
258out_close:
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200259 do {
260 while (--thread >= 0) {
261 close(FD(evsel, cpu, thread));
262 FD(evsel, cpu, thread) = -1;
263 }
264 thread = threads->nr;
265 } while (--cpu >= 0);
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200266 return err;
267}
268
269void perf_evsel__close(struct perf_evsel *evsel, int ncpus, int nthreads)
270{
271 if (evsel->fd == NULL)
272 return;
273
274 perf_evsel__close_fd(evsel, ncpus, nthreads);
275 perf_evsel__free_fd(evsel);
276 evsel->fd = NULL;
Arnaldo Carvalho de Melo48290602011-01-03 17:48:12 -0200277}
278
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200279static struct {
280 struct cpu_map map;
281 int cpus[1];
282} empty_cpu_map = {
283 .map.nr = 1,
284 .cpus = { -1, },
285};
286
287static struct {
288 struct thread_map map;
289 int threads[1];
290} empty_thread_map = {
291 .map.nr = 1,
292 .threads = { -1, },
293};
294
Arnaldo Carvalho de Melof08199d2011-01-11 23:42:19 -0200295int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus,
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200296 struct thread_map *threads, bool group,
297 struct xyarray *group_fd)
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200298{
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200299 if (cpus == NULL) {
300 /* Work around old compiler warnings about strict aliasing */
301 cpus = &empty_cpu_map.map;
302 }
303
304 if (threads == NULL)
305 threads = &empty_thread_map.map;
306
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200307 return __perf_evsel__open(evsel, cpus, threads, group, group_fd);
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200308}
309
Arnaldo Carvalho de Melof08199d2011-01-11 23:42:19 -0200310int perf_evsel__open_per_cpu(struct perf_evsel *evsel,
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200311 struct cpu_map *cpus, bool group,
312 struct xyarray *group_fd)
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200313{
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200314 return __perf_evsel__open(evsel, cpus, &empty_thread_map.map, group,
315 group_fd);
Arnaldo Carvalho de Melo02522082011-01-04 11:55:27 -0200316}
317
Arnaldo Carvalho de Melof08199d2011-01-11 23:42:19 -0200318int perf_evsel__open_per_thread(struct perf_evsel *evsel,
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200319 struct thread_map *threads, bool group,
320 struct xyarray *group_fd)
Arnaldo Carvalho de Melo48290602011-01-03 17:48:12 -0200321{
Arnaldo Carvalho de Melo727ab042011-10-25 10:42:19 -0200322 return __perf_evsel__open(evsel, &empty_cpu_map.map, threads, group,
323 group_fd);
Arnaldo Carvalho de Melo48290602011-01-03 17:48:12 -0200324}
Arnaldo Carvalho de Melo70082dd2011-01-12 17:03:24 -0200325
Arnaldo Carvalho de Melo8115d602011-01-29 14:01:45 -0200326static int perf_event__parse_id_sample(const union perf_event *event, u64 type,
327 struct perf_sample *sample)
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200328{
329 const u64 *array = event->sample.array;
330
331 array += ((event->header.size -
332 sizeof(event->header)) / sizeof(u64)) - 1;
333
334 if (type & PERF_SAMPLE_CPU) {
335 u32 *p = (u32 *)array;
336 sample->cpu = *p;
337 array--;
338 }
339
340 if (type & PERF_SAMPLE_STREAM_ID) {
341 sample->stream_id = *array;
342 array--;
343 }
344
345 if (type & PERF_SAMPLE_ID) {
346 sample->id = *array;
347 array--;
348 }
349
350 if (type & PERF_SAMPLE_TIME) {
351 sample->time = *array;
352 array--;
353 }
354
355 if (type & PERF_SAMPLE_TID) {
356 u32 *p = (u32 *)array;
357 sample->pid = p[0];
358 sample->tid = p[1];
359 }
360
361 return 0;
362}
363
Frederic Weisbecker98e1da92011-05-21 20:08:15 +0200364static bool sample_overlap(const union perf_event *event,
365 const void *offset, u64 size)
366{
367 const void *base = event;
368
369 if (offset + size > base + event->header.size)
370 return true;
371
372 return false;
373}
374
Arnaldo Carvalho de Melo8115d602011-01-29 14:01:45 -0200375int perf_event__parse_sample(const union perf_event *event, u64 type,
Frederic Weisbeckera2854122011-05-21 19:33:04 +0200376 int sample_size, bool sample_id_all,
David Ahern936be502011-09-06 09:12:26 -0600377 struct perf_sample *data, bool swapped)
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200378{
379 const u64 *array;
380
David Ahern936be502011-09-06 09:12:26 -0600381 /*
382 * used for cross-endian analysis. See git commit 65014ab3
383 * for why this goofiness is needed.
384 */
385 union {
386 u64 val64;
387 u32 val32[2];
388 } u;
389
390
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200391 data->cpu = data->pid = data->tid = -1;
392 data->stream_id = data->id = data->time = -1ULL;
393
394 if (event->header.type != PERF_RECORD_SAMPLE) {
395 if (!sample_id_all)
396 return 0;
Arnaldo Carvalho de Melo8115d602011-01-29 14:01:45 -0200397 return perf_event__parse_id_sample(event, type, data);
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200398 }
399
400 array = event->sample.array;
401
Frederic Weisbeckera2854122011-05-21 19:33:04 +0200402 if (sample_size + sizeof(event->header) > event->header.size)
403 return -EFAULT;
404
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200405 if (type & PERF_SAMPLE_IP) {
406 data->ip = event->ip.ip;
407 array++;
408 }
409
410 if (type & PERF_SAMPLE_TID) {
David Ahern936be502011-09-06 09:12:26 -0600411 u.val64 = *array;
412 if (swapped) {
413 /* undo swap of u64, then swap on individual u32s */
414 u.val64 = bswap_64(u.val64);
415 u.val32[0] = bswap_32(u.val32[0]);
416 u.val32[1] = bswap_32(u.val32[1]);
417 }
418
419 data->pid = u.val32[0];
420 data->tid = u.val32[1];
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200421 array++;
422 }
423
424 if (type & PERF_SAMPLE_TIME) {
425 data->time = *array;
426 array++;
427 }
428
David Ahern7cec0922011-05-30 13:08:23 -0600429 data->addr = 0;
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200430 if (type & PERF_SAMPLE_ADDR) {
431 data->addr = *array;
432 array++;
433 }
434
435 data->id = -1ULL;
436 if (type & PERF_SAMPLE_ID) {
437 data->id = *array;
438 array++;
439 }
440
441 if (type & PERF_SAMPLE_STREAM_ID) {
442 data->stream_id = *array;
443 array++;
444 }
445
446 if (type & PERF_SAMPLE_CPU) {
David Ahern936be502011-09-06 09:12:26 -0600447
448 u.val64 = *array;
449 if (swapped) {
450 /* undo swap of u64, then swap on individual u32s */
451 u.val64 = bswap_64(u.val64);
452 u.val32[0] = bswap_32(u.val32[0]);
453 }
454
455 data->cpu = u.val32[0];
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200456 array++;
457 }
458
459 if (type & PERF_SAMPLE_PERIOD) {
460 data->period = *array;
461 array++;
462 }
463
464 if (type & PERF_SAMPLE_READ) {
465 fprintf(stderr, "PERF_SAMPLE_READ is unsuported for now\n");
466 return -1;
467 }
468
469 if (type & PERF_SAMPLE_CALLCHAIN) {
Frederic Weisbecker98e1da92011-05-21 20:08:15 +0200470 if (sample_overlap(event, array, sizeof(data->callchain->nr)))
471 return -EFAULT;
472
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200473 data->callchain = (struct ip_callchain *)array;
Frederic Weisbecker98e1da92011-05-21 20:08:15 +0200474
475 if (sample_overlap(event, array, data->callchain->nr))
476 return -EFAULT;
477
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200478 array += 1 + data->callchain->nr;
479 }
480
481 if (type & PERF_SAMPLE_RAW) {
Jiri Olsa8e303f22011-09-29 17:05:08 +0200482 const u64 *pdata;
483
David Ahern936be502011-09-06 09:12:26 -0600484 u.val64 = *array;
485 if (WARN_ONCE(swapped,
486 "Endianness of raw data not corrected!\n")) {
487 /* undo swap of u64, then swap on individual u32s */
488 u.val64 = bswap_64(u.val64);
489 u.val32[0] = bswap_32(u.val32[0]);
490 u.val32[1] = bswap_32(u.val32[1]);
491 }
Frederic Weisbecker98e1da92011-05-21 20:08:15 +0200492
493 if (sample_overlap(event, array, sizeof(u32)))
494 return -EFAULT;
495
David Ahern936be502011-09-06 09:12:26 -0600496 data->raw_size = u.val32[0];
Jiri Olsa8e303f22011-09-29 17:05:08 +0200497 pdata = (void *) array + sizeof(u32);
Frederic Weisbecker98e1da92011-05-21 20:08:15 +0200498
Jiri Olsa8e303f22011-09-29 17:05:08 +0200499 if (sample_overlap(event, pdata, data->raw_size))
Frederic Weisbecker98e1da92011-05-21 20:08:15 +0200500 return -EFAULT;
501
Jiri Olsa8e303f22011-09-29 17:05:08 +0200502 data->raw_data = (void *) pdata;
Arnaldo Carvalho de Melod0dd74e2011-01-21 13:46:41 -0200503 }
504
505 return 0;
506}