All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Ritesh Harjani <riteshh@linux.ibm.com>,
	Kieran Bingham <kbingham@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] tasks: Add task_struct addr for lx-ps cmd
Date: Tue, 18 Aug 2020 07:40:40 +0200	[thread overview]
Message-ID: <1566dd81-a906-068d-ccc9-ed9cde8571d7@siemens.com> (raw)
In-Reply-To: <99e6236ed1b67140dae967dbf802c0eabd7b0eba.1597721575.git.riteshh@linux.ibm.com>

On 18.08.20 06:04, Ritesh Harjani wrote:
> task_struct addr in lx-ps cmd seems helpful
> 
> <e.g. o/p>
>       TASK          PID    COMM
> 0xffffffff82c2b8c0   0   swapper/0
> 0xffff888a0ba20040   1   systemd
> 0xffff888a0ba24040   2   kthreadd
> 0xffff888a0ba28040   3   rcu_gp
> 
> Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
> ---
>  scripts/gdb/linux/tasks.py | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py
> index 0301dc1e0138..17ec19e9b5bf 100644
> --- a/scripts/gdb/linux/tasks.py
> +++ b/scripts/gdb/linux/tasks.py
> @@ -73,11 +73,12 @@ class LxPs(gdb.Command):
>          super(LxPs, self).__init__("lx-ps", gdb.COMMAND_DATA)
>  
>      def invoke(self, arg, from_tty):
> +        gdb.write("{:>10} {:>12} {:>7}\n".format("TASK", "PID", "COMM"))
>          for task in task_lists():
> -            gdb.write("{address} {pid} {comm}\n".format(
> -                address=task,
> -                pid=task["pid"],
> -                comm=task["comm"].string()))
> +            gdb.write("{} {:^5} {}\n".format(
> +                task.format_string().split()[0],
> +                task["pid"].format_string(),
> +                task["comm"].string()))
>  
>  
>  LxPs()
> 

This patch is confusing me. We already dump the task address. What the
patch changes is adding a header and some conversions of the values. Can
you elaborate?

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2020-08-18  5:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18  4:04 [PATCH 0/2] scripts:gdb: Add few structs in gdb scripts Ritesh Harjani
2020-08-18  4:04 ` [PATCH 1/2] proc: Add struct mount & struct super_block addr in lx-mounts command Ritesh Harjani
2020-08-18  5:37   ` Jan Kiszka
2020-08-18  7:27     ` Ritesh Harjani
2020-08-18  4:04 ` [PATCH 2/2] tasks: Add task_struct addr for lx-ps cmd Ritesh Harjani
2020-08-18  5:40   ` Jan Kiszka [this message]
2020-08-18  8:55     ` Ritesh Harjani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1566dd81-a906-068d-ccc9-ed9cde8571d7@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=kbingham@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riteshh@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.