<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/scripts/gdb/linux/tasks.py, branch v4.8-rc6</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>scripts/gdb: add lx_thread_info_by_pid helper</title>
<updated>2016-05-24T00:04:14+00:00</updated>
<author>
<name>Kieran Bingham</name>
<email>kieran.bingham@linaro.org</email>
</author>
<published>2016-05-23T23:25:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9f66dee720984edcbc6ea07ad70fe5b8f0421c04'/>
<id>9f66dee720984edcbc6ea07ad70fe5b8f0421c04</id>
<content type='text'>
The tasks module already provides helpers to find the task struct by
pid, and the thread_info by task struct; however this is cumbersome to
utilise on the gdb commandline.

Wrap these two functionalities together in an extra single helper to
allow exploring the thread info, from a PID value

Link: http://lkml.kernel.org/r/dadc5667f053ec811eb3e3033d99d937fedbc93b.1462865983.git.jan.kiszka@siemens.com
Signed-off-by: Kieran Bingham &lt;kieran.bingham@linaro.org&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tasks module already provides helpers to find the task struct by
pid, and the thread_info by task struct; however this is cumbersome to
utilise on the gdb commandline.

Wrap these two functionalities together in an extra single helper to
allow exploring the thread info, from a PID value

Link: http://lkml.kernel.org/r/dadc5667f053ec811eb3e3033d99d937fedbc93b.1462865983.git.jan.kiszka@siemens.com
Signed-off-by: Kieran Bingham &lt;kieran.bingham@linaro.org&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb: remove useless global instruction</title>
<updated>2015-07-01T02:44:58+00:00</updated>
<author>
<name>Thiébaud Weksteen</name>
<email>thiebaud@weksteen.fr</email>
</author>
<published>2015-06-30T21:58:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=15f1d827810e085496eb7ae82aa3ed2dba9901cc'/>
<id>15f1d827810e085496eb7ae82aa3ed2dba9901cc</id>
<content type='text'>
Signed-off-by: Thiébaud Weksteen &lt;thiebaud@weksteen.fr&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thiébaud Weksteen &lt;thiebaud@weksteen.fr&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb: add ps command</title>
<updated>2015-07-01T02:44:58+00:00</updated>
<author>
<name>Thiébaud Weksteen</name>
<email>thiebaud@weksteen.fr</email>
</author>
<published>2015-06-30T21:58:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a930850b628497601309513dc894ea23218a19fa'/>
<id>a930850b628497601309513dc894ea23218a19fa</id>
<content type='text'>
Signed-off-by: Thiébaud Weksteen &lt;thiebaud@weksteen.fr&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thiébaud Weksteen &lt;thiebaud@weksteen.fr&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb: fix PEP8 compliance</title>
<updated>2015-07-01T02:44:58+00:00</updated>
<author>
<name>Thiébaud Weksteen</name>
<email>thiebaud@weksteen.fr</email>
</author>
<published>2015-06-30T21:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ad18b73317714e7d0fad08ee78365ecc817e923'/>
<id>6ad18b73317714e7d0fad08ee78365ecc817e923</id>
<content type='text'>
Signed-off-by: Thiébaud Weksteen &lt;thiebaud@weksteen.fr&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thiébaud Weksteen &lt;thiebaud@weksteen.fr&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb: use a generator instead of iterator for task list</title>
<updated>2015-02-17T22:34:54+00:00</updated>
<author>
<name>Daniel Wagner</name>
<email>daniel.wagner@bmw-carit.de</email>
</author>
<published>2015-02-17T21:47:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=54e2289a34e13d956acb841a00c3a6f06aced3f9'/>
<id>54e2289a34e13d956acb841a00c3a6f06aced3f9</id>
<content type='text'>
The iterator does not return any task_struct from the thread_group list
because the first condition in the 'if not t or ...' will only be the
first time None.

Instead of keeping track of the state ourself in the next() function, we
fall back using Python's generator.

Signed-off-by: Daniel Wagner &lt;daniel.wagner@bmw-carit.de&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The iterator does not return any task_struct from the thread_group list
because the first condition in the 'if not t or ...' will only be the
first time None.

Instead of keeping track of the state ourself in the next() function, we
fall back using Python's generator.

Signed-off-by: Daniel Wagner &lt;daniel.wagner@bmw-carit.de&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb: port to python3 / gdb7.7</title>
<updated>2015-02-17T22:34:54+00:00</updated>
<author>
<name>Pantelis Koukousoulas</name>
<email>pktoss@gmail.com</email>
</author>
<published>2015-02-17T21:47:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=276d97d90a2485f9a830a7a8242e4317b24c896f'/>
<id>276d97d90a2485f9a830a7a8242e4317b24c896f</id>
<content type='text'>
I tried to use these scripts in an ubuntu 14.04 host (gdb 7.7 compiled
against python 3.3) but there were several errors.

I believe this patch fixes these issues so that the commands now work (I
tested lx-symbols, lx-dmesg, lx-lsmod).

Main issues that needed to be resolved:

  * In python 2 iterators have a "next()" method. In python 3 it is
    __next__() instead (so let's just add both).

  * In older python versions there was an implicit conversion
    in object.__format__() (used when an object is in string.format())
    where it was converting the object to str first and then
    calling str's __format__(). This has now been removed so
    we must explicitly convert to str the objects for which
    we need to keep this behavior.

  * In dmesg.py: in python 3 log_buf is now a "memoryview" object
    which needs to be converted to a string in order to use string
    methods like "splitlines()". Luckily memoryview exists in
    python 2.7.6 as well, so we can convert log_buf to memoryview
    and use the same code in both python 2 and python 3.

This version of the patch has now been tested with gdb 7.7 and both python
3.4 and python 2.7.6 (I think asking for at least python 2.7.6 is a
reasonable requirement instead of complicating the code with version
checks etc).

Signed-off-by: Pantelis Koukousoulas &lt;pktoss@gmail.com&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I tried to use these scripts in an ubuntu 14.04 host (gdb 7.7 compiled
against python 3.3) but there were several errors.

I believe this patch fixes these issues so that the commands now work (I
tested lx-symbols, lx-dmesg, lx-lsmod).

Main issues that needed to be resolved:

  * In python 2 iterators have a "next()" method. In python 3 it is
    __next__() instead (so let's just add both).

  * In older python versions there was an implicit conversion
    in object.__format__() (used when an object is in string.format())
    where it was converting the object to str first and then
    calling str's __format__(). This has now been removed so
    we must explicitly convert to str the objects for which
    we need to keep this behavior.

  * In dmesg.py: in python 3 log_buf is now a "memoryview" object
    which needs to be converted to a string in order to use string
    methods like "splitlines()". Luckily memoryview exists in
    python 2.7.6 as well, so we can convert log_buf to memoryview
    and use the same code in both python 2 and python 3.

This version of the patch has now been tested with gdb 7.7 and both python
3.4 and python 2.7.6 (I think asking for at least python 2.7.6 is a
reasonable requirement instead of complicating the code with version
checks etc).

Signed-off-by: Pantelis Koukousoulas &lt;pktoss@gmail.com&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb: add internal helper and convenience function to retrieve thread_info</title>
<updated>2015-02-17T22:34:54+00:00</updated>
<author>
<name>Jan Kiszka</name>
<email>jan.kiszka@siemens.com</email>
</author>
<published>2015-02-17T21:47:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf7492e933c0df200f8fa46c3684e8bd20890ab2'/>
<id>cf7492e933c0df200f8fa46c3684e8bd20890ab2</id>
<content type='text'>
Add the internal helper get_thread_info that calculates the thread_info
from a given task variable.  Also export this service as a convenience
function.

Note: ia64 version is untested.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the internal helper get_thread_info that calculates the thread_info
from a given task variable.  Also export this service as a convenience
function.

Note: ia64 version is untested.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb: add helper and convenience function to look up tasks</title>
<updated>2015-02-17T22:34:54+00:00</updated>
<author>
<name>Jan Kiszka</name>
<email>jan.kiszka@siemens.com</email>
</author>
<published>2015-02-17T21:47:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4752871081ba4fbb3c539488a95e77d8011bfe49'/>
<id>4752871081ba4fbb3c539488a95e77d8011bfe49</id>
<content type='text'>
Add the helper task_by_pid that can look up a task by its PID.  Also
export it as a convenience function.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the helper task_by_pid that can look up a task by its PID.  Also
export it as a convenience function.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb: add task iteration class</title>
<updated>2015-02-17T22:34:54+00:00</updated>
<author>
<name>Jan Kiszka</name>
<email>jan.kiszka@siemens.com</email>
</author>
<published>2015-02-17T21:47:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7704d58a8509c65e3f7e4407ca2e5fa6360349c1'/>
<id>7704d58a8509c65e3f7e4407ca2e5fa6360349c1</id>
<content type='text'>
This class allows to iterate over all tasks of the target.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This class allows to iterate over all tasks of the target.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
