Skip to content

Commit

Permalink
hw-breakpoints: Fix build on !perf architectures
Browse files Browse the repository at this point in the history
the arch/alpha build fails with:

 In file included from tip/kernel/exit.c:52:
 tip/include/linux/hw_breakpoint.h: In function 'hw_breakpoint_addr':
 tip/include/linux/hw_breakpoint.h:21: error: 'struct perf_event' has no member named 'attr'
 [...]

Move these helper inlines inside the CONFIG_HAVE_HW_BREAKPOINT ifdef.

Cc: 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>
  • Loading branch information
Ingo Molnar committed Nov 14, 2009
1 parent 687b16f commit 688bcaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ enum {
HW_BREAKPOINT_X = 4,
};

#ifdef CONFIG_HAVE_HW_BREAKPOINT

static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
{
return bp->attr.bp_addr;
Expand All @@ -31,7 +33,6 @@ static inline int hw_breakpoint_len(struct perf_event *bp)
return bp->attr.bp_len;
}

#ifdef CONFIG_HAVE_HW_BREAKPOINT
extern struct perf_event *
register_user_hw_breakpoint(unsigned long addr,
int len,
Expand Down

0 comments on commit 688bcaf

Please sign in to comment.