cregit-Linux how code gets into the kernel

Release 4.12 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
Frédéric 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
Frédéric 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
Frédéric Weisbecker1995.00%150.00%
K.Prasad15.00%150.00%
Total20100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker1894.74%150.00%
K.Prasad15.26%150.00%
Total19100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker1680.00%133.33%
Mahesh Salgaonkar210.00%133.33%
K.Prasad210.00%133.33%
Total20100.00%3100.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
Frédéric 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 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
Frédéric Weisbecker2586.21%375.00%
Avi 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
Frédéric 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
Frédéric Weisbecker2385.19%375.00%
Avi 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
Frédéric Weisbecker2180.77%360.00%
Avi Kivity415.38%120.00%
Tejun Heo13.85%120.00%
Total26100.00%5100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker16100.00%1100.00%
Total16100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker1593.75%150.00%
K.Prasad16.25%150.00%
Total16100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker11100.00%1100.00%
Total11100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker1292.31%150.00%
Tejun Heo17.69%150.00%
Total13100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker16100.00%1100.00%
Total16100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker11100.00%1100.00%
Total11100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Frédéric 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
Frédéric Weisbecker17100.00%1100.00%
Total17100.00%1100.00%

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

Overall Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker45977.40%1263.16%
K.Prasad6010.12%15.26%
Jason Wessel416.91%210.53%
Avi Kivity244.05%15.26%
Tejun Heo40.67%15.26%
David Howells30.51%15.26%
Mahesh 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.
Created with cregit.