cregit-Linux how code gets into the kernel

Release 4.7 include/linux/hw_breakpoint.h

Directory: include/linux
#ifndef _LINUX_HW_BREAKPOINT_H

#define _LINUX_HW_BREAKPOINT_H

#include <linux/perf_event.h>
#include <uapi/linux/hw_breakpoint.h>

#ifdef CONFIG_HAVE_HW_BREAKPOINT

extern int __init init_hw_breakpoint(void);


static inline void hw_breakpoint_init(struct perf_event_attr *attr) { memset(attr, 0, sizeof(*attr)); attr->type = PERF_TYPE_BREAKPOINT; attr->size = sizeof(*attr); /* * As it's for in-kernel or ptrace use, we want it to be pinned * and to call its callback every hits. */ attr->pinned = 1; attr->sample_period = 1; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker54100.00%3100.00%
Total54100.00%3100.00%


static inline void ptrace_breakpoint_init(struct perf_event_attr *attr) { hw_breakpoint_init(attr); attr->exclude_kernel = 1; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker23100.00%1100.00%
Total23100.00%1100.00%


static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) { return bp->attr.bp_addr; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker1785.00%150.00%
k.prasadk.prasad315.00%150.00%
Total20100.00%2100.00%


static inline int hw_breakpoint_type(struct perf_event *bp) { return bp->attr.bp_type; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker1789.47%150.00%
k.prasadk.prasad210.53%150.00%
Total19100.00%2100.00%


static inline unsigned long hw_breakpoint_len(struct perf_event *bp) { return bp->attr.bp_len; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker1890.00%150.00%
mahesh salgaonkarmahesh salgaonkar210.00%150.00%
Total20100.00%2100.00%

extern struct perf_event * register_user_hw_breakpoint(struct perf_event_attr *attr, perf_overflow_handler_t triggered, void *context, struct task_struct *tsk); /* FIXME: only change from the attr, and don't unregister */ extern int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr); /* * Kernel breakpoints are not associated with any particular thread. */ extern struct perf_event * register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, perf_overflow_handler_t triggered, void *context, int cpu); extern struct perf_event * __percpu * register_wide_hw_breakpoint(struct perf_event_attr *attr, perf_overflow_handler_t triggered, void *context); extern int register_perf_hw_breakpoint(struct perf_event *bp); extern int __register_perf_hw_breakpoint(struct perf_event *bp); extern void unregister_hw_breakpoint(struct perf_event *bp); extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events); extern int dbg_reserve_bp_slot(struct perf_event *bp); extern int dbg_release_bp_slot(struct perf_event *bp); extern int reserve_bp_slot(struct perf_event *bp); 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; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker22100.00%1100.00%
Total22100.00%1100.00%

#else /* !CONFIG_HAVE_HW_BREAKPOINT */
static inline int __init init_hw_breakpoint(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jason wesseljason wessel13100.00%1100.00%
Total13100.00%1100.00%


static inline struct perf_event * register_user_hw_breakpoint(struct perf_event_attr *attr, perf_overflow_handler_t triggered, void *context, struct task_struct *tsk) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker2586.21%375.00%
avi kivityavi kivity413.79%125.00%
Total29100.00%4100.00%


static inline int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker21100.00%4100.00%
Total21100.00%4100.00%


static inline struct perf_event * register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, perf_overflow_handler_t triggered, void *context, int cpu) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker2385.19%375.00%
avi kivityavi kivity414.81%125.00%
Total27100.00%4100.00%


static inline struct perf_event * __percpu * register_wide_hw_breakpoint(struct perf_event_attr *attr, perf_overflow_handler_t triggered, void *context) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker2180.77%360.00%
avi kivityavi kivity415.38%120.00%
tejun heotejun heo13.85%120.00%
Total26100.00%5100.00%


static inline int register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker16100.00%1100.00%
Total16100.00%1100.00%


static inline int __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker16100.00%1100.00%
Total16100.00%1100.00%


static inline void unregister_hw_breakpoint(struct perf_event *bp) { }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker11100.00%1100.00%
Total11100.00%1100.00%


static inline void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events) { }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker1292.31%150.00%
tejun heotejun heo17.69%150.00%
Total13100.00%2100.00%


static inline int reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker16100.00%1100.00%
Total16100.00%1100.00%


static inline void release_bp_slot(struct perf_event *bp) { }

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker11100.00%1100.00%
Total11100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker11100.00%1100.00%
Total11100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker17100.00%1100.00%
Total17100.00%1100.00%

#endif /* CONFIG_HAVE_HW_BREAKPOINT */ #endif /* _LINUX_HW_BREAKPOINT_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
frederic weisbeckerfrederic weisbecker46277.91%1263.16%
k.prasadk.prasad579.61%15.26%
jason wesseljason wessel416.91%210.53%
avi kivityavi kivity244.05%15.26%
tejun heotejun heo40.67%15.26%
david howellsdavid howells30.51%15.26%
mahesh salgaonkarmahesh salgaonkar20.34%15.26%
Total593100.00%19100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}