From patchwork Sat Feb 4 09:01:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Xie X-Patchwork-Id: 52749 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1275121wrn; Sat, 4 Feb 2023 01:26:23 -0800 (PST) X-Google-Smtp-Source: AK7set9K/1ZPDvp02rf14bqFsP922Ugqprz8o3iBJwkNhw3nwHmORMQwLSDjj5+wbAAlyFylohxb X-Received: by 2002:a17:90b:1e50:b0:22b:e8bc:7f32 with SMTP id pi16-20020a17090b1e5000b0022be8bc7f32mr13812161pjb.49.1675502782901; Sat, 04 Feb 2023 01:26:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675502782; cv=none; d=google.com; s=arc-20160816; b=QlF2sl9/9RB0bKVB35lG0rGiIvlzFqzAvT78fT1zO+BbHJ38mzb2MuB75mrjeZ3qQ3 xehz0FQvz9dD6K6b7ck3q9zMj0KRPQU7fyUELEvxOXWzxMQXWfKglGThA4X+hKp7npBc Pqqp+TafXJrzqDgwmmuyY94hVbd29o4V/J6gH4tj0zltp30ygXEa/in50s52BBEH1OJp 9b+OpJ96Qp4p5E2ilM3kPGzwaTKnZtZmeLexj4WwyuZ+/c6ARZf8p9geTtOSeLtWYxbZ 30UybjVgEZ0XtnizsY729IwKEb0TKM1gqDdMZ7X3slQ5m2iGGdZbfxpGSdWEaQUg25yC 4cPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=W1MUjWfAsKwN3SdnMzVwXHWiAm+jPxdesCaacv1mxbY=; b=epx8/K/CF0+rLswntVDWgkfkZ0Ry/7NjVESAT8+tdBo6FuINObCSUX2AZtZMJM9Rri PUSWMJXjPBobNHJ+Sm3943wJbuKhKsDL5so+r184I4DLB5N5atLQdiFon0qrDNFM5Z6g 0UR0kXmT9h5sMjFeYiGMnxOjOBYi3PQ/RaXNQcu7wvGOGExt4Tfw2vn+bRHG9rw2Ivwq hpEiLHgIUAfM3mZa2kR7OPudG4r2Zo2OznR4FdrnVrkLIIUGz2Dwc/ZKWc1m5mdZhHRB I1uPG6rrAI3KMc+AOCF1KPCknCoUO0S/kCIkcIK2dRB9NrkFaJHTUWsE2qnn8wE2teHl oReQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=H0fu3e3y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x190-20020a6386c7000000b0049df87734d2si5431032pgd.271.2023.02.04.01.26.10; Sat, 04 Feb 2023 01:26:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=H0fu3e3y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233097AbjBDJCW (ORCPT + 99 others); Sat, 4 Feb 2023 04:02:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbjBDJCU (ORCPT ); Sat, 4 Feb 2023 04:02:20 -0500 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D354F2B61E for ; Sat, 4 Feb 2023 01:02:19 -0800 (PST) Received: by mail-pf1-x436.google.com with SMTP id z1so5278002pfg.12 for ; Sat, 04 Feb 2023 01:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=W1MUjWfAsKwN3SdnMzVwXHWiAm+jPxdesCaacv1mxbY=; b=H0fu3e3yXWoEJSJOWKagnNj1laxY4kiR3BBqxlbctCO6GnyleNi1gsym7rLDR7cEeA Lz5MQKyoZGXSGOAqnnTFFJTFF6/I8sCWJ0/Egb00yGgNVdK4yBpu9hoGK0dgzOnNh2LG QPsbCB5o1g6L2UeZ7T3gBhJiitGgw28XvXiJMfTdlpYU4DyyDiobBGl6W97f4aXg4yJA CUjp46FmSuIpOu5oWOvJYcCqbi9IkG7hcTsuZqGzH0VPXR4njXiaPcSDuc9g28ClQd6Z XZMupdssc40hgSEI7OiAFYvZA/ITgw2dHZzLpys9g2YVURw1VbH+DHQBNwfz8ufYXVg/ UBjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W1MUjWfAsKwN3SdnMzVwXHWiAm+jPxdesCaacv1mxbY=; b=eWqNnlPZo1Q9tOpTw6Egy/MIQVTiNTJ0xdOT5jGjT1upUaXkpUst0LEDseN7D1kR8m GnI5EXb/EpP844G9bfIVscrNvYt5EKipwMbW+RPwB2OYOIsNQiTJLwLGz2pkIq+HU4pE 9RuyHoMnteRj3La3W92yzMAi7X0x0R5qnGOKbaUwZ33aCd25Ee/eC1a9zFxU1mBNZqnt 0Pfik4WKm1kx3wWf+ccZT1n8w6RH4lLENebY2PdOpSaxEHnDITfK4P0NA76TW80FxxwN +oRhGLtQmxJZaxa3OJf5ULhFBu+joyExHEgE9d2U3hZBckKWo1PFZI4dt0Y60Hr1o37K Im4Q== X-Gm-Message-State: AO0yUKX0SYJj+wTYD4Mr1F3hkGvrLnmtoaC4e2Ey+psZzLnU130ucEoT w6T0BXWCX1p7rszREqvIDHY= X-Received: by 2002:a05:6a00:1ad2:b0:582:a212:d92c with SMTP id f18-20020a056a001ad200b00582a212d92cmr15149674pfv.10.1675501339228; Sat, 04 Feb 2023 01:02:19 -0800 (PST) Received: from localhost.localdomain (34.116.241.35.bc.googleusercontent.com. [35.241.116.34]) by smtp.gmail.com with ESMTPSA id y41-20020a056a00182900b00593a612515dsm3221846pfa.167.2023.02.04.01.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 01:02:17 -0800 (PST) From: Jeff Xie To: jan.kiszka@siemens.com, kbingham@kernel.org Cc: linux-kernel@vger.kernel.org, Jeff Xie Subject: [PATCH] scripts/gdb: fix 'lx-current' for x86 Date: Sat, 4 Feb 2023 17:01:39 +0800 Message-Id: <20230204090139.1789264-1-xiehuan09@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756892006129755191?= X-GMAIL-MSGID: =?utf-8?q?1756892006129755191?= When printing the name of the current process, it will report an error: (gdb) p $lx_current().comm Python Exception No symbol "current_task" in current context.: Error occurred in Python: No symbol "current_task" in current context. Because the commit ("x86: Put hot per CPU variables into a struct") changed it. Signed-off-by: Jeff Xie Reviewed-by: Jan Kiszka --- scripts/gdb/linux/cpus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py index 15fc4626d236..9ee99f9fae8d 100644 --- a/scripts/gdb/linux/cpus.py +++ b/scripts/gdb/linux/cpus.py @@ -163,7 +163,7 @@ def get_current_task(cpu): task_ptr_type = task_type.get_type().pointer() if utils.is_target_arch("x86"): - var_ptr = gdb.parse_and_eval("¤t_task") + var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task") return per_cpu(var_ptr, cpu).dereference() elif utils.is_target_arch("aarch64"): current_task_addr = gdb.parse_and_eval("$SP_EL0")