diff options
author | Robert Richter <robert.richter@amd.com> | 2008-07-22 15:09:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-26 05:48:13 -0400 |
commit | 852402cc27bfa1200164e9e8dc7f6e5f0a4fbd46 (patch) | |
tree | 0194e23373230888de9115f5ffaacb09e005b57a /drivers/oprofile/buffer_sync.c | |
parent | 6aa360e6c16c145edf1837690e0f7aaea6b86ef3 (diff) |
x86/oprofile: add CONFIG_OPROFILE_IBS option
Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: oprofile-list <oprofile-list@lists.sourceforge.net>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Barry Kasindorf <barry.kasindorf@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/oprofile/buffer_sync.c')
-rw-r--r-- | drivers/oprofile/buffer_sync.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c index e1782d2df09f..ed982273fb8b 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c | |||
@@ -328,6 +328,8 @@ static void add_trace_begin(void) | |||
328 | add_event_entry(TRACE_BEGIN_CODE); | 328 | add_event_entry(TRACE_BEGIN_CODE); |
329 | } | 329 | } |
330 | 330 | ||
331 | #ifdef CONFIG_OPROFILE_IBS | ||
332 | |||
331 | #define IBS_FETCH_CODE_SIZE 2 | 333 | #define IBS_FETCH_CODE_SIZE 2 |
332 | #define IBS_OP_CODE_SIZE 5 | 334 | #define IBS_OP_CODE_SIZE 5 |
333 | #define IBS_EIP(offset) \ | 335 | #define IBS_EIP(offset) \ |
@@ -390,6 +392,8 @@ static void add_ibs_begin(struct oprofile_cpu_buffer *cpu_buf, int code, | |||
390 | } | 392 | } |
391 | } | 393 | } |
392 | 394 | ||
395 | #endif | ||
396 | |||
393 | static void add_sample_entry(unsigned long offset, unsigned long event) | 397 | static void add_sample_entry(unsigned long offset, unsigned long event) |
394 | { | 398 | { |
395 | add_event_entry(offset); | 399 | add_event_entry(offset); |
@@ -586,6 +590,7 @@ void sync_buffer(int cpu) | |||
586 | } else if (s->event == CPU_TRACE_BEGIN) { | 590 | } else if (s->event == CPU_TRACE_BEGIN) { |
587 | state = sb_bt_start; | 591 | state = sb_bt_start; |
588 | add_trace_begin(); | 592 | add_trace_begin(); |
593 | #ifdef CONFIG_OPROFILE_IBS | ||
589 | } else if (s->event == IBS_FETCH_BEGIN) { | 594 | } else if (s->event == IBS_FETCH_BEGIN) { |
590 | state = sb_bt_start; | 595 | state = sb_bt_start; |
591 | add_ibs_begin(cpu_buf, | 596 | add_ibs_begin(cpu_buf, |
@@ -594,6 +599,7 @@ void sync_buffer(int cpu) | |||
594 | state = sb_bt_start; | 599 | state = sb_bt_start; |
595 | add_ibs_begin(cpu_buf, | 600 | add_ibs_begin(cpu_buf, |
596 | IBS_OP_CODE, in_kernel, mm); | 601 | IBS_OP_CODE, in_kernel, mm); |
602 | #endif | ||
597 | } else { | 603 | } else { |
598 | struct mm_struct *oldmm = mm; | 604 | struct mm_struct *oldmm = mm; |
599 | 605 | ||