Skip to content

Commit

Permalink
oprofile: simplify oprofile_begin_trace()
Browse files Browse the repository at this point in the history
This patch removes the unused return parameter in
oprofile_begin_trace(). Also, oprofile_begin_trace() and
oprofile_end_trace() are inline now.

Signed-off-by: Robert Richter <robert.richter@amd.com>
  • Loading branch information
Robert Richter committed Dec 29, 2008
1 parent 317f33b commit 6352d92
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/oprofile/cpu_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,13 @@ static int log_sample(struct oprofile_cpu_buffer *cpu_buf, unsigned long pc,
return 0;
}

static int oprofile_begin_trace(struct oprofile_cpu_buffer *cpu_buf)
static inline void oprofile_begin_trace(struct oprofile_cpu_buffer *cpu_buf)
{
add_code(cpu_buf, CPU_TRACE_BEGIN);
cpu_buf->tracing = 1;
return 1;
}

static void oprofile_end_trace(struct oprofile_cpu_buffer *cpu_buf)
static inline void oprofile_end_trace(struct oprofile_cpu_buffer *cpu_buf)
{
cpu_buf->tracing = 0;
}
Expand All @@ -288,15 +287,15 @@ __oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
return;
}

if (!oprofile_begin_trace(cpu_buf))
return;
oprofile_begin_trace(cpu_buf);

/*
* 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, oprofile_backtrace_depth);

oprofile_end_trace(cpu_buf);
}

Expand Down

0 comments on commit 6352d92

Please sign in to comment.