Skip to content

Commit

Permalink
hw-breakpoints: Provide an off-case for counter_arch_bp()
Browse files Browse the repository at this point in the history
If an arch doesn't support the hw breakpoints, counter_arch_bp()
has no off case to cover the missing breakpoint info structure
from the perf event. The result is a build error in non-x86
configs.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1258114575-32655-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Prasad <prasad@linux.vnet.ibm.com>
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Nov 13, 2009
1 parent 59d8eb5 commit 687b16f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions include/linux/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ enum {
HW_BREAKPOINT_X = 4,
};

static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
{
return &bp->hw.info;
}

static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
{
return bp->attr.bp_addr;
Expand Down Expand Up @@ -83,6 +78,11 @@ extern void release_bp_slot(struct perf_event *bp);

extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk);

static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
{
return &bp->hw.info;
}

#else /* !CONFIG_HAVE_HW_BREAKPOINT */

static inline struct perf_event *
Expand Down Expand Up @@ -126,6 +126,11 @@ static inline void release_bp_slot(struct perf_event *bp) { }

static inline void flush_ptrace_hw_breakpoint(struct task_struct *tsk) { }

static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
{
return NULL;
}

#endif /* CONFIG_HAVE_HW_BREAKPOINT */

#endif /* _LINUX_HW_BREAKPOINT_H */

0 comments on commit 687b16f

Please sign in to comment.