LCOV - code coverage report
Current view: top level - lib - show_mem.c (source / functions) Hit Total Coverage
Test: Real Lines: 0 15 0.0 %
Date: 2020-10-17 15:46:16 Functions: 0 1 0.0 %
Legend: Neither, QEMU, Real, Both Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // SPDX-License-Identifier: GPL-2.0-only
       2                 :            : /*
       3                 :            :  * Generic show_mem() implementation
       4                 :            :  *
       5                 :            :  * Copyright (C) 2008 Johannes Weiner <hannes@saeurebad.de>
       6                 :            :  */
       7                 :            : 
       8                 :            : #include <linux/mm.h>
       9                 :            : #include <linux/cma.h>
      10                 :            : 
      11                 :          0 : void show_mem(unsigned int filter, nodemask_t *nodemask)
      12                 :            : {
      13                 :            :         pg_data_t *pgdat;
      14                 :            :         unsigned long total = 0, reserved = 0, highmem = 0;
      15                 :            : 
      16                 :          0 :         printk("Mem-Info:\n");
      17                 :          0 :         show_free_areas(filter, nodemask);
      18                 :            : 
      19                 :          0 :         for_each_online_pgdat(pgdat) {
      20                 :            :                 int zoneid;
      21                 :            : 
      22                 :          0 :                 for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
      23                 :          0 :                         struct zone *zone = &pgdat->node_zones[zoneid];
      24                 :          0 :                         if (!populated_zone(zone))
      25                 :          0 :                                 continue;
      26                 :            : 
      27                 :          0 :                         total += zone->present_pages;
      28                 :          0 :                         reserved += zone->present_pages - zone_managed_pages(zone);
      29                 :            : 
      30                 :            :                         if (is_highmem_idx(zoneid))
      31                 :            :                                 highmem += zone->present_pages;
      32                 :            :                 }
      33                 :            :         }
      34                 :            : 
      35                 :          0 :         printk("%lu pages RAM\n", total);
      36                 :          0 :         printk("%lu pages HighMem/MovableOnly\n", highmem);
      37                 :          0 :         printk("%lu pages reserved\n", reserved);
      38                 :            : #ifdef CONFIG_CMA
      39                 :          0 :         printk("%lu pages cma reserved\n", totalcma_pages);
      40                 :            : #endif
      41                 :            : #ifdef CONFIG_MEMORY_FAILURE
      42                 :            :         printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages));
      43                 :            : #endif
      44                 :          0 : }
    

Generated by: LCOV version 1.14