[Bug 1763525] [NEW] systemtap module compilation fails due to `__GFP_REPEAT` undeclared

Shivaram Lingamneni slingamn at cs.stanford.edu
Thu Apr 12 22:31:25 UTC 2018


Public bug reported:

I'm using Ubuntu 17.10, running kernel 4.13.0-38-generic and using
systemtap version 3.1-3. I'm trying to run the following systemtap
script from here:
https://sourceware.org/systemtap/examples/memory/vm.tracepoints.stp


````
#! /usr/bin/env stap                                                                                                                                                                                                                        

global slabs

probe vm.kmem_cache_alloc {
        slabs [execname(), bytes_req]<<<1
}

probe timer.ms(10000)
{
        dummy = "";
        foreach ([name, bytes] in slabs) {
                if (dummy != name)
                        printf("\nProcess:%s\n", name);
                printf("Slab_size:%d\tCount:%d\n", bytes, @count(slabs[name, bytes]));
                dummy = name;
        }
        delete slabs
        printf("\n-------------------------------------------------------\n\n")
}
````

however, compilation fails due to `__GFP_REPEAT` being undefined:

````
# stap -v ./vm.tracepoints.stp                                                                                                                                                                                           
Pass 1: parsed user script and 465 library scripts using 119732virt/48980res/6868shr/42544data kb, in 100usr/0sys/105real ms.                                                                                                               
Pass 2: analyzed script: 2 probes, 2 functions, 5 embeds, 1 global using 123960virt/55004res/8300shr/46772data kb, in 120usr/230sys/345real ms.                                                                                             
Pass 3: translated to C into "/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c" using 123960virt/55004res/8300shr/46772data kb, in 0usr/0sys/0real ms.                                                                      
/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c: In function ‘function___private__usr_share_systemtap_tapset_linux_memory_stp___gfp_flag_str__overload_0’:                                                                 
/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c:698:17: error: ‘__GFP_REPEAT’ undeclared (first use in this function); did you mean ‘__GFP_RECLAIM’?                                                                       
  __GFP_BITMASKS(__GFP_REPEAT)                                                                                                                                                                                                              
                 ^                                                                                                                                                                                                                          
/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c:659:45: note: in definition of macro ‘__GFP_BITMASKS’                                                                                                                      
 #define __GFP_BITMASKS(FLAG)  if(gfp_flag & FLAG) { if(STAP_RETVALUE[0] != '\0') \                                                                                                                                                         
                                             ^~~~                                                                                                                                                                                           
/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c:698:17: note: each undeclared identifier is reported only once for each function it appears in                                                                             
  __GFP_BITMASKS(__GFP_REPEAT)                                                                                                                                                                                                              
                 ^                                                                                                                                                                                                                          
/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c:659:45: note: in definition of macro ‘__GFP_BITMASKS’                                                                                                                      
 #define __GFP_BITMASKS(FLAG)  if(gfp_flag & FLAG) { if(STAP_RETVALUE[0] != '\0') \                                                                                                                                                         
                                             ^~~~                                                                                                                                                                                           
scripts/Makefile.build:308: recipe for target '/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.o' failed                                                                                                                     
make[1]: *** [/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.o] Error 1
Makefile:1550: recipe for target '_module_/tmp/stapjX0WQQ' failed
make: *** [_module_/tmp/stapjX0WQQ] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_2b5505ba8af651817c2f6c55398c5877_6060.ko" in 7010usr/880sys/7511real ms.
Pass 4: compilation failed.  [man error::pass4]
Tip: /usr/share/doc/systemtap/README.Debian should help you get started.
````

** Affects: systemtap (Ubuntu)
     Importance: Medium
     Assignee: TJ (tj)
         Status: In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemtap in Ubuntu.
https://bugs.launchpad.net/bugs/1763525

Title:
  systemtap module compilation fails due to `__GFP_REPEAT` undeclared

Status in systemtap package in Ubuntu:
  In Progress

Bug description:
  I'm using Ubuntu 17.10, running kernel 4.13.0-38-generic and using
  systemtap version 3.1-3. I'm trying to run the following systemtap
  script from here:
  https://sourceware.org/systemtap/examples/memory/vm.tracepoints.stp

  
  ````
  #! /usr/bin/env stap                                                                                                                                                                                                                        

  global slabs

  probe vm.kmem_cache_alloc {
          slabs [execname(), bytes_req]<<<1
  }

  probe timer.ms(10000)
  {
          dummy = "";
          foreach ([name, bytes] in slabs) {
                  if (dummy != name)
                          printf("\nProcess:%s\n", name);
                  printf("Slab_size:%d\tCount:%d\n", bytes, @count(slabs[name, bytes]));
                  dummy = name;
          }
          delete slabs
          printf("\n-------------------------------------------------------\n\n")
  }
  ````

  however, compilation fails due to `__GFP_REPEAT` being undefined:

  ````
  # stap -v ./vm.tracepoints.stp                                                                                                                                                                                           
  Pass 1: parsed user script and 465 library scripts using 119732virt/48980res/6868shr/42544data kb, in 100usr/0sys/105real ms.                                                                                                               
  Pass 2: analyzed script: 2 probes, 2 functions, 5 embeds, 1 global using 123960virt/55004res/8300shr/46772data kb, in 120usr/230sys/345real ms.                                                                                             
  Pass 3: translated to C into "/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c" using 123960virt/55004res/8300shr/46772data kb, in 0usr/0sys/0real ms.                                                                      
  /tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c: In function ‘function___private__usr_share_systemtap_tapset_linux_memory_stp___gfp_flag_str__overload_0’:                                                                 
  /tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c:698:17: error: ‘__GFP_REPEAT’ undeclared (first use in this function); did you mean ‘__GFP_RECLAIM’?                                                                       
    __GFP_BITMASKS(__GFP_REPEAT)                                                                                                                                                                                                              
                   ^                                                                                                                                                                                                                          
  /tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c:659:45: note: in definition of macro ‘__GFP_BITMASKS’                                                                                                                      
   #define __GFP_BITMASKS(FLAG)  if(gfp_flag & FLAG) { if(STAP_RETVALUE[0] != '\0') \                                                                                                                                                         
                                               ^~~~                                                                                                                                                                                           
  /tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c:698:17: note: each undeclared identifier is reported only once for each function it appears in                                                                             
    __GFP_BITMASKS(__GFP_REPEAT)                                                                                                                                                                                                              
                   ^                                                                                                                                                                                                                          
  /tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.c:659:45: note: in definition of macro ‘__GFP_BITMASKS’                                                                                                                      
   #define __GFP_BITMASKS(FLAG)  if(gfp_flag & FLAG) { if(STAP_RETVALUE[0] != '\0') \                                                                                                                                                         
                                               ^~~~                                                                                                                                                                                           
  scripts/Makefile.build:308: recipe for target '/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.o' failed                                                                                                                     
  make[1]: *** [/tmp/stapjX0WQQ/stap_2b5505ba8af651817c2f6c55398c5877_6060_src.o] Error 1
  Makefile:1550: recipe for target '_module_/tmp/stapjX0WQQ' failed
  make: *** [_module_/tmp/stapjX0WQQ] Error 2
  WARNING: kbuild exited with status: 2
  Pass 4: compiled C into "stap_2b5505ba8af651817c2f6c55398c5877_6060.ko" in 7010usr/880sys/7511real ms.
  Pass 4: compilation failed.  [man error::pass4]
  Tip: /usr/share/doc/systemtap/README.Debian should help you get started.
  ````

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemtap/+bug/1763525/+subscriptions



More information about the foundations-bugs mailing list