~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/scripts/gdb/linux/vmalloc.py

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /scripts/gdb/linux/vmalloc.py (Version linux-6.12-rc7) and /scripts/gdb/linux/vmalloc.py (Version linux-6.6.60)


  1 # SPDX-License-Identifier: GPL-2.0                  1 # SPDX-License-Identifier: GPL-2.0
  2 #                                                   2 #
  3 # Copyright (c) 2023 MediaTek Inc.                  3 # Copyright (c) 2023 MediaTek Inc.
  4 #                                                   4 #
  5 # Authors:                                          5 # Authors:
  6 #  Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>        6 #  Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
  7 #                                                   7 #
  8                                                     8 
  9 import gdb                                          9 import gdb
 10 import re                                          10 import re
 11 from linux import lists, utils, stackdepot, co     11 from linux import lists, utils, stackdepot, constants, mm
 12                                                    12 
 13 if constants.LX_CONFIG_MMU:                        13 if constants.LX_CONFIG_MMU:
 14     vmap_area_type = utils.CachedType('struct      14     vmap_area_type = utils.CachedType('struct vmap_area')
 15     vmap_area_ptr_type = vmap_area_type.get_ty     15     vmap_area_ptr_type = vmap_area_type.get_type().pointer()
 16                                                    16 
 17 def is_vmalloc_addr(x):                            17 def is_vmalloc_addr(x):
 18     pg_ops = mm.page_ops().ops                     18     pg_ops = mm.page_ops().ops
 19     addr = pg_ops.kasan_reset_tag(x)               19     addr = pg_ops.kasan_reset_tag(x)
 20     return addr >= pg_ops.VMALLOC_START and ad     20     return addr >= pg_ops.VMALLOC_START and addr < pg_ops.VMALLOC_END
 21                                                    21 
 22 class LxVmallocInfo(gdb.Command):                  22 class LxVmallocInfo(gdb.Command):
 23     """Show vmallocinfo"""                         23     """Show vmallocinfo"""
 24                                                    24 
 25     def __init__(self):                            25     def __init__(self):
 26         super(LxVmallocInfo, self).__init__("l     26         super(LxVmallocInfo, self).__init__("lx-vmallocinfo", gdb.COMMAND_DATA)
 27                                                    27 
 28     def invoke(self, arg, from_tty):               28     def invoke(self, arg, from_tty):
 29         if not constants.LX_CONFIG_MMU:            29         if not constants.LX_CONFIG_MMU:
 30             raise gdb.GdbError("Requires MMU s     30             raise gdb.GdbError("Requires MMU support")
 31                                                    31 
 32         nr_vmap_nodes = gdb.parse_and_eval('nr !!  32         vmap_area_list = gdb.parse_and_eval('vmap_area_list')
 33         for i in range(0, nr_vmap_nodes):      !!  33         for vmap_area in lists.list_for_each_entry(vmap_area_list, vmap_area_ptr_type, "list"):
 34             vn = gdb.parse_and_eval('&vmap_nod !!  34             if not vmap_area['vm']:
 35             for vmap_area in lists.list_for_ea !!  35                 gdb.write("0x%x-0x%x %10d vm_map_ram\n" % (vmap_area['va_start'], vmap_area['va_end'],
 36                 if not vmap_area['vm']:        !!  36                     vmap_area['va_end'] - vmap_area['va_start']))
 37                     gdb.write("0x%x-0x%x %10d  !!  37                 continue
 38                         vmap_area['va_end'] -  !!  38             v = vmap_area['vm']
 39                     continue                   !!  39             gdb.write("0x%x-0x%x %10d" % (v['addr'], v['addr'] + v['size'], v['size']))
 40                 v = vmap_area['vm']            !!  40             if v['caller']:
 41                 gdb.write("0x%x-0x%x %10d" % ( !!  41                 gdb.write(" %s" % str(v['caller']).split(' ')[-1])
 42                 if v['caller']:                !!  42             if v['nr_pages']:
 43                     gdb.write(" %s" % str(v['c !!  43                 gdb.write(" pages=%d" % v['nr_pages'])
 44                 if v['nr_pages']:              !!  44             if v['phys_addr']:
 45                     gdb.write(" pages=%d" % v[ !!  45                 gdb.write(" phys=0x%x" % v['phys_addr'])
 46                 if v['phys_addr']:             !!  46             if v['flags'] & constants.LX_VM_IOREMAP:
 47                     gdb.write(" phys=0x%x" % v !!  47                 gdb.write(" ioremap")
 48                 if v['flags'] & constants.LX_V !!  48             if v['flags'] & constants.LX_VM_ALLOC:
 49                     gdb.write(" ioremap")      !!  49                 gdb.write(" vmalloc")
 50                 if v['flags'] & constants.LX_V !!  50             if v['flags'] & constants.LX_VM_MAP:
 51                     gdb.write(" vmalloc")      !!  51                 gdb.write(" vmap")
 52                 if v['flags'] & constants.LX_V !!  52             if v['flags'] & constants.LX_VM_USERMAP:
 53                     gdb.write(" vmap")         !!  53                 gdb.write(" user")
 54                 if v['flags'] & constants.LX_V !!  54             if v['flags'] & constants.LX_VM_DMA_COHERENT:
 55                     gdb.write(" user")         !!  55                 gdb.write(" dma-coherent")
 56                 if v['flags'] & constants.LX_V !!  56             if is_vmalloc_addr(v['pages']):
 57                     gdb.write(" dma-coherent") !!  57                 gdb.write(" vpages")
 58                 if is_vmalloc_addr(v['pages']) !!  58             gdb.write("\n")
 59                     gdb.write(" vpages")       << 
 60                 gdb.write("\n")                << 
 61                                                    59 
 62 LxVmallocInfo()                                    60 LxVmallocInfo()
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php