Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934569AbbENGFg (ORCPT ); Thu, 14 May 2015 02:05:36 -0400 Received: from 6.mo68.mail-out.ovh.net ([46.105.63.100]:46185 "EHLO 6.mo68.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754254AbbENGFd (ORCPT ); Thu, 14 May 2015 02:05:33 -0400 X-Greylist: delayed 2480 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 May 2015 02:05:33 EDT From: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= To: linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= , jan.kiszka@siemens.com Subject: [PATCH] scripts/gdb: Add ps command Date: Thu, 14 May 2015 15:25:36 +1000 Message-Id: <1431581136-8808-1-git-send-email-thiebaud@weksteen.fr> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 3613294276282241560 X-Ovh-Remote: 121.44.82.37 (ppp121-44-82-37.lns20.syd4.internode.on.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: 0 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekuddrtdehucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekuddrtdehucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1151 Lines: 40 Signed-off-by: ThiƩbaud Weksteen --- scripts/gdb/linux/tasks.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py index 0fa33b0..862a4ae 100644 --- a/scripts/gdb/linux/tasks.py +++ b/scripts/gdb/linux/tasks.py @@ -66,6 +66,22 @@ return that task_struct variable which PID matches.""" LxTaskByPidFunc() +class LxPs(gdb.Command): + """Dump Linux tasks.""" + + def __init__(self): + super(LxPs, self).__init__("lx-ps", gdb.COMMAND_DATA) + + def invoke(self, arg, from_tty): + for task in task_lists(): + gdb.write("{address} {pid} {comm}\n".format( + address=task, + pid=task["pid"], + comm=task["comm"].string())) + +LxPs() + + thread_info_type = utils.CachedType("struct thread_info") ia64_task_size = None -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/