Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24463
b: refs/heads/master
c: 2735771
h: refs/heads/master
i:
  24461: 3cf12d1
  24459: 67e6b17
  24455: d003708
  24447: f6c0f68
v: v3
  • Loading branch information
Brian Rogan authored and Linus Torvalds committed Mar 28, 2006
1 parent 4afbb95 commit 398ae7b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f83ca9fe3ee390755f18b4a7780c25ce593b484a
refs/heads/master: 273577165cd206d2d6689ee4b18aa13de1ec4bde
13 changes: 10 additions & 3 deletions trunk/drivers/oprofile/cpu_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,10 @@ static void oprofile_end_trace(struct oprofile_cpu_buffer * cpu_buf)
cpu_buf->tracing = 0;
}

void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
unsigned long event, int is_kernel)
{
struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
unsigned long pc = profile_pc(regs);
int is_kernel = !user_mode(regs);

if (!backtrace_depth) {
log_sample(cpu_buf, pc, is_kernel, event);
Expand All @@ -238,6 +237,14 @@ void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
oprofile_end_trace(cpu_buf);
}

void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
{
int is_kernel = !user_mode(regs);
unsigned long pc = profile_pc(regs);

oprofile_add_ext_sample(pc, regs, event, is_kernel);
}

void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event)
{
struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/oprofile.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ void oprofile_arch_exit(void);
*/
void oprofile_add_sample(struct pt_regs * const regs, unsigned long event);

/**
* Add an extended sample. Use this when the PC is not from the regs, and
* we cannot determine if we're in kernel mode from the regs.
*
* This function does perform a backtrace.
*
*/
void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
unsigned long event, int is_kernel);

/* Use this instead when the PC value is not from the regs. Doesn't
* backtrace. */
void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event);
Expand Down

0 comments on commit 398ae7b

Please sign in to comment.