lkml.org 
[lkml]   [2019]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v9 14/21] x86: mm: Don't display pages which aren't present in debugfs
    Date
    For the /sys/kernel/debug/page_tables/ files, rather than outputing a
    mostly empty line when a block of memory isn't present just skip the
    line. This keeps the output shorter and will help with a future change
    switching to using the generic page walk code as we no longer care about
    the 'level' that the page table holes are at.

    Signed-off-by: Steven Price <steven.price@arm.com>
    ---
    arch/x86/mm/dump_pagetables.c | 7 ++++---
    1 file changed, 4 insertions(+), 3 deletions(-)

    diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
    index ab67822fd2f4..95728027dd3b 100644
    --- a/arch/x86/mm/dump_pagetables.c
    +++ b/arch/x86/mm/dump_pagetables.c
    @@ -301,8 +301,8 @@ static void note_page(struct seq_file *m, struct pg_state *st,
    /*
    * Now print the actual finished series
    */
    - if (!st->marker->max_lines ||
    - st->lines < st->marker->max_lines) {
    + if ((cur & _PAGE_PRESENT) && (!st->marker->max_lines ||
    + st->lines < st->marker->max_lines)) {
    pt_dump_seq_printf(m, st->to_dmesg,
    "0x%0*lx-0x%0*lx ",
    width, st->start_address,
    @@ -318,7 +318,8 @@ static void note_page(struct seq_file *m, struct pg_state *st,
    printk_prot(m, st->current_prot, st->level,
    st->to_dmesg);
    }
    - st->lines++;
    + if (cur & _PAGE_PRESENT)
    + st->lines++;

    /*
    * We print markers for special areas of address space,
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-07-22 17:43    [W:2.622 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site