From f3cfdda841fdbbc3ad765d94801ca78af802b6ff Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 28 2023 12:18:10 +0000 Subject: import systemtap-4.8-2.el9 --- diff --git a/.gitignore b/.gitignore index d6f13bf..bbfa489 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/systemtap-4.7.tar.gz +SOURCES/systemtap-4.8.tar.gz diff --git a/.systemtap.metadata b/.systemtap.metadata index 496d9fb..e947e62 100644 --- a/.systemtap.metadata +++ b/.systemtap.metadata @@ -1 +1 @@ -fc943fc3233b111fd80c9cbd063859dc1b699dcb SOURCES/systemtap-4.7.tar.gz +35e1168d72c9d553a6094825f067e2e62d662a59 SOURCES/systemtap-4.8.tar.gz diff --git a/SOURCES/rhbz1997192.patch b/SOURCES/rhbz1997192.patch new file mode 100644 index 0000000..4500e85 --- /dev/null +++ b/SOURCES/rhbz1997192.patch @@ -0,0 +1,50 @@ +commit 47cab810bb7ea315a2dec23c2f61e7ba74515b82 +Author: Martin Cermak +Date: Fri Dec 16 16:08:20 2022 -0500 + + tapset: nfs.proc.commit_done compilation on some kernels + + Correct: + 9.0 Server x86_64 # stap -vp3 nfs.proc.commit_done.stp + + Pass 1: parsed user script and 482 library scripts using 108088virt/88468res/12460shr/75476data kb, in 190usr/60sys/501real ms. + semantic error: invalid access '->task' vs 'void*': operator '->' at /usr/share/systemtap/tapset/linux/nfs_proc.stpm:16:21 + source: ( get_ip(&@nfs_data->task) ) + ^ + in expansion of macro: operator '@_nfs_data_server_ip' at /usr/share/systemtap/tapset/linux/nfs_proc.stp:1421:15 + source: server_ip = @_nfs_data_server_ip($task->tk_calldata) + ^ + +diff --git a/tapset/linux/nfs_proc.stp b/tapset/linux/nfs_proc.stp +index 9b1f65f5f..4413384f9 100644 +--- a/tapset/linux/nfs_proc.stp ++++ b/tapset/linux/nfs_proc.stp +@@ -1442,10 +1442,11 @@ probe nfs.proc3.commit_done = kernel.function("nfs3_commit_done") !, + valid = @_nfs_data_valid($data) + } + else { +- server_ip = @_nfs_data_server_ip($task->tk_calldata) +- prot = @_nfs_data_prot($task->tk_calldata) +- count = @_nfs_data_res_count($task->tk_calldata) +- valid = @_nfs_data_valid($task->tk_calldata) ++ _tk_calldata=@choose_defined($task->tk_calldata, @cast($task, "rpc_task", "kernel:nfs")->tk_calldata) ++ server_ip = @_nfs_data_server_ip(_tk_calldata) ++ prot = @_nfs_data_prot(_tk_calldata) ++ count = @_nfs_data_res_count(_tk_calldata) ++ valid = @_nfs_data_valid(_tk_calldata) + } + timestamp = 0 + version = 3 +diff --git a/tapset/linux/nfs_proc.stpm b/tapset/linux/nfs_proc.stpm +index 8576c0f33..4fe40b2a5 100644 +--- a/tapset/linux/nfs_proc.stpm ++++ b/tapset/linux/nfs_proc.stpm +@@ -13,7 +13,7 @@ + + @define _nfs_data_server_ip(nfs_data) + %( +- ( get_ip(&@nfs_data->task) ) ++ ( get_ip(@choose_defined(&@nfs_data->task, &@cast(@nfs_data, "nfs_commit_data", "kernel:nfs")->task)) ) + %) + + @define _nfs_data_prot(nfs_data) diff --git a/SOURCES/rhbz2081102.patch b/SOURCES/rhbz2081102.patch deleted file mode 100644 index 74b8287..0000000 --- a/SOURCES/rhbz2081102.patch +++ /dev/null @@ -1,258 +0,0 @@ -commit 093b972294256b3ad68712daecdfdc5da1418a13 -Author: Martin Cermak -Date: Mon May 9 20:00:15 2022 +0200 - - refix PR28634 for rhel8+ kernels - - The rhel kernel backports do not always align to upstream, so that - the KERNEL_VERSION() based gate needs to be updated using a version - that does the expected thing for the rhel{7,8,9} kernels. - -diff --git a/tapset/linux/ioscheduler.stp b/tapset/linux/ioscheduler.stp -index 3096a73ea..c7231878d 100644 ---- a/tapset/linux/ioscheduler.stp -+++ b/tapset/linux/ioscheduler.stp -@@ -11,7 +11,7 @@ - // - %{ - #include --#if LINUX_VERSION_CODE < KERNEL_VERSION(5,16,0) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,18,0) - #include - #endif - %} -@@ -41,7 +41,7 @@ probe ioscheduler.elv_next_request = kernel.function("blk_peek_request") !, - */ - probe ioscheduler.elv_next_request.return = - kernel.function("blk_peek_request").return !, -- kernel.function("elv_next_request").return -+ kernel.function("elv_next_request").return ? - { - name = "elv_next_request" - if ($return == 0) { -@@ -80,18 +80,14 @@ probe ioscheduler.elv_completed_request - @choose_defined($q->elevator->elevator_type->elevator_name, - @choose_defined($q->elevator->elevator_name, - 0))), "") -- if($rq == 0) { -- disk_major = -1 -- disk_minor = -1 -- } else { -- if($rq->rq_disk == 0) { -- disk_major = -1 -- disk_minor = -1 -- } else { -- disk_major = $rq->rq_disk->major -- disk_minor = $rq->rq_disk->first_minor -- } -- } -+ disk_major = -1 -+ disk_minor = -1 -+ // kernel f3fa33acca9f0058157214800f68b10d8e71ab7a -+ // block: remove the ->rq_disk field in struct request -+ if(@defined($rq->rq_disk) && ($rq->rq_disk != 0)) { -+ disk_major = $rq->rq_disk->major -+ disk_minor = $rq->rq_disk->first_minor -+ } - - rq = $rq - rq_flags = ($rq == 0) ? 0 -@@ -111,7 +107,7 @@ probe ioscheduler.elv_completed_request - // when a request is added to the request queue - probe ioscheduler.elv_add_request.kp = - kernel.function("elv_insert") !, -- kernel.function("__elv_add_request") -+ kernel.function("__elv_add_request") ? - { - name = "elv_add_request" - elevator_name = kernel_string( -@@ -120,18 +116,15 @@ probe ioscheduler.elv_add_request.kp = - @choose_defined($q->elevator->elevator_name, - 0))), "") - q = $q -- if($rq == 0) { -- disk_major = -1 -- disk_minor = -1 -- } else { -- if($rq->rq_disk == 0) { -- disk_major = -1 -- disk_minor = -1 -- } else { -- disk_major = $rq->rq_disk->major -- disk_minor = $rq->rq_disk->first_minor -- } -- } -+ -+ disk_major = -1 -+ disk_minor = -1 -+ // kernel f3fa33acca9f0058157214800f68b10d8e71ab7a -+ // block: remove the ->rq_disk field in struct request -+ if(@defined($rq->rq_disk) && ($rq->rq_disk != 0)) { -+ disk_major = $rq->rq_disk->major -+ disk_minor = $rq->rq_disk->first_minor -+ } - - rq = $rq - rq_flags = ($rq == 0) ? 0 -@@ -160,11 +153,11 @@ probe ioscheduler.elv_add_request.tp = kernel.trace("block_rq_insert") ? - 0))), "") - rq = $rq - -- if ($rq == 0 || $rq->rq_disk ==0) { -- disk_major = -1 -- disk_minor = -1 -- } -- else { -+ disk_major = -1 -+ disk_minor = -1 -+ // kernel f3fa33acca9f0058157214800f68b10d8e71ab7a -+ // block: remove the ->rq_disk field in struct request -+ if(@defined($rq->rq_disk) && ($rq->rq_disk != 0)) { - disk_major = $rq->rq_disk->major - disk_minor = $rq->rq_disk->first_minor - } -@@ -184,7 +177,7 @@ probe ioscheduler.elv_add_request.tp = kernel.trace("block_rq_insert") ? - * - */ - probe ioscheduler.elv_add_request = -- ioscheduler.elv_add_request.tp !, ioscheduler.elv_add_request.kp -+ ioscheduler.elv_add_request.tp !, ioscheduler.elv_add_request.kp ? - {} - - /** -@@ -211,14 +204,14 @@ probe ioscheduler_trace.elv_completed_request - - rq = $rq - -- if ($rq == 0 || $rq->rq_disk ==0) { -- disk_major = -1 -- disk_minor = -1 -- } -- else { -- disk_major = $rq->rq_disk->major -- disk_minor = $rq->rq_disk->first_minor -- } -+ disk_major = -1 -+ disk_minor = -1 -+ // kernel f3fa33acca9f0058157214800f68b10d8e71ab7a -+ // block: remove the ->rq_disk field in struct request -+ if(@defined($rq->rq_disk) && ($rq->rq_disk != 0)) { -+ disk_major = $rq->rq_disk->major -+ disk_minor = $rq->rq_disk->first_minor -+ } - - rq_flags = ($rq == 0) ? 0 - : @choose_defined($rq->cmd_flags, $rq->flags) -@@ -247,14 +240,14 @@ probe ioscheduler_trace.elv_issue_request - 0))), "") - rq = $rq - -- if ($rq == 0 || $rq->rq_disk ==0) { -- disk_major = -1 -- disk_minor = -1 -- } -- else { -+ disk_major = -1 -+ disk_minor = -1 -+ // kernel f3fa33acca9f0058157214800f68b10d8e71ab7a -+ // block: remove the ->rq_disk field in struct request -+ if(@defined($rq->rq_disk) && ($rq->rq_disk != 0)) { - disk_major = $rq->rq_disk->major - disk_minor = $rq->rq_disk->first_minor -- } -+ } - - rq_flags = ($rq == 0) ? 0 - : @choose_defined($rq->cmd_flags, $rq->flags) -@@ -283,14 +276,14 @@ probe ioscheduler_trace.elv_requeue_request - 0))), "") - rq = $rq - -- if ($rq == 0 || $rq->rq_disk ==0) { -- disk_major = -1 -- disk_minor = -1 -- } -- else { -- disk_major = $rq->rq_disk->major -- disk_minor = $rq->rq_disk->first_minor -- } -+ disk_major = -1 -+ disk_minor = -1 -+ // kernel f3fa33acca9f0058157214800f68b10d8e71ab7a -+ // block: remove the ->rq_disk field in struct request -+ if(@defined($rq->rq_disk) && ($rq->rq_disk != 0)) { -+ disk_major = $rq->rq_disk->major -+ disk_minor = $rq->rq_disk->first_minor -+ } - - rq_flags = ($rq == 0) ? 0 - : @choose_defined($rq->cmd_flags, $rq->flags) -@@ -318,14 +311,14 @@ probe ioscheduler_trace.elv_abort_request - 0))), "") - rq = $rq - -- if ($rq == 0 || $rq->rq_disk ==0) { -- disk_major = -1 -- disk_minor = -1 -- } -- else { -- disk_major = $rq->rq_disk->major -- disk_minor = $rq->rq_disk->first_minor -- } -+ disk_major = -1 -+ disk_minor = -1 -+ // kernel f3fa33acca9f0058157214800f68b10d8e71ab7a -+ // block: remove the ->rq_disk field in struct request -+ if(@defined($rq->rq_disk) && ($rq->rq_disk != 0)) { -+ disk_major = $rq->rq_disk->major -+ disk_minor = $rq->rq_disk->first_minor -+ } - - rq_flags = ($rq == 0) ? 0 - : @choose_defined($rq->cmd_flags, $rq->flags) -diff --git a/testsuite/buildok/ioscheduler-all-probes.stp b/testsuite/buildok/ioscheduler-all-probes.stp -index da182c774..a8d8e08c5 100755 ---- a/testsuite/buildok/ioscheduler-all-probes.stp -+++ b/testsuite/buildok/ioscheduler-all-probes.stp -@@ -2,6 +2,6 @@ - - // Tests if all probes in the ioscheduler tapset are resolvable. - --probe ioscheduler.*, ioscheduler.*.return {} -+probe ioscheduler.* ?, ioscheduler.*.return ? {} - - probe ioscheduler_trace.* ? {} -diff --git a/testsuite/buildok/ioscheduler-detailed.stp b/testsuite/buildok/ioscheduler-detailed.stp -index 143f20cd6..033e955dc 100755 ---- a/testsuite/buildok/ioscheduler-detailed.stp -+++ b/testsuite/buildok/ioscheduler-detailed.stp -@@ -6,24 +6,24 @@ - # test the kprobes aliases (*.kp). This could cause them to get out - # of sync with the kprobed functions. So, we test them explicitly. - --probe ioscheduler.elv_next_request -+probe ioscheduler.elv_next_request ? - { - printf("%s: %s\n", name, elevator_name) - } --probe ioscheduler.elv_next_request.return -+probe ioscheduler.elv_next_request.return ? - { - printf("name: %s, %d, %d, %p, %d", name, disk_major, - disk_minor, rq, rq_flags) - } - --probe ioscheduler.elv_completed_request -+probe ioscheduler.elv_completed_request ? - { - printf("name: %s, elv_name: %s, %d, %d, %p, %d", name, elevator_name, - disk_major, disk_minor, rq, rq_flags) - } - --probe ioscheduler.elv_add_request, -- ioscheduler.elv_add_request.kp, -+probe ioscheduler.elv_add_request ?, -+ ioscheduler.elv_add_request.kp ?, - ioscheduler.elv_add_request.tp ? - { - printf("name: %s, elv_name: %s, %d, %d, %p, %d", name, elevator_name, diff --git a/SOURCES/rhbz2085647.patch b/SOURCES/rhbz2085647.patch deleted file mode 100644 index e136240..0000000 --- a/SOURCES/rhbz2085647.patch +++ /dev/null @@ -1,66 +0,0 @@ -commit a0fa7bf0b68058d8f41a5fde608362172a2c3d77 -Author: Martin Cermak -Date: Wed May 11 22:22:00 2022 +0200 - - Update examples/io/iostat-scsi.stp for modern rhel9 kernels. - - Update examples/io/iostat-scsi.stp for kernels having following - upstream kernel commit backported: - - commit f3fa33acca9f0058157214800f68b10d8e71ab7a - Author: Christoph Hellwig - Date: Fri Nov 26 13:18:00 2021 +0100 - - block: remove the ->rq_disk field in struct request - - Just use the disk attached to the request_queue instead. - - [ ... stuff deleted ... ] - -diff --git a/testsuite/systemtap.examples/io/iostat-scsi.stp b/testsuite/systemtap.examples/io/iostat-scsi.stp -index 3faf32fe9..aa0238a7b 100755 ---- a/testsuite/systemtap.examples/io/iostat-scsi.stp -+++ b/testsuite/systemtap.examples/io/iostat-scsi.stp -@@ -2,12 +2,18 @@ - - global devices, reads, writes - -+/* kernel commit f3fa33acca9f0058157214800f68b10d8e71ab7a */ -+@define __disk_name(__request) -+%( -+ ( @choose_defined(@__request->rq_disk->disk_name, @__request->q->disk->disk_name ) ) -+%) -+ - /* data collection: SCSI disk */ - %(kernel_v < "2.6.24" %? - probe module("sd_mod").function("sd_init_command") !, - kernel.function("sd_init_command") - { -- device = kernel_string($SCpnt->request->rq_disk->disk_name) -+ device = kernel_string(@__disk_name($SCpnt->request)) - sector_size = $SCpnt->device->sector_size - nr_sectors = $SCpnt->request->nr_sectors - devices[device] = 1 -@@ -38,7 +44,7 @@ function get_nr_sectors:long(rq:long) - probe sd_prep_fn = module("sd_mod").function("sd_prep_fn") !, - kernel.function("sd_prep_fn") - { -- device = kernel_string($rq->rq_disk->disk_name) -+ device = kernel_string(@__disk_name($rq)) - sector_size = @cast($q->queuedata, "scsi_device", "kernel")->sector_size - %(kernel_v>="2.6.31" %? - nr_sectors = get_nr_sectors($rq) -@@ -58,11 +64,11 @@ probe sd_init_command = module("sd_mod").function("sd_init_command") !, - sector_size = @choose_defined($cmd, $SCpnt)->device->sector_size - # Kernel commits aa8e25e5006aac52c943c84e9056ab488630ee19 2266a2def97ce11ec979b6c58a1b637a16eca7dd - if (@defined(@choose_defined($cmd, $SCpnt)->request)) { -- device = kernel_string(@choose_defined($cmd, $SCpnt)->request->rq_disk->disk_name) -+ device = kernel_string(@__disk_name(@choose_defined($cmd, $SCpnt)->request)) - nr_sectors = get_nr_sectors(@choose_defined($cmd, $SCpnt)->request) - _cmd_flags = @choose_defined($cmd, $SCpnt)->request->cmd_flags - } else { -- device = kernel_string(@cast(scsi_cmd_to_rq(@choose_defined($cmd, $SCpnt)), "request", "kernel")->rq_disk->disk_name) -+ device = kernel_string(@__disk_name(@cast(scsi_cmd_to_rq(@choose_defined($cmd, $SCpnt)), "request", "kernel"))) - nr_sectors = get_nr_sectors(scsi_cmd_to_rq(@choose_defined($cmd, $SCpnt))) - _cmd_flags = @cast(scsi_cmd_to_rq(@choose_defined($cmd, $SCpnt)), "request", "kernel")->cmd_flags - } diff --git a/SOURCES/rhbz2145242.patch b/SOURCES/rhbz2145242.patch new file mode 100644 index 0000000..1853a64 --- /dev/null +++ b/SOURCES/rhbz2145242.patch @@ -0,0 +1,30 @@ +commit 578e60102871d11ed8c18d36f6286f3a96258d8f +Author: Ryan Goldberg +Date: Thu Dec 1 16:15:44 2022 -0500 + + PR29676: Wildcard expansion fix for labels + + PR29676, introduced an bug where function symbols from the symbol + table were expanded in the function component resulting in wildcards + not being expanded in labels. This fix, removes the issue by restricting + the symbol table query to probes which don't need further debuginfo to + expand. + +diff --git a/tapsets.cxx b/tapsets.cxx +index 0ec71ebda..46b10f26e 100644 +--- a/tapsets.cxx ++++ b/tapsets.cxx +@@ -1256,7 +1256,11 @@ dwarf_query::handle_query_module() + // in the symbol table but not in dwarf and minidebuginfo is + // located in the gnu_debugdata section, alias_dupes checking + // is done before adding any probe points +- if(!pending_interrupts) ++ // PR29676. Some probes require additional debuginfo ++ // to expand wildcards (ex. .label, .callee). Since the debuginfo is ++ // not available, don't bother looking in the symbol table for these results. ++ // This can result in 0 results, if there is no dwarf info present ++ if(!pending_interrupts && !(has_label || has_callee || has_callees_num)) + query_module_symtab(); + } + + diff --git a/SOURCES/rhbz2149223.patch b/SOURCES/rhbz2149223.patch new file mode 100644 index 0000000..75ba486 --- /dev/null +++ b/SOURCES/rhbz2149223.patch @@ -0,0 +1,78 @@ +commit 05eb6742c169226ae09f1737aa8b9dc1dc12adb5 +Author: Mark Wielaard +Date: Tue Nov 29 18:50:58 2022 +0100 + + Handle DWARF5 DW_OP_implicit_pointer and DW_OP_entry_value + + These are the same as the GNU extensions for older DWARF, + DW_OP_GNU_implicit_pointer and DW_GNU_entry_value. + +diff --git a/loc2stap.cxx b/loc2stap.cxx +index efc78cc57..53316a480 100644 +--- a/loc2stap.cxx ++++ b/loc2stap.cxx +@@ -23,6 +23,11 @@ + #define DW_OP_GNU_entry_value 0xf3 + #endif + ++#if ! _ELFUTILS_PREREQ(0, 171) ++#define DW_OP_entry_value 0xa3 ++#define DW_OP_implicit_pointer 0xa0 ++#endif ++ + #define N_(x) x + + +@@ -372,7 +377,7 @@ location_context::translate (const Dwarf_Op *expr, const size_t len, + DIE ("operations follow DW_OP_implicit_value"); + + if (implicit_pointer != NULL) +- DIE ("operations follow DW_OP_GNU_implicit_pointer"); ++ DIE ("operations follow DW_OP implicit_pointer"); + } + + switch (expr[i].atom) +@@ -662,6 +667,7 @@ location_context::translate (const Dwarf_Op *expr, const size_t len, + + #if _ELFUTILS_PREREQ (0, 149) + case DW_OP_GNU_implicit_pointer: ++ case DW_OP_implicit_pointer: + implicit_pointer = &expr[i]; + /* Fake top of stack: implicit_pointer being set marks it. */ + PUSH(NULL); +@@ -684,10 +690,11 @@ location_context::translate (const Dwarf_Op *expr, const size_t len, + break; + + case DW_OP_GNU_entry_value: ++ case DW_OP_entry_value: + { + expression *result = handle_GNU_entry_value (expr[i]); + if (result == NULL) +- DIE("DW_OP_GNU_entry_value unable to resolve value"); ++ DIE("DW_OP entry_value unable to resolve value"); + PUSH(result); + } + break; +@@ -1248,7 +1255,8 @@ location_context::location_relative (const Dwarf_Op *expr, size_t len, + break; + + case DW_OP_GNU_entry_value: +- DIE ("unhandled DW_OP_GNU_entry_value"); ++ case DW_OP_entry_value: ++ DIE ("unhandled DW_OP entry_value"); + break; + + default: +diff --git a/testsuite/systemtap.base/dw_entry_value.exp b/testsuite/systemtap.base/dw_entry_value.exp +index 7339fc5fa..b728fa7ff 100644 +--- a/testsuite/systemtap.base/dw_entry_value.exp ++++ b/testsuite/systemtap.base/dw_entry_value.exp +@@ -10,7 +10,7 @@ if { $res != "" } { + pass "$test: compiled $test.c" + } + +-if { ![catch { exec eu-readelf -w $test | grep GNU_entry_value }] } { ++if { ![catch { exec eu-readelf -w $test | grep entry_value: }] } { + stap_run $test no_load $all_pass_string $srcdir/$subdir/$test.stp -c ./${test} -w + } else { + untested "$test: no DW_OP_GNU_entry_value found" diff --git a/SOURCES/rhbz2149666.patch b/SOURCES/rhbz2149666.patch new file mode 100644 index 0000000..74be846 --- /dev/null +++ b/SOURCES/rhbz2149666.patch @@ -0,0 +1,73 @@ +commit 7eed8d1fef36997b9e4c1d9cdb67643483a51e56 +Author: William Cohen +Date: Fri Nov 4 11:12:05 2022 -0400 + + Ensure that SystemTap runtime uses smp_processor_id() in proper context + + There were cases on Fedora 36 and Rawhide running kernels with + CONFIG_DEBUG_PREEMPT=y where systemtap scripts would trigger kernel + log messages like the following: + + [ 257.544406] check_preemption_disabled: 4 callbacks suppressed + [ 257.544409] BUG: using smp_processor_id() in preemptible [00000000] code: staprun/2106 + [ 257.544465] caller is _stp_runtime_context_trylock+0x12/0x70 [stap_e36600406768aeefd49daf9fc7a3d23c_2106] + [ 257.544507] CPU: 0 PID: 2106 Comm: staprun Tainted: G OE ------- --- 6.1.0-0.rc2.20221028git23758867219c.24.fc38.x86_64 #1 + [ 257.544544] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-1.fc36 04/01/2014 + [ 257.544571] Call Trace: + [ 257.544583] + [ 257.544593] dump_stack_lvl+0x5b/0x77 + [ 257.544620] check_preemption_disabled+0xe1/0xf0 + [ 257.544641] _stp_runtime_context_trylock+0x12/0x70 [stap_e36600406768aeefd49daf9fc7a3d23c_2106] + [ 257.544673] _stp_runtime_entryfn_get_context+0xb/0x70 [stap_e36600406768aeefd49daf9fc7a3d23c_2106] + [ 257.544705] _stp_ctl_send+0x76/0x1e0 [stap_e36600406768aeefd49daf9fc7a3d23c_2106] + [ 257.544735] _stp_transport_init+0x71a/0x860 [stap_e36600406768aeefd49daf9fc7a3d23c_2106] + [ 257.544771] ? kallsyms_on_each_symbol+0x30/0x30 [stap_e36600406768aeefd49daf9fc7a3d23c_2106] + [ 257.544803] do_one_initcall+0x6b/0x320 + [ 257.544827] do_init_module+0x4a/0x200 + [ 257.544844] __do_sys_init_module+0x16a/0x1a0 + [ 257.544870] do_syscall_64+0x58/0x80 + [ 257.544885] ? up_read+0x17/0x20 + [ 257.544902] ? lock_is_held_type+0xe8/0x140 + [ 257.544921] ? asm_exc_page_fault+0x22/0x30 + [ 257.544939] ? lockdep_hardirqs_on+0x7d/0x100 + [ 257.544956] entry_SYSCALL_64_after_hwframe+0x63/0xcd + [ 257.544975] RIP: 0033:0x7f3cde12f5de + [ 257.544992] Code: 48 8b 0d 35 68 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 02 68 0c 00 f7 d8 64 89 01 48 + [ 257.545010] RSP: 002b:00007ffc5170c418 EFLAGS: 00000246 ORIG_RAX: 00000000000000af + [ 257.545010] RAX: ffffffffffffffda RBX: 0000563620bd4020 RCX: 00007f3cde12f5de + [ 257.545010] RDX: 0000563620bd4020 RSI: 0000000000040ea0 RDI: 00007f3cde44a010 + [ 257.545010] RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 + [ 257.545010] R10: 0000000000000053 R11: 0000000000000246 R12: 00007ffc5170c510 + [ 257.545010] R13: 00007f3cde44a010 R14: 00007ffc5170c440 R15: 00007f3cde4631e8 + [ 257.545010] + + This issue was introduced by git commit 1641b6e7ea which added a fast + path check that used smp_processor_id() without first having a + preempt_disable(). The code now ensures that preemption is disabled + before using the smp_processor_id(). + +diff --git a/runtime/linux/runtime_context.h b/runtime/linux/runtime_context.h +index 3ed3cbd22..ee3870f32 100644 +--- a/runtime/linux/runtime_context.h ++++ b/runtime/linux/runtime_context.h +@@ -49,13 +49,18 @@ static bool _stp_runtime_context_trylock(void) + { + bool locked; + ++ /* Need to disable preemption because of the smp_processor_id() call ++ in _stp_runtime_get_context(). */ ++ preempt_disable(); ++ + /* fast path to ignore new online CPUs without percpu context memory + * allocations. this also serves as an extra safe guard for NULL context + * pointers. */ +- if (unlikely(_stp_runtime_get_context() == NULL)) ++ if (unlikely(_stp_runtime_get_context() == NULL)) { ++ preempt_enable_no_resched(); + return false; ++ } + +- preempt_disable(); + locked = atomic_add_unless(&_stp_contexts_busy_ctr, 1, INT_MAX); + if (!locked) + preempt_enable_no_resched(); diff --git a/SOURCES/rhbz2154430.patch b/SOURCES/rhbz2154430.patch new file mode 100644 index 0000000..0e6a7c2 --- /dev/null +++ b/SOURCES/rhbz2154430.patch @@ -0,0 +1,72 @@ +commit 8f3498781413a710dc9e128f5a96891a6a18fc52 +Author: Martin Cermak +Date: Wed Dec 14 17:37:58 2022 +0100 + + PR29766: kernel.function("__set_page_dirty_buffers") not found in vfs.stp + + Updates needed for 6.1.0-65.fc38 compatibility. + +diff --git a/tapset/linux/vfs.stp b/tapset/linux/vfs.stp +index e3c1a3032..aebeb3fc0 100644 +--- a/tapset/linux/vfs.stp ++++ b/tapset/linux/vfs.stp +@@ -822,13 +822,15 @@ probe vfs.buffer_migrate_page.return = + } + + /* default if aop not set, __set_page_dirty_nobuffers usually used if set */ +-probe vfs.__set_page_dirty_buffers = kernel.function("__set_page_dirty_buffers") ++/* block_dirty_folio related to kernel commit e621900ad28b748e058b81d6078 */ ++probe vfs.__set_page_dirty_buffers = kernel.function("__set_page_dirty_buffers")!, ++ kernel.function("block_dirty_folio") + { +- dev = __page_dev($page) +- devname = __find_bdevname(dev, __page_bdev($page)) +- ino = __page_ino($page) ++ dev = __page_dev(@choose_defined($page, $folio)) ++ devname = __find_bdevname(dev, __page_bdev(@choose_defined($page, $folio))) ++ ino = __page_ino(@choose_defined($page, $folio)) + +- index = __page_index($page) ++ index = __page_index(@choose_defined($page, $folio)) + + name = "__set_page_dirty_buffers" + argstr = sprintf("%d", index) +@@ -837,7 +839,8 @@ probe vfs.__set_page_dirty_buffers = kernel.function("__set_page_dirty_buffers") + units = "pages" + } + probe vfs.__set_page_dirty_buffers.return = +- kernel.function("__set_page_dirty_buffers").return ++ kernel.function("__set_page_dirty_buffers").return!, ++ kernel.function("block_dirty_folio") + { + name = "__set_page_dirty_buffers" + retstr = sprintf("%d", $return) +@@ -914,8 +917,9 @@ probe __vfs.ext4_mpage_readpages.return = + + + /* newer style */ ++/* add_to_page_cache_locked removed per kernel commit f00654007fe1c15 */ + probe vfs.__add_to_page_cache = +- kernel.function("add_to_page_cache_locked"), ++ kernel.function("add_to_page_cache_locked") !, + kernel.function("add_to_page_cache_lru") + { } + +@@ -939,7 +943,7 @@ probe vfs.add_to_page_cache = + + /* newer style */ + probe vfs.__add_to_page_cache.return = +- kernel.function("add_to_page_cache_locked").return, ++ kernel.function("add_to_page_cache_locked").return !, + kernel.function("add_to_page_cache_lru").return + { } + +@@ -958,7 +962,7 @@ probe vfs.add_to_page_cache.return = + + probe vfs.remove_from_page_cache = + kernel.function("__delete_from_page_cache") !, +- kernel.function("__remove_from_page_cache") ++ kernel.function("__remove_from_page_cache") ? + { + dev = __page_dev($page) + devname = __find_bdevname(dev, __page_bdev($page)) diff --git a/SPECS/systemtap.spec b/SPECS/systemtap.spec index ca71be9..829ae76 100644 --- a/SPECS/systemtap.spec +++ b/SPECS/systemtap.spec @@ -20,7 +20,11 @@ %{!?with_bpf: %global with_bpf 0%{?fedora} >= 22 || 0%{?rhel} >= 8} %{!?with_systemd: %global with_systemd 0%{?fedora} >= 19 || 0%{?rhel} >= 7} %{!?with_emacsvim: %global with_emacsvim 0%{?fedora} >= 19 || 0%{?rhel} >= 7} +%ifarch %{ix86} +%{!?with_java: %global with_java 0} +%else %{!?with_java: %global with_java 0%{?fedora} >= 19 || 0%{?rhel} >= 7} +%endif %{!?with_debuginfod: %global with_debuginfod 0%{?fedora} >= 25 || 0%{?rhel} >= 7} %{!?with_virthost: %global with_virthost 0%{?fedora} >= 19 || 0%{?rhel} >= 7} %{!?with_virtguest: %global with_virtguest 1} @@ -117,7 +121,7 @@ m stapdev stapdev Name: systemtap -Version: 4.7 +Version: 4.8 Release: 2%{?release_override}%{?dist} # for version, see also configure.ac @@ -154,8 +158,13 @@ License: GPLv2+ URL: http://sourceware.org/systemtap/ Source: ftp://sourceware.org/pub/systemtap/releases/systemtap-%{version}.tar.gz -Patch1: rhbz2081102.patch -Patch2: rhbz2085647.patch +Patch1: rhbz1997192.patch +Patch2: rhbz2145242.patch +Patch3: rhbz2149223.patch +Patch4: rhbz2149666.patch +Patch5: rhbz2154430.patch + + # Build* BuildRequires: make @@ -235,9 +244,6 @@ BuildRequires: python3 BuildRequires: python3-devel BuildRequires: python3-setuptools %endif -%if %{with_specific_python} -BuildRequires: /usr/bin/pathfix.py -%endif %if %{with_httpd} BuildRequires: libmicrohttpd-devel @@ -576,8 +582,12 @@ systemtap-runtime-virthost machine to execute systemtap scripts. %prep %setup -q + %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build @@ -681,6 +691,11 @@ make %{?_smp_mflags} V=1 %install make DESTDIR=$RPM_BUILD_ROOT install + +%if ! (%{with_python3}) +rm -v $RPM_BUILD_ROOT%{_bindir}/stap-profile-annotate +%endif + %find_lang %{name} for dir in $(ls -1d $RPM_BUILD_ROOT%{_mandir}/{??,??_??}) ; do dir=$(echo $dir | sed -e "s|^$RPM_BUILD_ROOT||") @@ -818,7 +833,7 @@ done %if %{with_specific_python} # Some files got ambiguous python shebangs, we fix them after everything else is done -pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{python3_sitearch} %{buildroot}%{_bindir}/* +%py3_shebang_fix %{buildroot}%{python3_sitearch} %{buildroot}%{_bindir}/* %endif %pre runtime @@ -873,7 +888,8 @@ if [ ! -f ~stap-server/.systemtap/rc ]; then numcpu=`/usr/bin/getconf _NPROCESSORS_ONLN` if [ -z "$numcpu" -o "$numcpu" -lt 1 ]; then numcpu=1; fi nproc=`expr $numcpu \* 30` - echo "--rlimit-as=614400000 --rlimit-cpu=60 --rlimit-nproc=$nproc --rlimit-stack=1024000 --rlimit-fsize=51200000" > ~stap-server/.systemtap/rc + # PR29661 -> 4G + echo "--rlimit-as=4294967296 --rlimit-cpu=60 --rlimit-nproc=$nproc --rlimit-stack=1024000 --rlimit-fsize=51200000" > ~stap-server/.systemtap/rc chown stap-server:stap-server ~stap-server/.systemtap/rc fi @@ -1083,7 +1099,9 @@ exit 0 %files devel -f systemtap.lang %{_bindir}/stap %{_bindir}/stap-prep +%if %{with_python3} %{_bindir}/stap-profile-annotate +%endif %{_bindir}/stap-report %dir %{_datadir}/systemtap %{_datadir}/systemtap/runtime @@ -1280,7 +1298,17 @@ exit 0 # PRERELEASE %changelog -* Tue May 17 2022 Martin Cermak - 4.1-2 +* Fri Dec 16 2022 Frank Ch. Eigler - 4.8-2 +- rhbz1997192 +- rhbz2145242 +- rhbz2149223 +- rhbz2149666 +- rhbz2154430 + +* Thu Nov 03 2022 Frank Ch. Eigler - 4.8-1 +- Upstream release. + +* Tue May 17 2022 Martin Cermak - 4.7-2 - Fix rhbz2081102 and rhbz2085647 * Mon May 02 2022 Frank Ch. Eigler - 4.7-1