Systemtap regression on Linux 5.2.0-rc4+

Bug #1832741 reported by Bharath Vedartham
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemtap (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

System tap breaks when I run the following script in Linux 5.2.0-rc4+. It does not break on stable kernels like 4.4.0-148-generic.

Script:
file.stp:

global stats

probe kernel.function("do_try_to_free_pages").return {
   order = @entry($sc->order)
   time = cpu_clock_ns(cpu()) - @entry(cpu_clock_ns(cpu()))
   stats["do_try_to_free_pages", execname(), order] <<< time
}

probe kernel.function("try_to_compact_pages").return {
   order = @entry($order)
   time = cpu_clock_ns(cpu()) - @entry(cpu_clock_ns(cpu()))
   stats["try_to_compact_pages", execname(), order] <<< time
}

probe end {
   foreach([f,en,order+] in stats) {
        printf("%s:%s: order %d allocation latency - ", f,en,order)
        printf("max/avg/min/count: %d/%d/%d/%d\n", @max(stats[f,en,order]),@avg(stats[f,en,order]),@min(stats[f,en,order]),@count(stats[f,en,order]))
  }
}

Command to execute: sudo stap -v file.stp

Output:
Pass 1: parsed user script and 481 library scripts using 252924virt/58296res/7128shr/51680data kb, in 440usr/10sys/441real ms.
Pass 2: analyzed script: 5 probes, 6 functions, 4 embeds, 9 globals using 466196virt/273184res/8752shr/264952data kb, in 1670usr/430sys/2099real ms.
Pass 3: translated to C into "/tmp/staphdai7v/stap_9a6fd3c9a6892aa42943c7a32261941b_9080_src.c" using 466196virt/273376res/8944shr/264952data kb, in 10usr/0sys/7real ms.
In file included from <command-line>:0:0:
././include/linux/compiler_types.h:217:1: fatal error: /tmp/staphdai7v/stapconf_ab4ca97dc0436c6c48e82f11816eb32e_660.h: No such file or directory
 #endif /* __LINUX_COMPILER_TYPES_H */
 ^
In file included from <command-line>:0:0:
././include/linux/compiler_types.h:217:1: fatal error: /tmp/staphdai7v/stapconf_ab4ca97dc0436c6c48e82f11816eb32e_660.h: No such file or directory
 #endif /* __LINUX_COMPILER_TYPES_H */
 ^
compilation terminated.
compilation terminated.
make[2]: *** [/tmp/staphdai7v/stap_9a6fd3c9a6892aa42943c7a32261941b_9080_src.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [/tmp/staphdai7v/stap_9a6fd3c9a6892aa42943c7a32261941b_9080_aux_0.o] Error 1
make[1]: *** [_module_/tmp/staphdai7v] Error 2
make: *** [sub-make] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_9a6fd3c9a6892aa42943c7a32261941b_9080.ko" in 300usr/170sys/454real ms.
Pass 4: compilation failed. [man error::pass4]

Revision history for this message
Frank Ch. Eigler (fche) wrote :

systemtap 4.1 compensates for the kbuild changes made in linux 5.0-ish that caused the breakage you are noticing.

Revision history for this message
Bharath Vedartham (bhar54321) wrote :

Systemtap translator/driver (version 4.2/0.170, commit release-4.1-27-g2d77f531a5d1)
Copyright (C) 2005-2019 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.18 ... 5.1-rc2
enabled features: JAVA PYTHON2 NLS

Sorry for not putting my systemtap version.

What should I do? Should I use an older version of systemtap? I have built this from source rather than from package managers.

Revision history for this message
Frank Ch. Eigler (fche) wrote :

OK, that would be new -- but just make sure you're running the new stap for that test not an accidental old one.

Revision history for this message
Bharath Vedartham (bhar54321) wrote :

So when I do stap -V, I get:
Systemtap translator/driver (version 4.2/0.170, commit release-4.1-27-g2d77f531a5d1)
Copyright (C) 2005-2019 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.18 ... 5.1-rc2
enabled features: JAVA PYTHON2 NLS
when I do sudo stap -V, I get:
Systemtap translator/driver (version 3.2/0.170, rpm 3.2-8.el7_5)
Copyright (C) 2005-2017 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.18 ... 4.11
enabled features: AVAHI BOOST_STRING_REF DYNINST JAVA PYTHON2 LIBRPM LIBSQLITE3 LIBVIRT LIBXML2 NLS NSS READLINE

When I run my script with:
sudo stap -v file.stp

Am I running 3.2 or 4.2 when I do sudo stap <script>?

Plus I am not running ubuntu. I am running Oracle Linux Server 7.5

Revision history for this message
Frank Ch. Eigler (fche) wrote :

> Am I running 3.2 or 4.2 when I do sudo stap <script>?

Run "sudo stap -v" to find out.

> Plus I am not running ubuntu. I am running Oracle Linux Server 7.5

Then ubuntu launchpad would not be the appropriate venue.
See instead the upstream systemtap bugzilla, or Oracle's bug tracking system.

By the way, fedora rawhide 5.2.0-rc3 works fine with git systemtap.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemtap (Ubuntu):
status: New → Confirmed
Revision history for this message
Emanuele Rocca (ema) wrote :

Your stap script runs properly on ubuntu focal (systemtap 4.2 and Linux 5.4.0).

Changed in systemtap (Ubuntu):
status: Confirmed → Fix Committed
Emanuele Rocca (ema)
Changed in systemtap (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.