[lttng-dev] [PATCH lttng-modules] Fix: Add gfpflags.h wrapper for kernel >= 4.6.0

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Apr 5 19:27:06 UTC 2016


----- On Apr 5, 2016, at 3:23 PM, Michael Jeanson mjeanson at efficios.com wrote:

> With current lttng-modules master (abfd272b984fd9881984e44d04979e3a093e8a39) I
> still
> get this:
> 
>  CC [M]  /home/mjeanson/Git/lttng/lttng-modules/probes/lttng-probe-printk.o
> In file included from
> /home/mjeanson/Git/lttng/lttng-modules/probes/lttng-probe-compaction.c:40:0:
> /home/mjeanson/Git/lttng/lttng-modules/probes/../instrumentation/events/lttng-module/compaction.h:10:35:
> fatal error: trace/events/gfpflags.h: No such file or directory
> compilation terminated.
> scripts/Makefile.build:297: recipe for target
> '/home/mjeanson/Git/lttng/lttng-modules/probes/lttng-probe-compaction.o' failed
> make[3]: ***
> [/home/mjeanson/Git/lttng/lttng-modules/probes/lttng-probe-compaction.o] Error
> 1
> make[3]: *** Waiting for unfinished jobs....
> In file included from
> /home/mjeanson/Git/lttng/lttng-modules/probes/lttng-probe-btrfs.c:45:0:
> /home/mjeanson/Git/lttng/lttng-modules/probes/../instrumentation/events/lttng-module/btrfs.h:9:35:
> fatal error: trace/events/gfpflags.h: No such file or directory
> compilation terminated.

Good point, fixed, and pushed, thanks!

Mathieu

> 
> 
> ----- On Apr 5, 2016, at 3:13 PM, Mathieu Desnoyers
> mathieu.desnoyers at efficios.com wrote:
> 
>> ----- On Apr 5, 2016, at 3:07 PM, Michael Jeanson mjeanson at efficios.com wrote:
>> 
>>> The gfpflags.h header file was renamed to mmflags.h in the 4.6.0
>>> release, see the upstream commit:
>>> 
>>>  commit 420adbe9fc1a45187cfa74df9dbfd72272c4e2fa
>>>  Author: Vlastimil Babka <vbabka at suse.cz>
>>>  Date:   Tue Mar 15 14:55:52 2016 -0700
>>> 
>>>      mm, tracing: unify mm flags handling in tracepoints and printk
>> 
>> See upstream branches: I have removed those includes because
>> this header's content was unused.
>> 
>> Thanks,
>> 
>> Mathieu
>> 
>>> 
>>> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
>>> ---
>>> instrumentation/events/lttng-module/btrfs.h      |  2 +-
>>> instrumentation/events/lttng-module/compaction.h |  2 +-
>>> wrapper/gfpflags.h                               | 32 ++++++++++++++++++++++++
>>> 3 files changed, 34 insertions(+), 2 deletions(-)
>>> create mode 100644 wrapper/gfpflags.h
>>> 
>>> diff --git a/instrumentation/events/lttng-module/btrfs.h
>>> b/instrumentation/events/lttng-module/btrfs.h
>>> index 2f67d5f..2088431 100644
>>> --- a/instrumentation/events/lttng-module/btrfs.h
>>> +++ b/instrumentation/events/lttng-module/btrfs.h
>>> @@ -6,7 +6,7 @@
>>> 
>>> #include <probes/lttng-tracepoint-event.h>
>>> #include <linux/writeback.h>
>>> -#include <trace/events/gfpflags.h>
>>> +#include <wrapper/gfpflags.h>
>>> #include <linux/version.h>
>>> 
>>> #ifndef _TRACE_BTRFS_DEF_
>>> diff --git a/instrumentation/events/lttng-module/compaction.h
>>> b/instrumentation/events/lttng-module/compaction.h
>>> index 64579fe..7b4348c 100644
>>> --- a/instrumentation/events/lttng-module/compaction.h
>>> +++ b/instrumentation/events/lttng-module/compaction.h
>>> @@ -7,7 +7,7 @@
>>> #include <probes/lttng-tracepoint-event.h>
>>> #include <linux/types.h>
>>> #include <linux/version.h>
>>> -#include <trace/events/gfpflags.h>
>>> +#include <wrapper/gfpflags.h>
>>> 
>>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
>>> 
>>> diff --git a/wrapper/gfpflags.h b/wrapper/gfpflags.h
>>> new file mode 100644
>>> index 0000000..26e78e6
>>> --- /dev/null
>>> +++ b/wrapper/gfpflags.h
>>> @@ -0,0 +1,32 @@
>>> +#ifndef _LTTNG_WRAPPER_GFPFLAGS_H
>>> +#define _LTTNG_WRAPPER_GFPFLAGS_H
>>> +
>>> +/*
>>> + * wrapper/gfpflags.h
>>> + *
>>> + * wrapper around trace/events/gfpflags.h.
>>> + *
>>> + * Copyright (C) 2016 Michael Jeanson <mjeanson at efficios.com>
>>> + *
>>> + * 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
>>> + */
>>> +
>>> +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
>>> +#include <trace/events/mmflags.h>
>>> +#else
>>> +#include <trace/events/gfpflags.h>
>>> +#endif
>>> +
>>> +#endif /* _LTTNG_WRAPPER_GFPFLAGS_H */
>>> --
>>> 2.7.4
>> 
>> --
>> Mathieu Desnoyers
>> EfficiOS Inc.
> > http://www.efficios.com

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list