Bug 1566745

Summary: systemtap script compilation fails due to __GFP_COLD undeclared
Product: [Fedora] Fedora Reporter: Shivaram Lingamneni <slingamn>
Component: systemtapAssignee: Frank Ch. Eigler <fche>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: brolley, dsmith, fche, jistone, lberk, mjw, scox, wcohen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemtap-3.2-11.fc27 systemtap-3.2-11.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-27 01:20:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shivaram Lingamneni 2018-04-12 22:37:40 UTC
Description of problem:

I'm trying to compile the systemtap script listed here:

https://sourceware.org/systemtap/examples/memory/vm.tracepoints.stp

but it fails with the following error:

# stap -v ./vm.tracepoints.stp                                                                        
Pass 1: parsed user script and 475 library scripts using 147172virt/48872res/8336shr/40568data kb, in 250usr/60sys/313real ms.
Pass 2: analyzed script: 2 probes, 2 functions, 5 embeds, 1 global using 172172virt/59488res/12580shr/46924data kb, in 470usr/1370sys/1903real ms.
Missing separate debuginfos, use: debuginfo-install kernel-core-4.15.15-300.fc27.x86_64 
Pass 3: translated to C into "/tmp/stapFl1B2T/stap_bb44cdd1654b1340626eb5ffe639eaaf_6776_src.c" using 172172virt/59488res/12580shr/46924data kb, in 0usr/0sys/1real ms.
/tmp/stapFl1B2T/stap_bb44cdd1654b1340626eb5ffe639eaaf_6776_src.c: In function ‘function___private__usr_share_systemtap_tapset_linux_memory_stp___gfp_flag_str__overload_0’:
/tmp/stapFl1B2T/stap_bb44cdd1654b1340626eb5ffe639eaaf_6776_src.c:706:17: error: ‘__GFP_COLD’ undeclared (first use in this function); did you mean ‘__GFP_COMP’?
  __GFP_BITMASKS(__GFP_COLD) 
                 ^
/tmp/stapFl1B2T/stap_bb44cdd1654b1340626eb5ffe639eaaf_6776_src.c:665:45: note: in definition of macro ‘__GFP_BITMASKS’
 #define __GFP_BITMASKS(FLAG)  if(gfp_flag & FLAG) { if(STAP_RETVALUE[0] != '\0') \
                                             ^~~~
/tmp/stapFl1B2T/stap_bb44cdd1654b1340626eb5ffe639eaaf_6776_src.c:706:17: note: each undeclared identifier is reported only once for each function it appears in
  __GFP_BITMASKS(__GFP_COLD) 
                 ^
/tmp/stapFl1B2T/stap_bb44cdd1654b1340626eb5ffe639eaaf_6776_src.c:665:45: note: in definition of macro ‘__GFP_BITMASKS’
 #define __GFP_BITMASKS(FLAG)  if(gfp_flag & FLAG) { if(STAP_RETVALUE[0] != '\0') \
                                             ^~~~
make[1]: *** [scripts/Makefile.build:324: /tmp/stapFl1B2T/stap_bb44cdd1654b1340626eb5ffe639eaaf_6776_src.o] Error 1
make: *** [Makefile:1527: _module_/tmp/stapFl1B2T] Error 2                                                           
WARNING: kbuild exited with status: 2                     
Pass 4: compiled C into "stap_bb44cdd1654b1340626eb5ffe639eaaf_6776.ko" in 18280usr/3890sys/21682real ms.
Pass 4: compilation failed.  [man error::pass4]           


Version-Release number of selected component (if applicable):

systemtap-3.2-3.fc27.x86_64
systemtap-runtime-3.2-3.fc27.x86_64
kernel-4.15.15-300.fc27.x86_64

How reproducible:

Deterministically

Steps to Reproduce:

(see above)

Actual results:

Compilation error

Expected results:

Systemtap script is compiled into kernel module

Additional info:

Comment 1 David Smith 2018-04-16 17:40:58 UTC
This has been fixed upstream as commit 0f8139e:

<https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=commitdiff;h=0f8139eb4bd06a19714608b5f246fc24fcafde6e>

This commit hasn't been in a release yet. The part of that commit that fixes this particular problem is the following:

====
diff --git a/tapset/linux/memory.stp b/tapset/linux/memory.stp
index b968fe3..169d0f1 100644 (file)
--- a/tapset/linux/memory.stp
+++ b/tapset/linux/memory.stp
@@ -1,7 +1,7 @@
 // memory/vm related tapset
 // Copyright (C) 2005, 2006 IBM Corp.
 // Copyright (C) 2006 Intel Corporation.
-// Copyright (C) 2014 Red Hat Inc.
+// Copyright (C) 2014-2017 Red Hat Inc.
 //
 // This file is part of systemtap, and is free software.  You can
 // redistribute it and/or modify it under the terms of the GNU General
@@ -368,7 +368,9 @@ probe vm.oom_kill = kernel.function("oom_kill_process") !,
        __GFP_BITMASKS(__GFP_HIGH)
        __GFP_BITMASKS(__GFP_IO)
        __GFP_BITMASKS(__GFP_FS)
+#ifdef __GFP_COLD
        __GFP_BITMASKS(__GFP_COLD)
+#endif
        __GFP_BITMASKS(__GFP_NOWARN)
 #ifdef __GFP_RETRY_MAYFAIL
        __GFP_BITMASKS(__GFP_RETRY_MAYFAIL)
====

Until we push out a new release, you could apply that patch manually or build systemtap with the latest upstream source.

Comment 2 Fedora Update System 2018-04-20 15:18:23 UTC
systemtap-3.2-11.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-8b5ad21c11

Comment 3 Fedora Update System 2018-04-20 16:29:10 UTC
systemtap-3.2-11.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b6ed279f75

Comment 4 Fedora Update System 2018-04-21 05:03:31 UTC
systemtap-3.2-11.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b6ed279f75

Comment 5 Fedora Update System 2018-04-21 18:38:47 UTC
systemtap-3.2-11.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-8b5ad21c11

Comment 6 Fedora Update System 2018-04-27 01:20:36 UTC
systemtap-3.2-11.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2018-04-27 04:10:46 UTC
systemtap-3.2-11.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.