Done opencode in_serving_softirq() checks in in_serving_softirq() to avoid cluttering the code, hide them in kcov helpers instead.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -52,6 +52,25 @@ static inline void kcov_remote_start_usb(u64 id) · 51 unmodified lines | ||
| 52 | 52 | kcov_remote_start(kcov_remote_handle(KCOV_SUBSYSTEM_USB, id)); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | +/* | |
| 56 | + * The softirq flavor of kcov_remote_*() functions is introduced as a temporary | |
| 57 | + * work around for kcov's lack of nested remote coverage sections support in | |
| 58 | + * task context. Adding suport for nested sections is tracked in: | |
| 59 | + * https://bugzilla.kernel.org/show_bug.cgi?id=210337 | |
| 60 | + */ | |
| 61 | + | |
| 62 | +static inline void kcov_remote_start_usb_softirq(u64 id) | |
| 63 | +{ | |
| 64 | + if (in_serving_softirq()) | |
| 65 | + kcov_remote_start_usb(id); | |
| 66 | +} | |
| 67 | + | |
| 68 | +static inline void kcov_remote_stop_softirq(void) | |
| 69 | +{ | |
| 70 | + if (in_serving_softirq()) | |
| 71 | + kcov_remote_stop(); | |
| 72 | +} | |
| 73 | + | |
| 55 | 74 | #else |
| 56 | 75 | |
| 57 | 76 | static inline void kcov_task_init(struct task_struct *t) {} |
| @@ -66,6 +85,8 @@ static inline u64 kcov_common_handle(void) · 8 unmodified lines | ||
| 66 | 85 | } |
| 67 | 86 | static inline void kcov_remote_start_common(u64 id) {} |
| 68 | 87 | static inline void kcov_remote_start_usb(u64 id) {} |
| 88 | +static inline void kcov_remote_start_usb_softirq(u64 id) {} | |
| 89 | +static inline void kcov_remote_stop_softirq(void) {} | |
| 69 | 90 | |
| 70 | 91 | #endif /* CONFIG_KCOV */ |
| 71 | 92 | #endif /* _LINUX_KCOV_H */ |