Skip to content

Commit d45d23b

Browse files
author
Robert Richter
committed
oprofile: add inline function __oprofile_add_ext_sample()
This patch adds the inline function __oprofile_add_ext_sample() to cpu_buffer.c and thus reduces overhead when calling oprofile_add_sample(). Signed-off-by: Robert Richter <robert.richter@amd.com>
1 parent 3001577 commit d45d23b

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎drivers/oprofile/cpu_buffer.c‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ static void oprofile_end_trace(struct oprofile_cpu_buffer *cpu_buf)
277277
cpu_buf->tracing = 0;
278278
}
279279

280-
void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
281-
unsigned long event, int is_kernel)
280+
static inline void
281+
__oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
282+
unsigned long event, int is_kernel)
282283
{
283284
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer);
284285

@@ -299,12 +300,18 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
299300
oprofile_end_trace(cpu_buf);
300301
}
301302

303+
void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
304+
unsigned long event, int is_kernel)
305+
{
306+
__oprofile_add_ext_sample(pc, regs, event, is_kernel);
307+
}
308+
302309
void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
303310
{
304311
int is_kernel = !user_mode(regs);
305312
unsigned long pc = profile_pc(regs);
306313

307-
oprofile_add_ext_sample(pc, regs, event, is_kernel);
314+
__oprofile_add_ext_sample(pc, regs, event, is_kernel);
308315
}
309316

310317
#ifdef CONFIG_OPROFILE_IBS

0 commit comments

Comments
 (0)