linux-stable/drivers/base
Konstantin Khlebnikov 9d7ea9a297 mm/vmstat: add helpers to get vmstat item names for each enum type
Statistics in vmstat is combined from counters with different structure,
but names for them are merged into one array.

This patch adds trivial helpers to get name for each item:

  const char *zone_stat_name(enum zone_stat_item item);
  const char *numa_stat_name(enum numa_stat_item item);
  const char *node_stat_name(enum node_stat_item item);
  const char *writeback_stat_name(enum writeback_stat_item item);
  const char *vm_event_name(enum vm_event_item item);

Names for enum writeback_stat_item are folded in the middle of
vmstat_text so this patch moves declaration into header to calculate
offset of following items.

Also this patch reuses piece of node stat names for lru list names:

  const char *lru_list_name(enum lru_list lru);

This returns common lru list names: "inactive_anon", "active_anon",
"inactive_file", "active_file", "unevictable".

[khlebnikov@yandex-team.ru: do not use size of vmstat_text as count of /proc/vmstat items]
  Link: http://lkml.kernel.org/r/157152151769.4139.15423465513138349343.stgit@buzz
  Link: https://lore.kernel.org/linux-mm/cd1c42ae-281f-c8a8-70ac-1d01d417b2e1@infradead.org/T/#u
Link: http://lkml.kernel.org/r/157113012325.453.562783073839432766.stgit@buzz
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: YueHaibing <yuehaibing@huawei.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-12-04 19:44:11 -08:00
..
firmware_loader drivers: base: Fix Kconfig indentation 2019-11-20 15:10:25 +01:00
power Merge branches 'pm-sleep', 'pm-domains', 'pm-opp' and 'powercap' 2019-11-26 10:27:49 +01:00
regmap regmap: regmap-w1: Drop unreachable code 2019-11-19 13:09:20 +00:00
test
Kconfig
Makefile
arch_topology.c Power management updates for 5.4-rc1 2019-09-17 19:15:14 -07:00
attribute_container.c
base.h
bus.c
cacheinfo.c
class.c
component.c
container.c
core.c driver core: Allow device link operations inside sync_state() 2019-11-15 10:06:54 +08:00
cpu.c x86/bugs: Add ITLB_MULTIHIT bug infrastructure 2019-11-04 12:22:01 +01:00
dd.c
devcon.c
devcoredump.c
devres.c
devtmpfs.c
driver.c
firmware.c
hypervisor.c
init.c
isa.c
map.c
memory.c drivers/base/memory.c: drop the mem_sysfs_mutex 2019-12-01 12:59:04 -08:00
module.c
node.c mm/vmstat: add helpers to get vmstat item names for each enum type 2019-12-04 19:44:11 -08:00
pinctrl.c
platform-msi.c
platform.c driver core: platform: Declare ret variable only once 2019-11-14 12:33:55 +08:00
property.c device property: Add a function to obtain a node's prefix 2019-10-11 11:26:55 +02:00
soc.c base: soc: Handle custom soc information sysfs entries 2019-10-10 14:35:32 +02:00
swnode.c software node: simplify property_entry_read_string_array() 2019-11-05 23:18:10 +01:00
syscore.c
topology.c
transport_class.c