aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/buffer_sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/oprofile/buffer_sync.c')
-rw-r--r--drivers/oprofile/buffer_sync.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 7d61ae8ee8cf..44f676c8a51d 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -331,10 +331,8 @@ static void add_trace_begin(void)
331 331
332#define IBS_FETCH_CODE_SIZE 2 332#define IBS_FETCH_CODE_SIZE 2
333#define IBS_OP_CODE_SIZE 5 333#define IBS_OP_CODE_SIZE 5
334#define IBS_EIP(offset) \ 334#define IBS_EIP(cpu_buf) ((cpu_buffer_read_entry(cpu_buf))->eip)
335 (((struct op_sample *)&cpu_buf->buffer[(offset)])->eip) 335#define IBS_EVENT(cpu_buf) ((cpu_buffer_read_entry(cpu_buf))->event)
336#define IBS_EVENT(offset) \
337 (((struct op_sample *)&cpu_buf->buffer[(offset)])->event)
338 336
339/* 337/*
340 * Add IBS fetch and op entries to event buffer 338 * Add IBS fetch and op entries to event buffer
@@ -349,10 +347,10 @@ static void add_ibs_begin(struct oprofile_cpu_buffer *cpu_buf, int code,
349 347
350 increment_tail(cpu_buf); /* move to RIP entry */ 348 increment_tail(cpu_buf); /* move to RIP entry */
351 349
352 rip = IBS_EIP(cpu_buf->tail_pos); 350 rip = IBS_EIP(cpu_buf);
353 351
354#ifdef __LP64__ 352#ifdef __LP64__
355 rip += IBS_EVENT(cpu_buf->tail_pos) << 32; 353 rip += IBS_EVENT(cpu_buf) << 32;
356#endif 354#endif
357 355
358 if (mm) { 356 if (mm) {
@@ -376,8 +374,8 @@ static void add_ibs_begin(struct oprofile_cpu_buffer *cpu_buf, int code,
376 add_event_entry(offset); /* Offset from Dcookie */ 374 add_event_entry(offset); /* Offset from Dcookie */
377 375
378 /* we send the Dcookie offset, but send the raw Linear Add also*/ 376 /* we send the Dcookie offset, but send the raw Linear Add also*/
379 add_event_entry(IBS_EIP(cpu_buf->tail_pos)); 377 add_event_entry(IBS_EIP(cpu_buf));
380 add_event_entry(IBS_EVENT(cpu_buf->tail_pos)); 378 add_event_entry(IBS_EVENT(cpu_buf));
381 379
382 if (code == IBS_FETCH_CODE) 380 if (code == IBS_FETCH_CODE)
383 count = IBS_FETCH_CODE_SIZE; /*IBS FETCH is 2 int64s*/ 381 count = IBS_FETCH_CODE_SIZE; /*IBS FETCH is 2 int64s*/
@@ -386,8 +384,8 @@ static void add_ibs_begin(struct oprofile_cpu_buffer *cpu_buf, int code,
386 384
387 for (i = 0; i < count; i++) { 385 for (i = 0; i < count; i++) {
388 increment_tail(cpu_buf); 386 increment_tail(cpu_buf);
389 add_event_entry(IBS_EIP(cpu_buf->tail_pos)); 387 add_event_entry(IBS_EIP(cpu_buf));
390 add_event_entry(IBS_EVENT(cpu_buf->tail_pos)); 388 add_event_entry(IBS_EVENT(cpu_buf));
391 } 389 }
392} 390}
393 391
@@ -584,7 +582,7 @@ void sync_buffer(int cpu)
584#else 582#else
585 while (get_slots(cpu_buf)) { 583 while (get_slots(cpu_buf)) {
586#endif 584#endif
587 struct op_sample *s = &cpu_buf->buffer[cpu_buf->tail_pos]; 585 struct op_sample *s = cpu_buffer_read_entry(cpu_buf);
588 586
589 if (is_code(s->eip)) { 587 if (is_code(s->eip)) {
590 switch (s->event) { 588 switch (s->event) {