Received: by 10.223.148.5 with SMTP id 5csp7569709wrq; Thu, 18 Jan 2018 06:59:38 -0800 (PST) X-Google-Smtp-Source: ACJfBouiwdvdAvU1Gzr+LdNlPgwFGxyPpw3SJRG8OKgmYWpCdegVe40goO8fpG33oyllc+YVCAMX X-Received: by 10.98.201.199 with SMTP id l68mr15414814pfk.199.1516287578195; Thu, 18 Jan 2018 06:59:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516287578; cv=none; d=google.com; s=arc-20160816; b=LBjivkFeNLilBXXCtT9g2BmUNK1Kt+ybTZ34e5Dz1anTC/6Fy2qPPET5AdgVN1G00q QtBG9yTB7mK5Emsqqa3F+DzPvtu1rLLakYh8A/XE4Rh+5Dc0PjsEIhiEV6gwOQ1D3DnE F/NJ6P18DDIv6F2fx9wL3acXgG+engXsk+3XYs2lL4he1gD5UQkzBm0q3rGqBV3wPIne K/yYFVqe9PtgyBhmRo9ahkvQQHNX5KezjXUBRvdNAmxWrtONJbscQgakNW56hKD4Bhsb GzPNiEgdV80BxhC3qqbzgIY3IRupc51U/3V6BPYVxzp5Ul71kdndDHuGDj6jQzdW6iQa 1PNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=XK/5OSl91CJ8GN7v3+dgDP72Ni3dOlxOxI//IufpbjE=; b=oyqCSoV/49edFz+U0ZOi1z6rVT5mAAOLDcBjMxTcWqn5n781jr400v6ZKfPQH2GXR5 kd5FVCJk+XCZQEz4ai24wVCLxAURV6HG9OaDr9QGWQwrPvyPEIsFJNf7Z+QJ55IvjfDs UssabqpBRa82SoZEa+8VI2ZAz5fAq+LvRXVNF/b/9+Zr+2cOHrGtWqf/7xKB6/8nHaum TK7HQw4O6L8ca08x97kmwqr4JcQ0/6vbEnmDLPtg/6F8xqx2eySGoGfOmxokatjElHKy gLDU9whA4UOX9nTmzjb6TlI3i5pYrEGCa6nh9RC7xdb6N+vTbbGuuZjmM6Vqami2J0IX gbXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=HFGEhMrl; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x195si6346435pgx.627.2018.01.18.06.59.23; Thu, 18 Jan 2018 06:59:38 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=HFGEhMrl; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756092AbeARNLC (ORCPT + 99 others); Thu, 18 Jan 2018 08:11:02 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43088 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755624AbeARNK7 (ORCPT ); Thu, 18 Jan 2018 08:10:59 -0500 Received: by mail-pf0-f193.google.com with SMTP id y26so6951300pfi.10 for ; Thu, 18 Jan 2018 05:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=XK/5OSl91CJ8GN7v3+dgDP72Ni3dOlxOxI//IufpbjE=; b=HFGEhMrlIxXKz6FjrQJj7h4e6M0yTvhzELosSOjUSy1x9PqziogONRnWK5qDLidCUW HUVPcwjf1rMzVPGLmvoImIqN7TXfYGjugmDkrtaLWoE0niCz4cGfBV32abzo+icgzSKe gIR7Jjdwenh93ChYv3+roHw/SaDnRK7Fc2d6yIf3rLeNdnHuJ9r7BQT4wVD9I+rlW6Wi uIlreOOs7RfYab2oFnyC6d3JXdlD1bqbFW8jYM36T7ZzCgvKLnEyB+2QPDrRf3xayoNE W3WakOVDDwLbh1IhOPRvFGj2stM1H66/sb+XvHwcniteI+zWGe6YJRkqkDZozn1sX+mJ JUig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XK/5OSl91CJ8GN7v3+dgDP72Ni3dOlxOxI//IufpbjE=; b=tDirtW+zfDiNn0G8H8Ebkg8FvC9mtlYQ1u8/CO5LI2TvKgaDo2WUQ5FRyxkOS3V4tJ 5q2nmpdm0xo2e3vv9vwSC8QcQpOng/biFqtcFgTSnKUXIjy0TtHHwRQB8YS2Ym88PqoK xcHRukUflJlZpgvexD87I6XktUrJTUogtTR7nM+I8i97b2i3b/JUkbpRynN1IkGJcMrM jZDmZCjJPpidIfEXr4tJbZOY4vUJQjcgcGhPYfOr/I96aM/zw5C6pnY0nV0bHismfMZD Wwnua6kIoAXRBW6owGemZHYoFAwHL1nmjFrg53hUUQlGTEINq4sfObXpHvxjkt9+TbDM UT6g== X-Gm-Message-State: AKwxytegNZMpErM26yNtelRTGKz+s6RQQp6Tiz/Q1i4wQjDMucjRY8gv KgH46Sdmv/HvrfUPNpBnTl4= X-Received: by 10.98.34.206 with SMTP id p75mr30646767pfj.235.1516281059511; Thu, 18 Jan 2018 05:10:59 -0800 (PST) Received: from skyeye.360.net ([104.192.108.9]) by smtp.gmail.com with ESMTPSA id v9sm14814354pfj.88.2018.01.18.05.10.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 05:10:59 -0800 (PST) From: Xi Kangjie To: jan.kiszka@siemens.com, kieran@ksquared.org.uk Cc: linux-kernel@vger.kernel.org, Xi Kangjie Subject: [PATCH] scripts/gdb: fix get_thread_info Date: Thu, 18 Jan 2018 21:01:59 +0000 Message-Id: <20180118210159.17223-1-imxikangjie@gmail.com> X-Mailer: git-send-email 2.13.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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() -- 2.13.2