[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130129135946.GG14302@pd.tnic>
Date: Tue, 29 Jan 2013 14:59:46 +0100
From: Borislav Petkov <bp@...en8.de>
To: Jan Kiszka <jan.kiszka@...mens.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
Jason Wessel <jason.wessel@...driver.com>,
kgdb-bugreport@...ts.sourceforge.net,
Andi Kleen <andi@...stfloor.org>,
Tom Tromey <tromey@...hat.com>,
Ben Widawsky <ben@...dawsk.net>,
Tony Luck <tony.luck@...el.com>,
Fenghua Yu <fenghua.yu@...el.com>, linux-ia64@...r.kernel.org
Subject: Re: [PATCH v5 14/20] scripts/gdb: Add internal helper and
convenience function to retrieve thread_info
On Tue, Jan 29, 2013 at 01:37:57PM +0100, Jan Kiszka wrote:
> Add the internal helper get_thread_info that calculated the thread_info
> from a given task variable. Also export this service as a convenience
> function.
>
> Note: ia64 version is untested.
>
> CC: Tony Luck <tony.luck@...el.com>
> CC: Fenghua Yu <fenghua.yu@...el.com>
> CC: linux-ia64@...r.kernel.org
> Signed-off-by: Jan Kiszka <jan.kiszka@...mens.com>
> ---
[ … ]
> +class LxThreadInfoFunc (gdb.Function):
> + # Calculate Linux thread_info from task variable.
> + __doc__ = "Calculate Linux thread_info from task variable.\n" \
> + "\n" \
> + "$lx_thread_info(TASK): Given TASK, return the corresponding thread_info\n" \
> + "variable."
> +
> + def __init__(self):
> + super(LxThreadInfoFunc, self).__init__("lx_thread_info")
> +
> + def invoke(self, task):
> + return get_thread_info(task)
> +
> +LxThreadInfoFunc()
Nice, you can plug commands into one-another:
(gdb) p $lx_thread_info($lx_current())
$12 = {task = 0xffffffff81a14440, exec_domain = 0xffffffff81a21e00, flags = 0, status = 0, cpu = 0,
preempt_count = 1, addr_limit = {seg = 18446744073709551615}, restart_block = {
fn = 0xffffffff81054cd0 <do_no_restart_syscall>, {futex = {uaddr = 0x0, val = 0, flags = 0, bitset = 0,
time = 0, uaddr2 = 0x0}, nanosleep = {clockid = 0, rmtp = 0x0, compat_rmtp = 0x0, expires = 0},
poll = {ufds = 0x0, nfds = 0, has_timeout = 0, tv_sec = 0, tv_nsec = 0}}}, sysenter_return = 0x0,
sig_on_uaccess_error = 0, uaccess_err = 0}
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists