Loading arch/x86/oprofile/op_model_amd.c +16 −15 Original line number Diff line number Diff line Loading @@ -65,8 +65,10 @@ static unsigned long reset_value[NUM_COUNTERS]; #define IBS_FETCH_BEGIN 3 #define IBS_OP_BEGIN 4 /* The function interface needs to be fixed, something like add data. Should then be added to linux/oprofile.h. */ /* * The function interface needs to be fixed, something like add * data. Should then be added to linux/oprofile.h. */ extern void oprofile_add_ibs_sample(struct pt_regs *const regs, unsigned int *const ibs_sample, int ibs_code); Loading Loading @@ -331,8 +333,10 @@ static void op_amd_stop(struct op_msrs const * const msrs) unsigned int low, high; int i; /* Subtle: stop on all counters to avoid race with * setting our pm callback */ /* * Subtle: stop on all counters to avoid race with setting our * pm callback */ for (i = 0 ; i < NUM_COUNTERS ; ++i) { if (!reset_value[i]) continue; Loading @@ -343,13 +347,15 @@ static void op_amd_stop(struct op_msrs const * const msrs) #ifdef CONFIG_OPROFILE_IBS if (ibs_allowed && ibs_config.fetch_enabled) { low = 0; /* clear max count and enable */ /* clear max count and enable */ low = 0; high = 0; wrmsr(MSR_AMD64_IBSFETCHCTL, low, high); } if (ibs_allowed && ibs_config.op_enabled) { low = 0; /* clear max count and enable */ /* clear max count and enable */ low = 0; high = 0; wrmsr(MSR_AMD64_IBSOPCTL, low, high); } Loading Loading @@ -443,10 +449,7 @@ static int pfm_amd64_setup_eilvt(void) return 0; } /* * initialize the APIC for the IBS interrupts * if available (AMD Family10h rev B0 and later) */ /* initialize the APIC for the IBS interrupts if available */ static void setup_ibs(void) { ibs_allowed = boot_cpu_has(X86_FEATURE_IBS); Loading @@ -463,9 +466,7 @@ static void setup_ibs(void) } /* * unitialize the APIC for the IBS interrupts if needed on AMD Family10h * rev B0 and later */ /* uninitialize the APIC for the IBS interrupts if needed */ static void clear_ibs_nmi(void) { if (ibs_allowed) Loading drivers/oprofile/cpu_buffer.c +16 −9 Original line number Diff line number Diff line Loading @@ -127,9 +127,10 @@ void end_cpu_work(void) /* Resets the cpu buffer to a sane state. */ void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf) { /* reset these to invalid values; the next sample * collected will populate the buffer with proper * values to initialize the buffer /* * reset these to invalid values; the next sample collected * will populate the buffer with proper values to initialize * the buffer */ cpu_buf->last_is_kernel = -1; cpu_buf->last_task = NULL; Loading @@ -151,8 +152,10 @@ static void increment_head(struct oprofile_cpu_buffer *b) { unsigned long new_head = b->head_pos + 1; /* Ensure anything written to the slot before we * increment is visible */ /* * Ensure anything written to the slot before we increment is * visible */ wmb(); if (new_head < b->buffer_size) Loading Loading @@ -253,8 +256,10 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, if (!oprofile_begin_trace(cpu_buf)) return; /* if log_sample() fail we can't backtrace since we lost the source * of this event */ /* * if log_sample() fail we can't backtrace since we lost the * source of this event */ if (log_sample(cpu_buf, pc, is_kernel, event)) oprofile_ops.backtrace(regs, backtrace_depth); oprofile_end_trace(cpu_buf); Loading Loading @@ -338,8 +343,10 @@ void oprofile_add_trace(unsigned long pc) return; } /* broken frame can give an eip with the same value as an escape code, * abort the trace if we get it */ /* * broken frame can give an eip with the same value as an * escape code, abort the trace if we get it */ if (pc == ESCAPE_CODE) { cpu_buf->tracing = 0; cpu_buf->backtrace_aborted++; Loading Loading
arch/x86/oprofile/op_model_amd.c +16 −15 Original line number Diff line number Diff line Loading @@ -65,8 +65,10 @@ static unsigned long reset_value[NUM_COUNTERS]; #define IBS_FETCH_BEGIN 3 #define IBS_OP_BEGIN 4 /* The function interface needs to be fixed, something like add data. Should then be added to linux/oprofile.h. */ /* * The function interface needs to be fixed, something like add * data. Should then be added to linux/oprofile.h. */ extern void oprofile_add_ibs_sample(struct pt_regs *const regs, unsigned int *const ibs_sample, int ibs_code); Loading Loading @@ -331,8 +333,10 @@ static void op_amd_stop(struct op_msrs const * const msrs) unsigned int low, high; int i; /* Subtle: stop on all counters to avoid race with * setting our pm callback */ /* * Subtle: stop on all counters to avoid race with setting our * pm callback */ for (i = 0 ; i < NUM_COUNTERS ; ++i) { if (!reset_value[i]) continue; Loading @@ -343,13 +347,15 @@ static void op_amd_stop(struct op_msrs const * const msrs) #ifdef CONFIG_OPROFILE_IBS if (ibs_allowed && ibs_config.fetch_enabled) { low = 0; /* clear max count and enable */ /* clear max count and enable */ low = 0; high = 0; wrmsr(MSR_AMD64_IBSFETCHCTL, low, high); } if (ibs_allowed && ibs_config.op_enabled) { low = 0; /* clear max count and enable */ /* clear max count and enable */ low = 0; high = 0; wrmsr(MSR_AMD64_IBSOPCTL, low, high); } Loading Loading @@ -443,10 +449,7 @@ static int pfm_amd64_setup_eilvt(void) return 0; } /* * initialize the APIC for the IBS interrupts * if available (AMD Family10h rev B0 and later) */ /* initialize the APIC for the IBS interrupts if available */ static void setup_ibs(void) { ibs_allowed = boot_cpu_has(X86_FEATURE_IBS); Loading @@ -463,9 +466,7 @@ static void setup_ibs(void) } /* * unitialize the APIC for the IBS interrupts if needed on AMD Family10h * rev B0 and later */ /* uninitialize the APIC for the IBS interrupts if needed */ static void clear_ibs_nmi(void) { if (ibs_allowed) Loading
drivers/oprofile/cpu_buffer.c +16 −9 Original line number Diff line number Diff line Loading @@ -127,9 +127,10 @@ void end_cpu_work(void) /* Resets the cpu buffer to a sane state. */ void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf) { /* reset these to invalid values; the next sample * collected will populate the buffer with proper * values to initialize the buffer /* * reset these to invalid values; the next sample collected * will populate the buffer with proper values to initialize * the buffer */ cpu_buf->last_is_kernel = -1; cpu_buf->last_task = NULL; Loading @@ -151,8 +152,10 @@ static void increment_head(struct oprofile_cpu_buffer *b) { unsigned long new_head = b->head_pos + 1; /* Ensure anything written to the slot before we * increment is visible */ /* * Ensure anything written to the slot before we increment is * visible */ wmb(); if (new_head < b->buffer_size) Loading Loading @@ -253,8 +256,10 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, if (!oprofile_begin_trace(cpu_buf)) return; /* if log_sample() fail we can't backtrace since we lost the source * of this event */ /* * if log_sample() fail we can't backtrace since we lost the * source of this event */ if (log_sample(cpu_buf, pc, is_kernel, event)) oprofile_ops.backtrace(regs, backtrace_depth); oprofile_end_trace(cpu_buf); Loading Loading @@ -338,8 +343,10 @@ void oprofile_add_trace(unsigned long pc) return; } /* broken frame can give an eip with the same value as an escape code, * abort the trace if we get it */ /* * broken frame can give an eip with the same value as an * escape code, abort the trace if we get it */ if (pc == ESCAPE_CODE) { cpu_buf->tracing = 0; cpu_buf->backtrace_aborted++; Loading