All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] backports: add ktime_get_seconds()
@ 2015-10-23 11:52 Johannes Berg
  2015-10-28 21:17 ` Arend van Spriel
  2015-11-07 17:08 ` Hauke Mehrtens
  0 siblings, 2 replies; 13+ messages in thread
From: Johannes Berg @ 2015-10-23 11:52 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Since commit 84b00607aeb8 ("mac80211: use ktime_get_seconds")
mac80211 uses ktime_get_seconds(). This patch provide a backport
using ktime_get_ts() for it.

[commit message and time64_t taken from Arend's patch]

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/ktime.h       |  1 +
 backport/backport-include/linux/timekeeping.h | 21 +++++++++++++++++++++
 backport/backport-include/linux/types.h       | 10 ++++++++++
 3 files changed, 32 insertions(+)
 create mode 100644 backport/backport-include/linux/timekeeping.h
 create mode 100644 backport/backport-include/linux/types.h

diff --git a/backport/backport-include/linux/ktime.h b/backport/backport-include/linux/ktime.h
index 6fbc6c6eb26c..33ed31caf01a 100644
--- a/backport/backport-include/linux/ktime.h
+++ b/backport/backport-include/linux/ktime.h
@@ -1,6 +1,7 @@
 #ifndef __BACKPORT_LINUX_KTIME_H
 #define __BACKPORT_LINUX_KTIME_H
 #include_next <linux/ktime.h>
+#include <linux/timekeeping.h>
 #include <linux/version.h>
 
 #if  LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h
new file mode 100644
index 000000000000..4fb39b2c0119
--- /dev/null
+++ b/backport/backport-include/linux/timekeeping.h
@@ -0,0 +1,21 @@
+#ifndef __BACKPORT_TIMKEEPING_H
+#define __BACKPORT_TIMKEEPING_H
+#include <linux/version.h>
+#include <linux/types.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+#include_next <linux/timekeeping.h>
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
+static inline time64_t ktime_get_seconds(void)
+{
+	struct timespec t;
+
+	ktime_get_ts(&t);
+
+	return t.tv_sec;
+}
+#endif
+
+#endif /* __BACKPORT_TIMKEEPING_H */
diff --git a/backport/backport-include/linux/types.h b/backport/backport-include/linux/types.h
new file mode 100644
index 000000000000..d68e39c54325
--- /dev/null
+++ b/backport/backport-include/linux/types.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_TYPES
+#define __BACKPORT_TYPES
+#include <linux/version.h>
+#include_next <linux/types.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+typedef __s64 time64_t;
+#endif
+
+#endif /* __BACKPORT_TYPES */
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-10-23 11:52 [PATCH v2] backports: add ktime_get_seconds() Johannes Berg
@ 2015-10-28 21:17 ` Arend van Spriel
  2015-10-31 22:03   ` Arend van Spriel
  2015-11-07 17:08 ` Hauke Mehrtens
  1 sibling, 1 reply; 13+ messages in thread
From: Arend van Spriel @ 2015-10-28 21:17 UTC (permalink / raw)
  To: Johannes Berg, backports; +Cc: Johannes Berg

On 10/23/2015 01:52 PM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Since commit 84b00607aeb8 ("mac80211: use ktime_get_seconds")
> mac80211 uses ktime_get_seconds(). This patch provide a backport
> using ktime_get_ts() for it.
>
> [commit message and time64_t taken from Arend's patch]
>
> Signed-off-by: Arend van Spriel <arend@broadcom.com>

Looks good. Thanks.

Regards,
Arend

> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>   backport/backport-include/linux/ktime.h       |  1 +
>   backport/backport-include/linux/timekeeping.h | 21 +++++++++++++++++++++
>   backport/backport-include/linux/types.h       | 10 ++++++++++
>   3 files changed, 32 insertions(+)
>   create mode 100644 backport/backport-include/linux/timekeeping.h
>   create mode 100644 backport/backport-include/linux/types.h
>
> diff --git a/backport/backport-include/linux/ktime.h b/backport/backport-include/linux/ktime.h
> index 6fbc6c6eb26c..33ed31caf01a 100644
> --- a/backport/backport-include/linux/ktime.h
> +++ b/backport/backport-include/linux/ktime.h
> @@ -1,6 +1,7 @@
>   #ifndef __BACKPORT_LINUX_KTIME_H
>   #define __BACKPORT_LINUX_KTIME_H
>   #include_next <linux/ktime.h>
> +#include <linux/timekeeping.h>
>   #include <linux/version.h>
>
>   #if  LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
> diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h
> new file mode 100644
> index 000000000000..4fb39b2c0119
> --- /dev/null
> +++ b/backport/backport-include/linux/timekeeping.h
> @@ -0,0 +1,21 @@
> +#ifndef __BACKPORT_TIMKEEPING_H
> +#define __BACKPORT_TIMKEEPING_H
> +#include <linux/version.h>
> +#include <linux/types.h>
> +
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
> +#include_next <linux/timekeeping.h>
> +#endif
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
> +static inline time64_t ktime_get_seconds(void)
> +{
> +	struct timespec t;
> +
> +	ktime_get_ts(&t);
> +
> +	return t.tv_sec;
> +}
> +#endif
> +
> +#endif /* __BACKPORT_TIMKEEPING_H */
> diff --git a/backport/backport-include/linux/types.h b/backport/backport-include/linux/types.h
> new file mode 100644
> index 000000000000..d68e39c54325
> --- /dev/null
> +++ b/backport/backport-include/linux/types.h
> @@ -0,0 +1,10 @@
> +#ifndef __BACKPORT_TYPES
> +#define __BACKPORT_TYPES
> +#include <linux/version.h>
> +#include_next <linux/types.h>
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
> +typedef __s64 time64_t;
> +#endif
> +
> +#endif /* __BACKPORT_TYPES */
>

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-10-28 21:17 ` Arend van Spriel
@ 2015-10-31 22:03   ` Arend van Spriel
  2015-11-01  7:47     ` Johannes Berg
  0 siblings, 1 reply; 13+ messages in thread
From: Arend van Spriel @ 2015-10-31 22:03 UTC (permalink / raw)
  To: Johannes Berg, backports; +Cc: Johannes Berg

On 10/28/2015 10:17 PM, Arend van Spriel wrote:
> On 10/23/2015 01:52 PM, Johannes Berg wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>>
>> Since commit 84b00607aeb8 ("mac80211: use ktime_get_seconds")
>> mac80211 uses ktime_get_seconds(). This patch provide a backport
>> using ktime_get_ts() for it.
>>
>> [commit message and time64_t taken from Arend's patch]
>>
>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
>
> Looks good. Thanks.

Actually got feedback internally that ubuntu kernel 3.19.0-30-generic 
does not need this patch so should we extend this with 
UTS_UBUNTU_RELEASE_ABI check?

Regards,
Arend

> Regards,
> Arend
>
>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>> ---
>>   backport/backport-include/linux/ktime.h       |  1 +
>>   backport/backport-include/linux/timekeeping.h | 21
>> +++++++++++++++++++++
>>   backport/backport-include/linux/types.h       | 10 ++++++++++
>>   3 files changed, 32 insertions(+)
>>   create mode 100644 backport/backport-include/linux/timekeeping.h
>>   create mode 100644 backport/backport-include/linux/types.h
>>
>> diff --git a/backport/backport-include/linux/ktime.h
>> b/backport/backport-include/linux/ktime.h
>> index 6fbc6c6eb26c..33ed31caf01a 100644
>> --- a/backport/backport-include/linux/ktime.h
>> +++ b/backport/backport-include/linux/ktime.h
>> @@ -1,6 +1,7 @@
>>   #ifndef __BACKPORT_LINUX_KTIME_H
>>   #define __BACKPORT_LINUX_KTIME_H
>>   #include_next <linux/ktime.h>
>> +#include <linux/timekeeping.h>
>>   #include <linux/version.h>
>>
>>   #if  LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
>> diff --git a/backport/backport-include/linux/timekeeping.h
>> b/backport/backport-include/linux/timekeeping.h
>> new file mode 100644
>> index 000000000000..4fb39b2c0119
>> --- /dev/null
>> +++ b/backport/backport-include/linux/timekeeping.h
>> @@ -0,0 +1,21 @@
>> +#ifndef __BACKPORT_TIMKEEPING_H
>> +#define __BACKPORT_TIMKEEPING_H
>> +#include <linux/version.h>
>> +#include <linux/types.h>
>> +
>> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
>> +#include_next <linux/timekeeping.h>
>> +#endif
>> +
>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
>> +static inline time64_t ktime_get_seconds(void)
>> +{
>> +    struct timespec t;
>> +
>> +    ktime_get_ts(&t);
>> +
>> +    return t.tv_sec;
>> +}
>> +#endif
>> +
>> +#endif /* __BACKPORT_TIMKEEPING_H */
>> diff --git a/backport/backport-include/linux/types.h
>> b/backport/backport-include/linux/types.h
>> new file mode 100644
>> index 000000000000..d68e39c54325
>> --- /dev/null
>> +++ b/backport/backport-include/linux/types.h
>> @@ -0,0 +1,10 @@
>> +#ifndef __BACKPORT_TYPES
>> +#define __BACKPORT_TYPES
>> +#include <linux/version.h>
>> +#include_next <linux/types.h>
>> +
>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
>> +typedef __s64 time64_t;
>> +#endif
>> +
>> +#endif /* __BACKPORT_TYPES */
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe backports" in

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-10-31 22:03   ` Arend van Spriel
@ 2015-11-01  7:47     ` Johannes Berg
  0 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2015-11-01  7:47 UTC (permalink / raw)
  To: Arend van Spriel, backports

On Sat, 2015-10-31 at 23:03 +0100, Arend van Spriel wrote:
> On 10/28/2015 10:17 PM, Arend van Spriel wrote:
> > On 10/23/2015 01:52 PM, Johannes Berg wrote:
> > > From: Johannes Berg <johannes.berg@intel.com>
> > > 
> > > Since commit 84b00607aeb8 ("mac80211: use ktime_get_seconds")
> > > mac80211 uses ktime_get_seconds(). This patch provide a backport
> > > using ktime_get_ts() for it.
> > > 
> > > [commit message and time64_t taken from Arend's patch]
> > > 
> > > Signed-off-by: Arend van Spriel <arend@broadcom.com>
> > 
> > Looks good. Thanks.
> 
> Actually got feedback internally that ubuntu kernel 3.19.0-30-generic 
> 
> does not need this patch so should we extend this with 
> UTS_UBUNTU_RELEASE_ABI check?
> 

If they backported that, then yeah, probably something like that --
unless we can find some #define that came with the backport to check
on?

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-10-23 11:52 [PATCH v2] backports: add ktime_get_seconds() Johannes Berg
  2015-10-28 21:17 ` Arend van Spriel
@ 2015-11-07 17:08 ` Hauke Mehrtens
  2015-12-08  8:44   ` Arend van Spriel
  1 sibling, 1 reply; 13+ messages in thread
From: Hauke Mehrtens @ 2015-11-07 17:08 UTC (permalink / raw)
  To: Johannes Berg, backports; +Cc: Johannes Berg

On 10/23/2015 01:52 PM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Since commit 84b00607aeb8 ("mac80211: use ktime_get_seconds")
> mac80211 uses ktime_get_seconds(). This patch provide a backport
> using ktime_get_ts() for it.
> 
> [commit message and time64_t taken from Arend's patch]
> 
> Signed-off-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  backport/backport-include/linux/ktime.h       |  1 +
>  backport/backport-include/linux/timekeeping.h | 21 +++++++++++++++++++++
>  backport/backport-include/linux/types.h       | 10 ++++++++++
>  3 files changed, 32 insertions(+)
>  create mode 100644 backport/backport-include/linux/timekeeping.h
>  create mode 100644 backport/backport-include/linux/types.h
> 
Thank you for the patch, it was applied.

Hauke

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-11-07 17:08 ` Hauke Mehrtens
@ 2015-12-08  8:44   ` Arend van Spriel
  2015-12-08  9:04     ` Johannes Berg
  2015-12-09 22:48     ` Hauke Mehrtens
  0 siblings, 2 replies; 13+ messages in thread
From: Arend van Spriel @ 2015-12-08  8:44 UTC (permalink / raw)
  To: Hauke Mehrtens, Johannes Berg, backports; +Cc: Johannes Berg

On 11/07/2015 06:08 PM, Hauke Mehrtens wrote:
> On 10/23/2015 01:52 PM, Johannes Berg wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>>
>> Since commit 84b00607aeb8 ("mac80211: use ktime_get_seconds")
>> mac80211 uses ktime_get_seconds(). This patch provide a backport
>> using ktime_get_ts() for it.
>>
>> [commit message and time64_t taken from Arend's patch]
>>
>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>> ---
>>   backport/backport-include/linux/ktime.h       |  1 +
>>   backport/backport-include/linux/timekeeping.h | 21 +++++++++++++++++++++
>>   backport/backport-include/linux/types.h       | 10 ++++++++++
>>   3 files changed, 32 insertions(+)
>>   create mode 100644 backport/backport-include/linux/timekeeping.h
>>   create mode 100644 backport/backport-include/linux/types.h
>>
> Thank you for the patch, it was applied.

Hi Hauke, Johannes,

I hit a duplicate export of this function against Fedora 22 kernel 
(v4.0.4). So they apparently backported it in their kernel. So I 
manually removed the function from backports tarball. Could this be 
automated by looking at Module.symvers of the kernel we build against? I 
will explore that if you guys consider it useful.

Regards,
Arend

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-12-08  8:44   ` Arend van Spriel
@ 2015-12-08  9:04     ` Johannes Berg
  2015-12-08  9:14       ` Johannes Berg
  2015-12-09 22:48     ` Hauke Mehrtens
  1 sibling, 1 reply; 13+ messages in thread
From: Johannes Berg @ 2015-12-08  9:04 UTC (permalink / raw)
  To: Arend van Spriel, Hauke Mehrtens, backports

On Tue, 2015-12-08 at 09:44 +0100, Arend van Spriel wrote:
> 
> I hit a duplicate export of this function against Fedora 22 kernel 
> (v4.0.4). So they apparently backported it in their kernel. So I 
> manually removed the function from backports tarball. Could this be 
> automated by looking at Module.symvers of the kernel we build
> against? I will explore that if you guys consider it useful.
> 

That's not a bad idea. We could have a script that creates some kind of
header file with #define HAVE_KTIME_GET_SECONDS and then we could use
that. We could even just do that for every single exported functions,
that will just be a few hundred lines but shouldn't matter much? :)

I once considered something similar but by actually test-compiling
something against the kernel - that worked (even for backported
inlines) but was awfully slow ...

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-12-08  9:04     ` Johannes Berg
@ 2015-12-08  9:14       ` Johannes Berg
  2015-12-08  9:28         ` Arend van Spriel
  0 siblings, 1 reply; 13+ messages in thread
From: Johannes Berg @ 2015-12-08  9:14 UTC (permalink / raw)
  To: Arend van Spriel, Hauke Mehrtens, backports

On Tue, 2015-12-08 at 10:04 +0100, Johannes Berg wrote:
> 
> That's not a bad idea. We could have a script that creates some kind
> of
> header file with #define HAVE_KTIME_GET_SECONDS and then we could use
> that. We could even just do that for every single exported functions,
> that will just be a few hundred lines but shouldn't matter much? :)
> 

Ok maybe not - on a very small test configuration for me that's
actually something like 6.5k lines...

I guess then we could ship a list of functions we want to look at, like
a file that simply lists one function per line:

symbols-check:
>>>
ktime_get_seconds
<<<

and then we can do something like

grep -f symbols-check /path/to/Module.symvers | \
	cut -f2 | \
	tr 'a-z' 'A-Z' | \
	sed 's/^/#define HAVE_/;s/$/ 1/' \
	> backport-include/backport/existing-symbols.h

and include that in the right place?

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-12-08  9:14       ` Johannes Berg
@ 2015-12-08  9:28         ` Arend van Spriel
  2015-12-08  9:38           ` Johannes Berg
  0 siblings, 1 reply; 13+ messages in thread
From: Arend van Spriel @ 2015-12-08  9:28 UTC (permalink / raw)
  To: Johannes Berg, Hauke Mehrtens, backports

On 12/08/2015 10:14 AM, Johannes Berg wrote:
> On Tue, 2015-12-08 at 10:04 +0100, Johannes Berg wrote:
>>
>> That's not a bad idea. We could have a script that creates some kind
>> of
>> header file with #define HAVE_KTIME_GET_SECONDS and then we could use
>> that. We could even just do that for every single exported functions,
>> that will just be a few hundred lines but shouldn't matter much? :)
>>
>
> Ok maybe not - on a very small test configuration for me that's
> actually something like 6.5k lines...
>
> I guess then we could ship a list of functions we want to look at, like
> a file that simply lists one function per line:

Basically the list would be the exported symbols from the backports 
module, ie. compat.ko, right?

Gr. AvS

> symbols-check:
>>>>
> ktime_get_seconds
> <<<
>
> and then we can do something like
>
> grep -f symbols-check /path/to/Module.symvers | \
> 	cut -f2 | \
> 	tr 'a-z' 'A-Z' | \
> 	sed 's/^/#define HAVE_/;s/$/ 1/' \
> 	> backport-include/backport/existing-symbols.h
>
> and include that in the right place?
>
> johannes
>

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-12-08  9:28         ` Arend van Spriel
@ 2015-12-08  9:38           ` Johannes Berg
  2015-12-09 22:52             ` Hauke Mehrtens
  0 siblings, 1 reply; 13+ messages in thread
From: Johannes Berg @ 2015-12-08  9:38 UTC (permalink / raw)
  To: Arend van Spriel, Hauke Mehrtens, backports

On Tue, 2015-12-08 at 10:28 +0100, Arend van Spriel wrote:
> 
> Basically the list would be the exported symbols from the backports 
> module, ie. compat.ko, right?
> 

Perhaps, I think it's slightly more complicated.

For one, we mostly prefix them with backport_, so just using as-is
won't work.

Secondly, we might sometimes intentionally do that, even though the
original function *does* exist, like with debugfs_create_bool() that
changed function signature.

I think it'd be safer to just do it one by one - but we might be able
to get rid of a lot of the RHEL/ubuntu/whatever ifdefs that way?

We might also be able to use them to ifdef some inlines that belong to
it? Overall it seems better to just do it by hand but as a better
mechanism than checking kernel versions?

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-12-08  8:44   ` Arend van Spriel
  2015-12-08  9:04     ` Johannes Berg
@ 2015-12-09 22:48     ` Hauke Mehrtens
  1 sibling, 0 replies; 13+ messages in thread
From: Hauke Mehrtens @ 2015-12-09 22:48 UTC (permalink / raw)
  To: Arend van Spriel, Johannes Berg, backports; +Cc: Johannes Berg

On 12/08/2015 09:44 AM, Arend van Spriel wrote:
> On 11/07/2015 06:08 PM, Hauke Mehrtens wrote:
>> On 10/23/2015 01:52 PM, Johannes Berg wrote:
>>> From: Johannes Berg <johannes.berg@intel.com>
>>>
>>> Since commit 84b00607aeb8 ("mac80211: use ktime_get_seconds")
>>> mac80211 uses ktime_get_seconds(). This patch provide a backport
>>> using ktime_get_ts() for it.
>>>
>>> [commit message and time64_t taken from Arend's patch]
>>>
>>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
>>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>>> ---
>>>   backport/backport-include/linux/ktime.h       |  1 +
>>>   backport/backport-include/linux/timekeeping.h | 21
>>> +++++++++++++++++++++
>>>   backport/backport-include/linux/types.h       | 10 ++++++++++
>>>   3 files changed, 32 insertions(+)
>>>   create mode 100644 backport/backport-include/linux/timekeeping.h
>>>   create mode 100644 backport/backport-include/linux/types.h
>>>
>> Thank you for the patch, it was applied.
> 
> Hi Hauke, Johannes,
> 
> I hit a duplicate export of this function against Fedora 22 kernel
> (v4.0.4). So they apparently backported it in their kernel. So I
> manually removed the function from backports tarball. Could this be
> automated by looking at Module.symvers of the kernel we build against? I
> will explore that if you guys consider it useful.
> 
> Regards,
> Arend

Hi,

I think in this patch adding this should fix your concrete problem:
#define ktime_get_seconds LINUX_BACKPORT(ktime_get_seconds)

But it would still be nice to know what functions are in the mainline
kernel so we can use them.

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-12-08  9:38           ` Johannes Berg
@ 2015-12-09 22:52             ` Hauke Mehrtens
  2015-12-09 22:56               ` Johannes Berg
  0 siblings, 1 reply; 13+ messages in thread
From: Hauke Mehrtens @ 2015-12-09 22:52 UTC (permalink / raw)
  To: Johannes Berg, Arend van Spriel, backports

On 12/08/2015 10:38 AM, Johannes Berg wrote:
> On Tue, 2015-12-08 at 10:28 +0100, Arend van Spriel wrote:
>>  
>> Basically the list would be the exported symbols from the backports 
>> module, ie. compat.ko, right?
>>
> 
> Perhaps, I think it's slightly more complicated.
> 
> For one, we mostly prefix them with backport_, so just using as-is
> won't work.
> 
> Secondly, we might sometimes intentionally do that, even though the
> original function *does* exist, like with debugfs_create_bool() that
> changed function signature.
> 
> I think it'd be safer to just do it one by one - but we might be able
> to get rid of a lot of the RHEL/ubuntu/whatever ifdefs that way?
> 
> We might also be able to use them to ifdef some inlines that belong to
> it? Overall it seems better to just do it by hand but as a better
> mechanism than checking kernel versions?
> 
> johannes

We could search backport/compat/*.c for EXPORT_SYMBOL() and create the
list based on that. Using compat.ko for that would mean we have to
compile first.
Based on this data we can check if the kernel would export this function
and create a "#define HAVE_FUNFION_NAME 1"

Hauke

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] backports: add ktime_get_seconds()
  2015-12-09 22:52             ` Hauke Mehrtens
@ 2015-12-09 22:56               ` Johannes Berg
  0 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2015-12-09 22:56 UTC (permalink / raw)
  To: Hauke Mehrtens, Arend van Spriel, backports

On Wed, 2015-12-09 at 23:52 +0100, Hauke Mehrtens wrote:
> 
> We could search backport/compat/*.c for EXPORT_SYMBOL() and create
> the
> list based on that. Using compat.ko for that would mean we have to
> compile first.

EXPORT_SYMBOL is pretty simple to grep :)

I'm just not really sure I see the point - after all, we have to add
the #ifdefs manually as well?

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-12-09 22:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-23 11:52 [PATCH v2] backports: add ktime_get_seconds() Johannes Berg
2015-10-28 21:17 ` Arend van Spriel
2015-10-31 22:03   ` Arend van Spriel
2015-11-01  7:47     ` Johannes Berg
2015-11-07 17:08 ` Hauke Mehrtens
2015-12-08  8:44   ` Arend van Spriel
2015-12-08  9:04     ` Johannes Berg
2015-12-08  9:14       ` Johannes Berg
2015-12-08  9:28         ` Arend van Spriel
2015-12-08  9:38           ` Johannes Berg
2015-12-09 22:52             ` Hauke Mehrtens
2015-12-09 22:56               ` Johannes Berg
2015-12-09 22:48     ` Hauke Mehrtens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.