Add file: lttng-kernel-version.h
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · * Simon Marchi ([email protected]) wrote:
It contains a macro to help checking for kernel version ranges.
Merged with small cosmetic changes,
Oh damn, I forgot the --author. Sorry, it appears From: me.
Thanks,
Mathieu
Quoted 57 lines
Signed-off-by Simon Marchi <[email protected]>--- lttng-kernel-version.h | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 lttng-kernel-version.hlttng-kernel-version.h new file +36
-0@@ -0,0 +1,36 @@ +#ifndef _LTTNG_KERNEL_VERSION_H +#define _LTTNG_KERNEL_VERSION_H + +/* +* lttng-events.h +* +* Contains helpers to check more complex kernel version conditions. +* +* Copyright (C) 2012 Mathieu Desnoyers <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; only +* version 2.1 of the License. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include <linux/version.h> + +/* +* This macro checks if the kernel version is between the two specified +* versions. +*/ +#define LTTNG_KERNEL_RANGE (a_low, b_low, c_low, a_high, b_high, c_high) \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(a_low, b_low, c_low) && \ + LINUX_VERSION_CODE <= KERNEL_VERSION(a_high, b_high, c_high)) + +#endif /* _LTTNG_KERNEL_VERSION_H */ Signature · 7 lines
1.7.1 _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com