Skip to content

Commit 16ef7df

Browse files
author
Luca Marturana
committed
Don't fail if this_cpu_inc does not exist
1 parent b08ba64 commit 16ef7df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

driver/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,8 +1799,11 @@ static inline void g_n_tracepoint_hit_inc(void)
17991799
{
18001800
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
18011801
this_cpu_inc(g_n_tracepoint_hit);
1802-
#else
1803-
/*
1802+
#elif defined(this_cpu_inc)
1803+
/* this_cpu_inc has been added with 2.6.33 but backported by RHEL/CentOS to 2.6.32
1804+
* so just checking the existence of the symbol rather than matching the kernel version
1805+
* https://github.com/torvalds/linux/commit/7340a0b15280c9d902c7dd0608b8e751b5a7c403
1806+
*
18041807
* per_cpu_var removed with:
18051808
* https://github.com/torvalds/linux/commit/dd17c8f72993f9461e9c19250e3f155d6d99df22
18061809
*/

0 commit comments

Comments
 (0)