From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C266C385DC04; Sat, 18 Apr 2020 19:42:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C266C385DC04 From: "agentzh at gmail dot com" To: systemtap@sourceware.org Subject: [Bug runtime/25852] New: Avoid allocating the temp string buffer for kernel backtraces on the kernel stack Date: Sat, 18 Apr 2020 19:42:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: agentzh at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2020 19:42:19 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25852 Bug ID: 25852 Summary: Avoid allocating the temp string buffer for kernel backtraces on the kernel stack Product: systemtap Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: runtime Assignee: systemtap at sourceware dot org Reporter: agentzh at gmail dot com Target Milestone: --- I've noted that for large -DMAXBACKTRACE=3DN values, the kernel module won'= t even compile at all: ``` $ /opt/stap/bin/stap -DMAXBACKTRACE=3D80 -e 'probe oneshot { print_backtrac= e() }' In file included from /tmp/stap9dNBFe/stap_e6cbcb21af7634fac8b4ca07b2e07a58_1196_src.c:83: /opt/stap/share/systemtap/runtime/stack.c: In function =E2=80=98_stp_stack_print_fallback.isra.0.constprop=E2=80=99: /opt/stap/share/systemtap/runtime/stack.c:235:1: error: the frame size of 6= 48 bytes is larger than 512 bytes [-Werror=3Dframe-larger-than=3D] 235 | } | ^ cc1: all warnings being treated as errors make[1]: *** [scripts/Makefile.build:265: /tmp/stap9dNBFe/stap_e6cbcb21af7634fac8b4ca07b2e07a58_1196_src.o] Error 1 make: *** [Makefile:1652: /tmp/stap9dNBFe] Error 2 WARNING: kbuild exited with status: 2 Pass 4: compilation failed. [man error::pass4] ``` This is due to the fact that in the stap runtime C function `_stp_stack_print_fallback`, the local variable `unsigned long entries[MAXBACKTRACE]` would take too much space on the kernel stack. Shall= we instead allocate this out of the stack, like in the ctx data structure? --=20 You are receiving this mail because: You are the assignee for the bug.=