Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1433064 > unrolled thread
| Started by | Kieran Bingham <kieran@ksquared.org.uk> |
|---|---|
| First post | 2016-06-28 17:30 +0200 |
| Last post | 2016-06-29 07:10 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/6] scripts/gdb: Fixes for 4.7 Kieran Bingham <kieran@ksquared.org.uk> - 2016-06-28 17:30 +0200
[PATCH 6/6] Revert "scripts/gdb: add documentation example for radix tree" Kieran Bingham <kieran@ksquared.org.uk> - 2016-06-28 17:30 +0200
[PATCH 5/6] Revert "scripts/gdb: add a Radix Tree Parser" Kieran Bingham <kieran@ksquared.org.uk> - 2016-06-28 17:30 +0200
Re: [PATCH 0/6] scripts/gdb: Fixes for 4.7 Jan Kiszka <jan.kiszka@siemens.com> - 2016-06-29 07:10 +0200
| From | Kieran Bingham <kieran@ksquared.org.uk> |
|---|---|
| Date | 2016-06-28 17:30 +0200 |
| Subject | [PATCH 0/6] scripts/gdb: Fixes for 4.7 |
| Message-ID | <rP37z-oa-3@gated-at.bofh.it> |
Hi Andrew, Please consider this series for integration into the current rc series. I had hoped to get this to you, with a fixed radix-tree, rather than a reverted one. Alas, time has gone against me, and we are nearing the end of the window - so having discussed with Jan, we felt it best to simply revert the feature for this release. Aside from the revert, we have four fairly minor fixups. Kieran Bingham (4): scripts/gdb: silence 'nothing to do' message scripts/gdb: rebuild constants.py on dependancy change Revert "scripts/gdb: add a Radix Tree Parser" Revert "scripts/gdb: add documentation example for radix tree" Nikolay Borisov (1): scripts/gdb: Perform path expansion to lx-symbol's arguments Omar Sandoval (1): scripts/gdb: add constants.py to .gitignore Documentation/gdb-kernel-debugging.txt | 21 -------- scripts/gdb/linux/.gitignore | 1 + scripts/gdb/linux/Makefile | 6 ++- scripts/gdb/linux/constants.py.in | 7 --- scripts/gdb/linux/radixtree.py | 97 ---------------------------------- scripts/gdb/linux/symbols.py | 2 +- scripts/gdb/vmlinux-gdb.py | 1 - 7 files changed, 6 insertions(+), 129 deletions(-) delete mode 100644 scripts/gdb/linux/radixtree.py -- 2.7.4
[toc] | [next] | [standalone]
| From | Kieran Bingham <kieran@ksquared.org.uk> |
|---|---|
| Date | 2016-06-28 17:30 +0200 |
| Subject | [PATCH 6/6] Revert "scripts/gdb: add documentation example for radix tree" |
| Message-ID | <rP37A-oa-23@gated-at.bofh.it> |
| In reply to | #1433064 |
This reverts commit 9b5580359a84 ("scripts/gdb: add documentation
example for radix tree")
The python implementation of radix tree was merged at the same time as a
refactoring of the radix tree implementation and doesn't work. The
feature is being reverted, thus we revert the documentation as well.
Signed-off-by: Kieran Bingham <kieran@bingham.xyz>
---
Documentation/gdb-kernel-debugging.txt | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/Documentation/gdb-kernel-debugging.txt b/Documentation/gdb-kernel-debugging.txt
index 4ab7d43d0754..7050ce8794b9 100644
--- a/Documentation/gdb-kernel-debugging.txt
+++ b/Documentation/gdb-kernel-debugging.txt
@@ -139,27 +139,6 @@ Examples of using the Linux-provided gdb helpers
start_comm = "swapper/2\000\000\000\000\000\000"
}
- o Dig into a radix tree data structure, such as the IRQ descriptors:
- (gdb) print (struct irq_desc)$lx_radix_tree_lookup(irq_desc_tree, 18)
- $6 = {
- irq_common_data = {
- state_use_accessors = 67584,
- handler_data = 0x0 <__vectors_start>,
- msi_desc = 0x0 <__vectors_start>,
- affinity = {{
- bits = {65535}
- }}
- },
- irq_data = {
- mask = 0,
- irq = 18,
- hwirq = 27,
- common = 0xee803d80,
- chip = 0xc0eb0854 <gic_data>,
- domain = 0xee808000,
- parent_data = 0x0 <__vectors_start>,
- chip_data = 0xc0eb0854 <gic_data>
- } <... trimmed ...>
List of commands and functions
------------------------------
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Kieran Bingham <kieran@ksquared.org.uk> |
|---|---|
| Date | 2016-06-28 17:30 +0200 |
| Subject | [PATCH 5/6] Revert "scripts/gdb: add a Radix Tree Parser" |
| Message-ID | <rP37A-oa-25@gated-at.bofh.it> |
| In reply to | #1433064 |
This reverts commit e127a73d41ac ("scripts/gdb: add a Radix Tree Parser")
The python implementation of radix-tree was merged at the same time as
the radix-tree system was heavily reworked from commit e9256efcc8e3
("radix-tree: introduce radix_tree_empty") to 3bcadd6fa6c4 ("radix-tree:
free up the bottom bit of exceptional entries for reuse") and no longer
functions, but also prevents other gdb scripts from loading.
This functionality has not yet hit a release, so simply remove it for
now
Signed-off-by: Kieran Bingham <kieran@bingham.xyz>
---
Due to unfortunate timing, the radix tree python implementation was
merged at the same time as the radix-tree itself was heavily rewritten.
Unfortunately I have not been able to find enough time to rewrite the
python implementation in this rc-window, and as the radix-tree.py has
not yet made it out to a release in a working state, at this point the
best thing to do is to revert it. (It currently causes breakage for the
other gdb scripts
I will then intend to resubmit a new implementation for a later release,
and also we can plan an automated test service for the scripts to catch
these issues earlier.
scripts/gdb/linux/constants.py.in | 7 ---
scripts/gdb/linux/radixtree.py | 97 ---------------------------------------
scripts/gdb/vmlinux-gdb.py | 1 -
3 files changed, 105 deletions(-)
delete mode 100644 scripts/gdb/linux/radixtree.py
diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in
index 07e6c2befe36..7986f4e0da12 100644
--- a/scripts/gdb/linux/constants.py.in
+++ b/scripts/gdb/linux/constants.py.in
@@ -14,7 +14,6 @@
#include <linux/fs.h>
#include <linux/mount.h>
-#include <linux/radix-tree.h>
/* We need to stringify expanded macros so that they can be parsed */
@@ -51,9 +50,3 @@ LX_VALUE(MNT_NOEXEC)
LX_VALUE(MNT_NOATIME)
LX_VALUE(MNT_NODIRATIME)
LX_VALUE(MNT_RELATIME)
-
-/* linux/radix-tree.h */
-LX_VALUE(RADIX_TREE_INDIRECT_PTR)
-LX_GDBPARSED(RADIX_TREE_HEIGHT_MASK)
-LX_GDBPARSED(RADIX_TREE_MAP_SHIFT)
-LX_GDBPARSED(RADIX_TREE_MAP_MASK)
diff --git a/scripts/gdb/linux/radixtree.py b/scripts/gdb/linux/radixtree.py
deleted file mode 100644
index 0fdef4e2971a..000000000000
--- a/scripts/gdb/linux/radixtree.py
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# gdb helper commands and functions for Linux kernel debugging
-#
-# Radix Tree Parser
-#
-# Copyright (c) 2016 Linaro Ltd
-#
-# Authors:
-# Kieran Bingham <kieran.bingham@linaro.org>
-#
-# This work is licensed under the terms of the GNU GPL version 2.
-#
-
-import gdb
-
-from linux import utils
-from linux import constants
-
-radix_tree_root_type = utils.CachedType("struct radix_tree_root")
-radix_tree_node_type = utils.CachedType("struct radix_tree_node")
-
-
-def is_indirect_ptr(node):
- long_type = utils.get_long_type()
- return (node.cast(long_type) & constants.LX_RADIX_TREE_INDIRECT_PTR)
-
-
-def indirect_to_ptr(node):
- long_type = utils.get_long_type()
- node_type = node.type
- indirect_ptr = node.cast(long_type) & ~constants.LX_RADIX_TREE_INDIRECT_PTR
- return indirect_ptr.cast(node_type)
-
-
-def maxindex(height):
- height = height & constants.LX_RADIX_TREE_HEIGHT_MASK
- return gdb.parse_and_eval("height_to_maxindex["+str(height)+"]")
-
-
-def lookup(root, index):
- if root.type == radix_tree_root_type.get_type().pointer():
- root = root.dereference()
- elif root.type != radix_tree_root_type.get_type():
- raise gdb.GdbError("Must be struct radix_tree_root not {}"
- .format(root.type))
-
- node = root['rnode']
- if node is 0:
- return None
-
- if not (is_indirect_ptr(node)):
- if (index > 0):
- return None
- return node
-
- node = indirect_to_ptr(node)
-
- height = node['path'] & constants.LX_RADIX_TREE_HEIGHT_MASK
- if (index > maxindex(height)):
- return None
-
- shift = (height-1) * constants.LX_RADIX_TREE_MAP_SHIFT
-
- while True:
- new_index = (index >> shift) & constants.LX_RADIX_TREE_MAP_MASK
- slot = node['slots'][new_index]
-
- node = slot.cast(node.type.pointer()).dereference()
- if node is 0:
- return None
-
- shift -= constants.LX_RADIX_TREE_MAP_SHIFT
- height -= 1
-
- if (height <= 0):
- break
-
- return node
-
-
-class LxRadixTree(gdb.Function):
- """ Lookup and return a node from a RadixTree.
-
-$lx_radix_tree_lookup(root_node [, index]): Return the node at the given index.
-If index is omitted, the root node is dereferenced and returned."""
-
- def __init__(self):
- super(LxRadixTree, self).__init__("lx_radix_tree_lookup")
-
- def invoke(self, root, index=0):
- result = lookup(root, index)
- if result is None:
- raise gdb.GdbError("No entry in tree at index {}".format(index))
-
- return result
-
-LxRadixTree()
diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py
index 3a80ad6eecad..6e0b0afd888a 100644
--- a/scripts/gdb/vmlinux-gdb.py
+++ b/scripts/gdb/vmlinux-gdb.py
@@ -31,4 +31,3 @@ else:
import linux.lists
import linux.proc
import linux.constants
- import linux.radixtree
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Jan Kiszka <jan.kiszka@siemens.com> |
|---|---|
| Date | 2016-06-29 07:10 +0200 |
| Message-ID | <rPfV7-8oI-11@gated-at.bofh.it> |
| In reply to | #1433064 |
On 2016-06-28 17:22, Kieran Bingham wrote: > Hi Andrew, > > Please consider this series for integration into the current rc series. > I had hoped to get this to you, with a fixed radix-tree, rather than a > reverted one. Alas, time has gone against me, and we are nearing the end > of the window - so having discussed with Jan, we felt it best to simply > revert the feature for this release. > > Aside from the revert, we have four fairly minor fixups. > > Kieran Bingham (4): > scripts/gdb: silence 'nothing to do' message > scripts/gdb: rebuild constants.py on dependancy change > Revert "scripts/gdb: add a Radix Tree Parser" > Revert "scripts/gdb: add documentation example for radix tree" > > Nikolay Borisov (1): > scripts/gdb: Perform path expansion to lx-symbol's arguments > > Omar Sandoval (1): > scripts/gdb: add constants.py to .gitignore > > Documentation/gdb-kernel-debugging.txt | 21 -------- > scripts/gdb/linux/.gitignore | 1 + > scripts/gdb/linux/Makefile | 6 ++- > scripts/gdb/linux/constants.py.in | 7 --- > scripts/gdb/linux/radixtree.py | 97 ---------------------------------- > scripts/gdb/linux/symbols.py | 2 +- > scripts/gdb/vmlinux-gdb.py | 1 - > 7 files changed, 6 insertions(+), 129 deletions(-) > delete mode 100644 scripts/gdb/linux/radixtree.py > For all: Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Thanks! Jan -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web