Received: by 10.223.148.5 with SMTP id 5csp7702467wrq; Thu, 18 Jan 2018 08:31:50 -0800 (PST) X-Google-Smtp-Source: ACJfBosQ+9bXjzhwd7pWQl7v5kUrTgM/wcOKu8rG28vLIWRbMy8n4BZ77e2wFBlO8rVfZJso7rUr X-Received: by 10.98.144.213 with SMTP id q82mr17147581pfk.59.1516293110545; Thu, 18 Jan 2018 08:31:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516293110; cv=none; d=google.com; s=arc-20160816; b=BGiDhJ/uB7OP5xHAoFH5IBg+V8gAicVVpSIhYqaBANlcOxyEzvLSi1kqrbZkAm4oCn NOB8NaCUZufq6/PMByz1vxQsIx4DOVZHcGHGp9T9I/iXwjT/B8p7znMEV4Sg5qOJby2s 4B48EzqiFBeBsxhRapd4Gmmjwz0IGNT/q1CGyE4peLluTwo9iuWUQGMTGqvNfeTgMnFv fWLhOwyAm28od7EHPVJPLFRSOWb7QL9/IKVFJiOxF1tPX9GhkAGlmiaySunxc886/BrR WM8e+YdgttlC0qwyFwF+2M+t9jV0/HBMDbyiXdAMBnKYVpy8xzVBiEML3PY12jthh+ng hAig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=IgkefkGZXFWTptaDTQZ2h5NowkRouL2G/5yOdViI0vk=; b=YiQIeRiHDgi73YMQzq6Ow6B9yPrHddHDm1PcOnTet8js8dbK922aerHaMqMeXFGn4i /VmsSg9fyb6tlryhrDn4uUf2SO2nS4yzh7+Omn0jZxOFIyjZGvN5mJ53akwLT3/wpJpK nRBukAy62WqA4Th+Znc7hg1Onfy90PL0YjNnGmLWiNRe/ZKEL3jLHEHUkE29kRu8lGuv M3G9uF98KhS6U6QnGGSRX4240MbHhJw0TLptHhs7Cyo8JLGVsaie0x2aU1ISvDK/AQuH jhfyf2FsFkECLx+wTaBJprawEhT6b2kWCEI2eDuegEUjmZc7FJLzOG+gDmDz++6vQEuR Nt5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si10583plp.158.2018.01.18.08.31.36; Thu, 18 Jan 2018 08:31:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933385AbeARQRk (ORCPT + 99 others); Thu, 18 Jan 2018 11:17:40 -0500 Received: from thoth.sbs.de ([192.35.17.2]:34951 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933112AbeARQRj (ORCPT ); Thu, 18 Jan 2018 11:17:39 -0500 Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w0IFhvMf028063 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Jan 2018 16:43:57 +0100 Received: from md1f2u6c.ww002.siemens.net ([144.145.53.21]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w0IFhuYM011555; Thu, 18 Jan 2018 16:43:56 +0100 Subject: Re: [PATCH] scripts/gdb: fix get_thread_info To: Xi Kangjie , kieran@ksquared.org.uk, Andrew Morton Cc: linux-kernel@vger.kernel.org References: <20180118210159.17223-1-imxikangjie@gmail.com> From: Jan Kiszka Message-ID: Date: Thu, 18 Jan 2018 16:43:56 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20180118210159.17223-1-imxikangjie@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-01-18 22:01, Xi Kangjie wrote: > Since kernel 4.9, the thread_info has been moved into task_struct, > no longer locates at the bottom of kernel stack. > > See commits: > - commit c65eacbe290b ("sched/core: Allow putting thread_info into > task_struct") > - commit 15f4eae70d36 ("x86: Move thread_info into task_struct") > > Before fix: > (gdb) set $current = $lx_current() > (gdb) p $lx_thread_info($current) > $1 = {flags = 1470918301} > (gdb) p $current.thread_info > $2 = {flags = 2147483648} > > After fix: > (gdb) p $lx_thread_info($current) > $1 = {flags = 2147483648} > (gdb) p $current.thread_info > $2 = {flags = 2147483648} > > Signed-off-by: Xi Kangjie > --- > scripts/gdb/linux/tasks.py | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py > index 1bf949c43b76..f6ab3ccf698f 100644 > --- a/scripts/gdb/linux/tasks.py > +++ b/scripts/gdb/linux/tasks.py > @@ -96,6 +96,8 @@ def get_thread_info(task): > thread_info_addr = task.address + ia64_task_size > thread_info = thread_info_addr.cast(thread_info_ptr_type) > else: > + if task.type.fields()[0].type == thread_info_type.get_type(): > + return task['thread_info'] > thread_info = task['stack'].cast(thread_info_ptr_type) > return thread_info.dereference() > > Acked-by: Jan Kiszka Andrew, please pick up. Thanks, Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux