aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/oprofile/op_model_amd.c27
-rw-r--r--drivers/oprofile/cpu_buffer.c15
-rw-r--r--include/linux/oprofile.h1
3 files changed, 25 insertions, 18 deletions
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
index 6493ef7ae9ad..cc930467575d 100644
--- a/arch/x86/oprofile/op_model_amd.c
+++ b/arch/x86/oprofile/op_model_amd.c
@@ -140,13 +140,10 @@ op_amd_handle_ibs(struct pt_regs * const regs,
140 rdmsrl(MSR_AMD64_IBSFETCHLINAD, val); 140 rdmsrl(MSR_AMD64_IBSFETCHLINAD, val);
141 oprofile_write_reserve(&entry, regs, val, 141 oprofile_write_reserve(&entry, regs, val,
142 IBS_FETCH_CODE, IBS_FETCH_SIZE); 142 IBS_FETCH_CODE, IBS_FETCH_SIZE);
143 oprofile_add_data(&entry, (u32)val); 143 oprofile_add_data64(&entry, val);
144 oprofile_add_data(&entry, (u32)(val >> 32)); 144 oprofile_add_data64(&entry, ctl);
145 oprofile_add_data(&entry, (u32)ctl);
146 oprofile_add_data(&entry, (u32)(ctl >> 32));
147 rdmsrl(MSR_AMD64_IBSFETCHPHYSAD, val); 145 rdmsrl(MSR_AMD64_IBSFETCHPHYSAD, val);
148 oprofile_add_data(&entry, (u32)val); 146 oprofile_add_data64(&entry, val);
149 oprofile_add_data(&entry, (u32)(val >> 32));
150 oprofile_write_commit(&entry); 147 oprofile_write_commit(&entry);
151 148
152 /* reenable the IRQ */ 149 /* reenable the IRQ */
@@ -162,23 +159,17 @@ op_amd_handle_ibs(struct pt_regs * const regs,
162 rdmsrl(MSR_AMD64_IBSOPRIP, val); 159 rdmsrl(MSR_AMD64_IBSOPRIP, val);
163 oprofile_write_reserve(&entry, regs, val, 160 oprofile_write_reserve(&entry, regs, val,
164 IBS_OP_CODE, IBS_OP_SIZE); 161 IBS_OP_CODE, IBS_OP_SIZE);
165 oprofile_add_data(&entry, (u32)val); 162 oprofile_add_data64(&entry, val);
166 oprofile_add_data(&entry, (u32)(val >> 32));
167 rdmsrl(MSR_AMD64_IBSOPDATA, val); 163 rdmsrl(MSR_AMD64_IBSOPDATA, val);
168 oprofile_add_data(&entry, (u32)val); 164 oprofile_add_data64(&entry, val);
169 oprofile_add_data(&entry, (u32)(val >> 32));
170 rdmsrl(MSR_AMD64_IBSOPDATA2, val); 165 rdmsrl(MSR_AMD64_IBSOPDATA2, val);
171 oprofile_add_data(&entry, (u32)val); 166 oprofile_add_data64(&entry, val);
172 oprofile_add_data(&entry, (u32)(val >> 32));
173 rdmsrl(MSR_AMD64_IBSOPDATA3, val); 167 rdmsrl(MSR_AMD64_IBSOPDATA3, val);
174 oprofile_add_data(&entry, (u32)val); 168 oprofile_add_data64(&entry, val);
175 oprofile_add_data(&entry, (u32)(val >> 32));
176 rdmsrl(MSR_AMD64_IBSDCLINAD, val); 169 rdmsrl(MSR_AMD64_IBSDCLINAD, val);
177 oprofile_add_data(&entry, (u32)val); 170 oprofile_add_data64(&entry, val);
178 oprofile_add_data(&entry, (u32)(val >> 32));
179 rdmsrl(MSR_AMD64_IBSDCPHYSAD, val); 171 rdmsrl(MSR_AMD64_IBSDCPHYSAD, val);
180 oprofile_add_data(&entry, (u32)val); 172 oprofile_add_data64(&entry, val);
181 oprofile_add_data(&entry, (u32)(val >> 32));
182 oprofile_write_commit(&entry); 173 oprofile_write_commit(&entry);
183 174
184 /* reenable the IRQ */ 175 /* reenable the IRQ */
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index 50640cc5eef2..a7aae24f2889 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -406,6 +406,21 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val)
406 return op_cpu_buffer_add_data(entry, val); 406 return op_cpu_buffer_add_data(entry, val);
407} 407}
408 408
409int oprofile_add_data64(struct op_entry *entry, u64 val)
410{
411 if (!entry->event)
412 return 0;
413 if (op_cpu_buffer_get_size(entry) < 2)
414 /*
415 * the function returns 0 to indicate a too small
416 * buffer, even if there is some space left
417 */
418 return 0;
419 if (!op_cpu_buffer_add_data(entry, (u32)val))
420 return 0;
421 return op_cpu_buffer_add_data(entry, (u32)(val >> 32));
422}
423
409int oprofile_write_commit(struct op_entry *entry) 424int oprofile_write_commit(struct op_entry *entry)
410{ 425{
411 if (!entry->event) 426 if (!entry->event)
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index dbbe2dbc4418..d68d2ed94f15 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -179,6 +179,7 @@ void oprofile_write_reserve(struct op_entry *entry,
179 struct pt_regs * const regs, 179 struct pt_regs * const regs,
180 unsigned long pc, int code, int size); 180 unsigned long pc, int code, int size);
181int oprofile_add_data(struct op_entry *entry, unsigned long val); 181int oprofile_add_data(struct op_entry *entry, unsigned long val);
182int oprofile_add_data64(struct op_entry *entry, u64 val);
182int oprofile_write_commit(struct op_entry *entry); 183int oprofile_write_commit(struct op_entry *entry);
183 184
184#endif /* OPROFILE_H */ 185#endif /* OPROFILE_H */